From: Anthony Geay Date: Fri, 19 Jul 2019 06:14:34 +0000 (+0200) Subject: Reactivate a forgotten test X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=b289589f101d9efbdba697104becd48d15589962;p=tools%2Fmedcoupling.git Reactivate a forgotten test --- diff --git a/src/RENUMBER_Swig/CMakeLists.txt b/src/RENUMBER_Swig/CMakeLists.txt index ed6342403..33ea03f6b 100644 --- a/src/RENUMBER_Swig/CMakeLists.txt +++ b/src/RENUMBER_Swig/CMakeLists.txt @@ -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} diff --git a/src/RENUMBER_Swig/CTestTestfileInstall.cmake b/src/RENUMBER_Swig/CTestTestfileInstall.cmake index b1ff7db29..1486a62cc 100644 --- a/src/RENUMBER_Swig/CTestTestfileInstall.cmake +++ b/src/RENUMBER_Swig/CTestTestfileInstall.cmake @@ -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}" + ) diff --git a/src/RENUMBER_Swig/UsersGuideExamplesTest.py b/src/RENUMBER_Swig/UsersGuideExamplesTest.py index 63b66c9ff..12e1088dc 100644 --- a/src/RENUMBER_Swig/UsersGuideExamplesTest.py +++ b/src/RENUMBER_Swig/UsersGuideExamplesTest.py @@ -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")