From b289589f101d9efbdba697104becd48d15589962 Mon Sep 17 00:00:00 2001 From: Anthony Geay Date: Fri, 19 Jul 2019 08:14:34 +0200 Subject: [PATCH] Reactivate a forgotten test --- src/RENUMBER_Swig/CMakeLists.txt | 2 +- src/RENUMBER_Swig/CTestTestfileInstall.cmake | 8 ++++++++ src/RENUMBER_Swig/UsersGuideExamplesTest.py | 21 ++++++++++++++++++-- 3 files changed, 28 insertions(+), 3 deletions(-) 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") -- 2.39.2