diff options
| author | peter <peter@pmikkelsen.com> | 2026-09-04 19:45:05 +0000 |
|---|---|---|
| committer | peter <peter@pmikkelsen.com> | 2026-09-04 19:45:05 +0000 |
| commit | 4d1f519e1bcca659100a2593bd7ca7f2f4983ffe (patch) | |
| tree | df2b96f6bb871c8a52c8eda2ac2e2d87387d91bc /CMakeLists.txt | |
| parent | cde3778df1f5086052d01bf770910b2e05d0a1e1 (diff) | |
Add a test which runs all the scripts in tests/scripts/good to meaure how many memory allocations they perform, and then rerun them with a mode that causes the memory allocator to fail after N allocations. The scripts are run for all values of N from 0 to the number of allocations they need to succeed.
FossilOrigin-Name: ed1953c203d3493d9c1adbcb9256d7d380bc1fdcfc7856f03f9d801291f478cd
Diffstat (limited to 'CMakeLists.txt')
| -rw-r--r-- | CMakeLists.txt | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index efa3cc1..9631df4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -26,6 +26,7 @@ target_compile_options(common INTERFACE $<$<CONFIG:Coverage>: -O0 + -g --coverage -fcondition-coverage -DAPLWC_BUILD_TYPE_COVERAGE @@ -111,6 +112,11 @@ foreach(script ${TEST_SCRIPTS_GOOD}) set_tests_properties("aplwc-repl ${script}" PROPERTIES ENVIRONMENT "PATH=$<TARGET_FILE_DIR:aplwc-repl>" ) + + add_test(NAME "memfail ${script}" COMMAND "${CMAKE_CURRENT_SOURCE_DIR}/tests/scripts/memfail.sh" "${script}") + set_tests_properties("memfail ${script}" PROPERTIES + ENVIRONMENT "PATH=$<TARGET_FILE_DIR:aplwc-repl>" + ) endforeach() file(GLOB TEST_SCRIPTS_BAD CONFIGURE_DEPENDS "tests/scripts/bad/*.aplwc") @@ -128,6 +134,10 @@ foreach(script ${TEST_SCRIPTS_GOOD}) set_tests_properties("${script}" PROPERTIES ENVIRONMENT "PATH=$<TARGET_FILE_DIR:aplwc-repl>" ) + add_test(NAME "memfail ${script}" COMMAND "${CMAKE_CURRENT_SOURCE_DIR}/tests/scripts/memfail.sh" "${script}") + set_tests_properties("memfail ${script}" PROPERTIES + ENVIRONMENT "PATH=$<TARGET_FILE_DIR:aplwc-repl>" + ) endforeach() file(GLOB TEST_SCRIPTS_BAD CONFIGURE_DEPENDS "tests/scripts/bad/*.sh") |