Commit 3f902ca6 authored by Alexander David Hellwig's avatar Alexander David Hellwig
Browse files

Add custom target that executes generated test to generated cmake

parent 91d8a294
Pipeline #107432 failed with stages
in 11 minutes and 55 seconds
......@@ -30,7 +30,7 @@
<groupId>de.monticore.lang.monticar</groupId>
<artifactId>embedded-montiarc-math-generator</artifactId>
<version>0.1.6-SNAPSHOT</version>
<version>0.1.7-SNAPSHOT</version>
<!-- == PROJECT DEPENDENCIES ============================================= -->
......
......@@ -139,6 +139,12 @@ public final class TestsGeneratorCPP {
cmake.addCMakeCommandEnd("target_link_libraries(" + compName + execuatablePostFix + " PUBLIC " + compName + ")");
}
cmake.addCMakeCommandEnd("set_target_properties(" + compName + execuatablePostFix + " PROPERTIES LINKER_LANGUAGE CXX)");
String executeTestTplt = "\n# execute tests\n" +
"add_custom_target(run_<name>_StreamTests ALL\n" +
" COMMAND <name>_StreamTests\n" +
" WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})";
cmake.addCMakeCommandEnd(executeTestTplt.replace("<name>",compName));
}
private String getExistingComponentNames() {
......
......@@ -29,3 +29,8 @@ add_executable(test_basicPortsMath_StreamTests test/tests_main.cpp)
target_compile_definitions(test_basicPortsMath_StreamTests PRIVATE CATCH_CONFIG_MAIN=1 ARMA_DONT_USE_WRAPPER)
target_link_libraries(test_basicPortsMath_StreamTests PUBLIC test_basicPortsMath)
set_target_properties(test_basicPortsMath_StreamTests PROPERTIES LINKER_LANGUAGE CXX)
# execute tests
add_custom_target(run_test_basicPortsMath_StreamTests ALL
COMMAND test_basicPortsMath_StreamTests
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment