]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Unit test example added
authorsbh <sergey.belash@opencascade.com>
Wed, 16 Jul 2014 14:13:11 +0000 (18:13 +0400)
committersbh <sergey.belash@opencascade.com>
Wed, 16 Jul 2014 14:13:35 +0000 (18:13 +0400)
CMakeLists.txt
buildNewGEOM_deb.bat
buildNewGEOM_eclipse.bat
msvc10_env.bat
src/ConstructionPlugin/CMakeLists.txt
src/ConstructionPlugin/Test/CMakeLists.txt [new file with mode: 0644]
src/ConstructionPlugin/Test/test_point_name.py [new file with mode: 0644]

index 7a276cea134134a10a953b34b7f81d8f2f53736d..7b6d98c3ae913a97ac3b8a6b6047ff7aa51f44e8 100644 (file)
@@ -47,3 +47,6 @@ ADD_SUBDIRECTORY (src/GeomApp)
 IF(${HAVE_SALOME})
        ADD_SUBDIRECTORY (src/NewGeom)
 ENDIF(${HAVE_SALOME})
+
+FIND_PACKAGE(PythonInterp REQUIRED)
+ENABLE_TESTING()
index 1b4ddccf0626244cd1d36783cb7eda3d81cfe397..7756085964e66124c43a5839e08d032de4b43477 100644 (file)
@@ -14,6 +14,6 @@ call %SRC_DIR%\msvc10_env.bat
 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
index b5fa7c13156995ce71b0c06067beffacec9c402e..aa255f28fd72f8294439dc5d6d26f6d88896ecfe 100644 (file)
@@ -20,10 +20,10 @@ cd %ROOT_DIR%\build-eclipse
 @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%
index 1d2233ce4347d693a6ed7525d8893254246317e8..ab394bec9c288d1645fb5525d5d5263a20495968 100644 (file)
@@ -132,7 +132,8 @@ set PATH=%CMAKEDIR%\bin;%PATH%
 @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%" == "" (
index 1c81b62aaad584e2481476434ae9f4d9665d084f..13091e348d57ca84b967d877e92852d6755d574f 100644 (file)
@@ -26,5 +26,9 @@ SET(XML_RESOURCES
   point_widget.xml
 )
 
+ADD_SUBDIRECTORY(Test)
+
 INSTALL(TARGETS ConstructionPlugin DESTINATION plugins)
 INSTALL(FILES ${XML_RESOURCES} DESTINATION plugins)
+
+ENABLE_TESTING()
diff --git a/src/ConstructionPlugin/Test/CMakeLists.txt b/src/ConstructionPlugin/Test/CMakeLists.txt
new file mode 100644 (file)
index 0000000..36dd358
--- /dev/null
@@ -0,0 +1,5 @@
+INCLUDE(Common)
+
+ENABLE_TESTING()
+ADD_TEST(ConstructionPluginTest 
+         ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test_point_name.py)
diff --git a/src/ConstructionPlugin/Test/test_point_name.py b/src/ConstructionPlugin/Test/test_point_name.py
new file mode 100644 (file)
index 0000000..06e70e6
--- /dev/null
@@ -0,0 +1,11 @@
+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)