IF(${HAVE_SALOME})
ADD_SUBDIRECTORY (src/NewGeom)
ENDIF(${HAVE_SALOME})
+
+FIND_PACKAGE(PythonInterp REQUIRED)
+ENABLE_TESTING()
mkdir %ROOT_DIR%\build
cd %ROOT_DIR%\build
-cmake %SRC_DIR% -G "Visual Studio 10" -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX:PATH=%ROOT_DIR%\install
+cmake %SRC_DIR% -G "Visual Studio 10" -DPYTHON_EXECUTABLE=%PYTHONHOME%\python_d.exe -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX:PATH=%ROOT_DIR%\install
start "" %MSVC_EXE% NewGEOM.sln
@SET CMAKE_ARGS=%CMAKE_ARGS% -DCMAKE_BUILD_TYPE=Debug
@SET CMAKE_ARGS=%CMAKE_ARGS% -DCMAKE_ECLIPSE_GENERATE_SOURCE_PROJECT=ON
@SET CMAKE_ARGS=%CMAKE_ARGS% -DCMAKE_INSTALL_PREFIX:PATH=%ROOT_DIR%\install
+@SET CMAKE_ARGS=%CMAKE_ARGS% -DPYTHON_EXECUTABLE=%PYTHONHOME%\python_d.exe
@SET CMAKE_ARGS=%CMAKE_ARGS% %SRC_DIR%
cmake %CMAKE_ARGS%
-pause
@REM Should be defined at ..\local_env.bat
start %ECLIPSE_EXE%
@REM -------------------------
@SET NEW_GEOM_CONFIG_FILE=%ROOT_DIR%\install\plugins
-@SET PATH=%ROOT_DIR%\install\plugins;%PATH%
+@SET PATH=%ROOT_DIR%\install\plugins;%ROOT_DIR%\install\bin;%PATH%
+@SET PYTHONPATH=%ROOT_DIR%\install\swig;%PYTHONPATH%
@REM -------------------------
if "%GUI_ROOT_DIR%" == "" (
point_widget.xml
)
+ADD_SUBDIRECTORY(Test)
+
INSTALL(TARGETS ConstructionPlugin DESTINATION plugins)
INSTALL(FILES ${XML_RESOURCES} DESTINATION plugins)
+
+ENABLE_TESTING()
--- /dev/null
+INCLUDE(Common)
+
+ENABLE_TESTING()
+ADD_TEST(ConstructionPluginTest
+ ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test_point_name.py)
--- /dev/null
+from ModelAPI import *
+p = ModelAPI_PluginManager.get()
+f = p.rootDocument().addFeature("Point")
+f_name = f.data().name()
+f.execute()
+
+doc = p.rootDocument()
+f1 = doc.object("Construction", 0)
+f1_name = f1.data().name()
+
+assert (f_name == f1_name)