From: Nathan Moinvaziri Date: Fri, 30 Apr 2021 01:16:56 +0000 (-0700) Subject: Simplify cleaning up files in test-compress cmake script and always clean up files... X-Git-Tag: 2.0.3~7 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8e7087d32a70df4d85e8305811263ad0a4e21a22;p=thirdparty%2Fzlib-ng.git Simplify cleaning up files in test-compress cmake script and always clean up files on successful run. --- diff --git a/cmake/test-compress.cmake b/cmake/test-compress.cmake index 1ec1b27e..89f0a7b2 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