]> SALOME platform Git repositories - tools/medcoupling.git/commitdiff
Salome HOME
Reactivate a forgotten test agy/edf19821_tmp_dir
authorAnthony Geay <anthony.geay@edf.fr>
Fri, 19 Jul 2019 06:14:34 +0000 (08:14 +0200)
committerAnthony Geay <anthony.geay@edf.fr>
Fri, 19 Jul 2019 06:14:34 +0000 (08:14 +0200)
src/RENUMBER_Swig/CMakeLists.txt
src/RENUMBER_Swig/CTestTestfileInstall.cmake
src/RENUMBER_Swig/UsersGuideExamplesTest.py

index ed6342403ed3d174da06c8da7ab6e25e320cd98a..33ea03f6b33140f456e458adf45c84bbb4554552 100644 (file)
@@ -78,7 +78,7 @@ SET_TESTS_PROPERTIES(MEDRenumberUserGuide PROPERTIES ENVIRONMENT "${tests_env}")
 # Application tests
 
 SET(TEST_INSTALL_DIRECTORY ${MEDCOUPLING_INSTALL_TESTS}/RENUMBER_Swig)
-INSTALL(FILES MEDRenumberTest.py DESTINATION ${TEST_INSTALL_DIRECTORY})
+INSTALL(FILES MEDRenumberTest.py UsersGuideExamplesTest.py DESTINATION ${TEST_INSTALL_DIRECTORY})
 
 INSTALL(FILES CTestTestfileInstall.cmake
         DESTINATION ${TEST_INSTALL_DIRECTORY}
index b1ff7db290c50d397a1fd47f62a46c356c1ce347..1486a62cc1d178298ff892a22a5cc955b6aacaf8 100644 (file)
@@ -30,3 +30,11 @@ FOREACH(tfile ${TEST_NAMES})
     ENVIRONMENT "PYTHONPATH=../../bin:$ENV{PYTHONPATH}"
     )
 ENDFOREACH()
+
+SET(TEST_NAME ${COMPONENT_NAME}_RENUMBER_Swig_UsersGuideExamplesTest)
+ADD_TEST(${TEST_NAME} python UsersGuideExamplesTest.py)
+SET_TESTS_PROPERTIES(${TEST_NAME} PROPERTIES
+  LABELS "${COMPONENT_NAME}"
+  TIMEOUT ${TIMEOUT}
+  ENVIRONMENT "PYTHONPATH=../../bin:$ENV{PYTHONPATH}"
+  )
index 63b66c9ff045c855ed5146e0ba05ecf25417ba2a..12e1088dc046ad98c651fe110b74d81bd7537b0e 100644 (file)
@@ -31,9 +31,26 @@ if sys.platform == "win32":
     import MEDCouplingCompat as MEDCoupling
 else:
     import MEDCoupling
+    
+def build2DTargetMesh_1():
+    targetCoords=[-0.3,-0.3, 0.2,-0.3, 0.7,-0.3, -0.3,0.2, 0.2,0.2, 0.7,0.2, -0.3,0.7, 0.2,0.7, 0.7,0.7 ];
+    targetConn=[0,3,4,1, 1,4,2, 4,5,2, 6,7,4,3, 7,8,5,4];
+    targetMesh=MEDCouplingUMesh.New();
+    targetMesh.setMeshDimension(2);
+    targetMesh.allocateCells(5);
+    targetMesh.insertNextCell(NORM_QUAD4,4,targetConn[0:4]);
+    targetMesh.insertNextCell(NORM_TRI3,3,targetConn[4:7]);
+    targetMesh.insertNextCell(NORM_TRI3,3,targetConn[7:10]);
+    targetMesh.insertNextCell(NORM_QUAD4,4,targetConn[10:14]);
+    targetMesh.insertNextCell(NORM_QUAD4,4,targetConn[14:18]);
+    targetMesh.finishInsertingCells();
+    myCoords=DataArrayDouble.New();
+    myCoords.setValues(targetCoords,9,2);
+    targetMesh.setCoords(myCoords);
+    return targetMesh;
 
-from MEDCouplingDataForTest import MEDCouplingDataForTest
-m=MEDCouplingDataForTest.build2DTargetMesh_1();
+    
+m=build2DTargetMesh_1()
 #! [UG_Optimization_0]
 from MEDRenumber import RenumberingFactory
 ren=RenumberingFactory("BOOST")