Skip to content

Commit

Permalink
Tests: added cepgen path to test executables
Browse files Browse the repository at this point in the history
  • Loading branch information
forthommel committed Jul 17, 2023
1 parent 08f17c7 commit 8d3c4e3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions CepGenAddOns/PythonWrapper/test/python_particle_mod.cc
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ int main(int argc, char* argv[]) {
card->parseString(R"(
from Config.PDG_cfi import PDG, registerParticle
registerParticle(name='teston', pdgid=42, mass=42.42, width=1.1))",
new cepgen::Parameters);
nullptr);

CG_DEBUG("main") << "Configuration string successfully parsed.";

Expand All @@ -44,4 +44,4 @@ registerParticle(name='teston', pdgid=42, mass=42.42, width=1.1))",
CG_TEST_EQUAL(teston.width, 1.1, "new particle width");

CG_TEST_SUMMARY;
}
}
3 changes: 2 additions & 1 deletion cmake/BuildUtils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@ macro(cepgen_build mod_name)
foreach(_t ${tt})
get_filename_component(bin ${_t} NAME_WE)
add_executable(${bin} "${_t}")
add_test(NAME ${bin} COMMAND ${bin})
target_link_libraries(${bin} CepGen ${mod_name})
add_test(NAME ${bin} COMMAND ${bin})
set_property(TEST ${bin} PROPERTY ENVIRONMENT "CEPGEN_PATH=${PROJECT_BINARY_DIR}")
list(APPEND tests ${bin})
endforeach()
message(STATUS "... test(s): ${tests}")
Expand Down

0 comments on commit 8d3c4e3

Please sign in to comment.