From b0dc48316516d236664dfc5f1eb5f2de00fc0799 Mon Sep 17 00:00:00 2001 From: "Markus F.X.J. Oberhumer" Date: Mon, 29 Apr 2024 07:53:21 +0200 Subject: [PATCH] CI updates --- misc/cmake/functions.cmake | 6 +++--- misc/cmake/self_pack_test.cmake | 15 +++++++++++++++ 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/misc/cmake/functions.cmake b/misc/cmake/functions.cmake index 486f390c..ae1aa736 100644 --- a/misc/cmake/functions.cmake +++ b/misc/cmake/functions.cmake @@ -239,7 +239,7 @@ endfunction() function(upx_internal_add_definitions_with_prefix) # ARGV; needs include(CheckCCompilerFlag) set(flag_prefix "${ARGV0}") - if(flag_prefix MATCHES "^empty$") # need "empty" to work around bug in old CMake versions + if("${flag_prefix}" MATCHES "^empty$") # need "empty" to work around bug in old CMake versions set(flag_prefix "") endif() list(REMOVE_AT ARGV 0) @@ -320,7 +320,7 @@ function(upx_compile_source_debug_with_O2) # ARGV # MSVC uses some Debug compilation options like -RTC1 that are incompatible with -O2 else() get_source_file_property(prop "${source}" COMPILE_FLAGS) - if(prop MATCHES "^(NOTFOUND)?$") + if("${prop}" MATCHES "^(NOTFOUND)?$") set_source_files_properties("${source}" PROPERTIES COMPILE_FLAGS "${flags}") else() set_source_files_properties("${source}" PROPERTIES COMPILE_FLAGS "${prop} ${flags}") @@ -372,7 +372,7 @@ function(upx_test_depends) # ARGV set(name "${ARGV0}") list(REMOVE_AT ARGV 0) get_property(prop TEST "${name}" PROPERTY DEPENDS) - if(prop MATCHES "^(NOTFOUND)?$") + if("${prop}" MATCHES "^(NOTFOUND)?$") set_tests_properties("${name}" PROPERTIES DEPENDS "${ARGV}") else() set_tests_properties("${name}" PROPERTIES DEPENDS "${prop};${ARGV}") diff --git a/misc/cmake/self_pack_test.cmake b/misc/cmake/self_pack_test.cmake index fe619fd4..8c3e03f2 100644 --- a/misc/cmake/self_pack_test.cmake +++ b/misc/cmake/self_pack_test.cmake @@ -72,6 +72,16 @@ upx_test_depends(upx-compare-nrv2b "upx-unpack;upx-unpack-nrv2b") upx_test_depends(upx-compare-nrv2d "upx-unpack;upx-unpack-nrv2d") upx_test_depends(upx-compare-nrv2e "upx-unpack;upx-unpack-nrv2e") upx_test_depends(upx-compare-lzma "upx-unpack;upx-unpack-lzma") +# tests with higher COST values will run first +set_tests_properties(upx-self-pack PROPERTIES COST 90) +set_tests_properties(upx-self-pack-fa PROPERTIES COST 20) +set_tests_properties(upx-self-pack-fn PROPERTIES COST 20) +set_tests_properties(upx-self-pack-fr PROPERTIES COST 20) +set_tests_properties(upx-self-pack-nrv2b PROPERTIES COST 20) +set_tests_properties(upx-self-pack-nrv2d PROPERTIES COST 20) +set_tests_properties(upx-self-pack-nrv2e PROPERTIES COST 20) +set_tests_properties(upx-self-pack-lzma PROPERTIES COST 30) +set_tests_properties(upx-unpack PROPERTIES COST 10) if(NOT UPX_CONFIG_DISABLE_RUN_UNPACKED_TEST) upx_add_test(upx-run-unpacked ${emu} ./upx-unpacked${exe} --version-short) @@ -116,6 +126,11 @@ if(NOT UPX_CONFIG_DISABLE_EXHAUSTIVE_TESTS) upx_test_depends(upx-test-${s} upx-self-pack-${s}) upx_test_depends(upx-unpack-${s} upx-self-pack-${s}) upx_test_depends(upx-compare-${s} "upx-unpack;upx-unpack-${s}") + if(method MATCHES "lzma") + set_tests_properties(upx-self-pack-${s} PROPERTIES COST "3${level}") + else() + set_tests_properties(upx-self-pack-${s} PROPERTIES COST "2${level}") + endif() if(NOT UPX_CONFIG_DISABLE_RUN_PACKED_TEST) upx_add_test(upx-run-packed-${s} ${emu} ./upx-packed-${s}${exe} --version-short) upx_test_depends(upx-run-packed-${s} upx-self-pack-${s})