From https://github.com/corrosion-rs/corrosion/pull/605 From: Jonathan Schwender Date: Sun, 12 Jan 2025 10:44:14 +0100 Subject: [PATCH 1/2] Disable rustup_proxy test if rustup is not installed The test only makes sense if rustc / cargo are behind a rustup proxy. If rustup is not installed, we can just disable the test. --- a/test/find_rust/CMakeLists.txt +++ b/test/find_rust/CMakeLists.txt @@ -1,3 +1,7 @@ corrosion_tests_add_test(find_rust "") corrosion_tests_add_test(rustup_proxy "") +find_program(rustup rustup) +if(NOT rustup) + set_tests_properties(rustup_proxy_build rustup_proxy_cleanup PROPERTIES DISABLED 1) +endif() From 1127f5bc08491a1dccbb979f92f78a9a7264bba9 Mon Sep 17 00:00:00 2001 From: Jonathan Schwender Date: Sun, 12 Jan 2025 11:05:52 +0100 Subject: [PATCH 2/2] tests: Improve parse_target_triple warning regex. Improve the regex, to ensure it only matches against our specific warning. This should hopefully make it more robust, since new CMake versions can always introduce new warnings for our existing code. --- a/test/parse_target_triple/CMakeLists.txt +++ b/test/parse_target_triple/CMakeLists.txt @@ -2,9 +2,9 @@ corrosion_tests_add_test(parse_target_triple "") corrosion_tests_add_test(parse_target_triple_should_fail "") set_tests_properties("parse_target_triple_build" PROPERTIES FAIL_REGULAR_EXPRESSION - "CMake Warning" + "CMake Warning at [^\r\n]*FindRust\.cmake:.*(\r)?\n[ \t]*Failed to parse target-triple `" ) set_tests_properties("parse_target_triple_should_fail_build" PROPERTIES PASS_REGULAR_EXPRESSION - "CMake Warning" - ) \ No newline at end of file + "CMake Warning at [^\r\n]*FindRust\.cmake:.*(\r)?\n[ \t]*Failed to parse target-triple `" + )