summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Moinvaziri <nathan@nathanm.com>2021-04-29 18:16:56 -0700
committerHans Kristian Rosbach <hk-github@circlestorm.org>2021-05-03 10:48:24 +0200
commit8e7087d32a70df4d85e8305811263ad0a4e21a22 (patch)
tree5e45950106e1f006ec4bb002c459e92ae4a4c689
parentc549c4c55b3287f91d1b21d6002f853340bbd220 (diff)
Simplify cleaning up files in test-compress cmake script and always clean up files on successful run.
-rw-r--r--cmake/test-compress.cmake15
1 files changed, 8 insertions, 7 deletions
diff --git a/cmake/test-compress.cmake b/cmake/test-compress.cmake
index 1ec1b27..89f0a7b 100644
--- a/cmake/test-compress.cmake
+++ b/cmake/test-compress.cmake
@@ -65,14 +65,14 @@ get_filename_component(OUTPUT_DIR "${OUTPUT_BASE}" DIRECTORY)
file(MAKE_DIRECTORY "${OUTPUT_DIR}")
# Cleanup temporary files
+macro(cleanup_always)
+ file(GLOB TEMP_FILES ${OUTPUT_BASE}*)
+ file(REMOVE ${TEMP_FILES})
+endmacro()
+# Clean up temporary files if not on CI
macro(cleanup)
if(NOT DEFINED ENV{CI})
- file(REMOVE
- ${OUTPUT_BASE}.gz
- ${OUTPUT_BASE}.out
- ${OUTPUT_BASE}.gzip
- ${OUTPUT_BASE}.gzip.gz
- ${OUTPUT_BASE}.gzip.out)
+ cleanup_always()
endif()
endmacro()
@@ -246,4 +246,5 @@ if(GZIP_VERIFY AND NOT "${COMPRESS_ARGS}" MATCHES "-T")
endif()
endif()
-cleanup() \ No newline at end of file
+
+cleanup_always() \ No newline at end of file