diff --git a/examples/ClientTests/CMakeLists.txt b/examples/ClientTests/CMakeLists.txt index d6f124cc7cbfef610e637830bbbc74739ccb1dd5..345a85610cbd7a6ab252685bc0e4e8b42d67aaef 100644 --- a/examples/ClientTests/CMakeLists.txt +++ b/examples/ClientTests/CMakeLists.txt @@ -36,7 +36,7 @@ dd4hep_add_test_reg( ClientTests_namespace_constants COMMAND "${CMAKE_INSTALL_PREFIX}/bin/run_test_ClientTests.sh" EXEC_ARGS geoPluginRun -input ${ClientTestsEx_INSTALL}/compact/NamespaceConstants.xml -destroy -plugin DD4hep_VolumeDump -plugin DD4hep_TestConstantsMultiplier - REGEX_PASS "Constant: world_z = world::Z \\[number\\] -> 10\\*world_z = 1e\\+03" + REGEX_PASS "Constant: world_z = world::Z \\[number\\] -> world_z = 100" REGEX_FAIL "Exception" REGEX_FAIL "FAILED" ) diff --git a/examples/ClientTests/src/TestConstantMultiplier.cpp b/examples/ClientTests/src/TestConstantMultiplier.cpp index b2e86f94adbaa6b4e3b79b43ada5f6ebe96728bd..f2af38dc25f3c3350d12bac0fbc757482aa96713 100644 --- a/examples/ClientTests/src/TestConstantMultiplier.cpp +++ b/examples/ClientTests/src/TestConstantMultiplier.cpp @@ -57,19 +57,23 @@ static int multiply_constants (Detector& detector, int argc, char** argv) { "\tArguments given: " << arguments(argc,argv) << endl << flush; ::exit(EINVAL); } + int num_test = 0; const auto& constants = detector.constants(); for(const auto e : constants) { Constant c = e.second; if ( c.dataType() == "number" ) { try { - double res = _multiply(c.name(),10.0); - printout(INFO,"TestConstantsMultiplier","+++ Constant: %-16s = %-16s [%s] -> 10*%-16s = %9.3g", + double res = _multiply(c.name(),1.0); + printout(INFO,"TestConstantsMultiplier","+++ Constant: %-16s = %-16s [%s] -> %-16s = %9.3g", c.name(), c->GetTitle(), c.dataType().c_str(), c.name(), res); + ++num_test; } catch(...) { } } } + printout(ALWAYS,"TestConstantsMultiplier", + "+++ Tested %d numeric constants for expression evaluation.",num_test); return 1; } diff --git a/examples/DDCMS/CMakeLists.txt b/examples/DDCMS/CMakeLists.txt index 41b33a8a51552f6e5bf0f4d1dd0f0d99eec500f6..a71cdae31d0ae7f60ea218e0526dc16da1b23842 100644 --- a/examples/DDCMS/CMakeLists.txt +++ b/examples/DDCMS/CMakeLists.txt @@ -57,6 +57,17 @@ dd4hep_add_test_reg( DDCMS_TestShapes ) # # Test CMS tracker detector construction +dd4hep_add_test_reg( DDCMS_NamespaceConstants + COMMAND "${CMAKE_INSTALL_PREFIX}/bin/run_test_DDCMS.sh" + EXEC_ARGS geoPluginRun -destroy -print WARNING + -input file:${CMAKE_CURRENT_SOURCE_DIR}/data/cms_tracker.xml + -plugin DD4hep_TestConstantsMultiplier + REGEX_PASS "Tested 2551 numeric constants for expression evaluation" + REGEX_FAIL "Exception" + REGEX_FAIL "FAILED" + ) +# +# Test CMS tracker detector construction dd4hep_add_test_reg( DDCMS_LoadGeometry COMMAND "${CMAKE_INSTALL_PREFIX}/bin/run_test_DDCMS.sh" EXEC_ARGS geoPluginRun