From a9736eaa70bac15bbf38b85fb5f47ffb1b57a9e7 Mon Sep 17 00:00:00 2001 From: Edoardo Zoni Date: Fri, 1 Nov 2024 16:45:06 -0700 Subject: [PATCH] Do not remove backtrace files in `cleanup` test --- Examples/CMakeLists.txt | 2 +- Examples/test_cleanup.cmake | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 Examples/test_cleanup.cmake diff --git a/Examples/CMakeLists.txt b/Examples/CMakeLists.txt index f36bcbb9973..728c2142932 100644 --- a/Examples/CMakeLists.txt +++ b/Examples/CMakeLists.txt @@ -198,7 +198,7 @@ function(add_warpx_test if(WarpX_TEST_CLEANUP) add_test( NAME ${name}.cleanup - COMMAND ${CMAKE_COMMAND} -E rm -rf ${THIS_WORKING_DIR} + COMMAND ${CMAKE_COMMAND} -P ${CMAKE_SOURCE_DIR}/Examples/test_cleanup.cmake ${THIS_WORKING_DIR} ) # test cleanup depends on test run set_property(TEST ${name}.cleanup APPEND PROPERTY DEPENDS "${name}.run") diff --git a/Examples/test_cleanup.cmake b/Examples/test_cleanup.cmake new file mode 100644 index 00000000000..b15e31e1f5d --- /dev/null +++ b/Examples/test_cleanup.cmake @@ -0,0 +1,7 @@ +# delete all test files except backtrace +file(GLOB test_files ${CMAKE_ARGV3}/*) +foreach(file ${test_files}) + if(NOT ${file} MATCHES "Backtrace*") + execute_process(COMMAND ${CMAKE_COMMAND} -E rm -r ${file}) + endif() +endforeach()