From dcd9c77e31fd7a76f21bb82244ade0436f03721b Mon Sep 17 00:00:00 2001 From: Florian Loitsch Date: Thu, 10 Oct 2024 15:44:26 +0200 Subject: [PATCH] Disable some tests. --- .github/workflows/ci.yml | 6 ++---- tests/optimizations/CMakeLists.txt | 9 +++++++++ tests/type_propagation/CMakeLists.txt | 6 ++++-- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 516ca30f6..7bc976cf5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -266,8 +266,7 @@ jobs: - name: Test 64-bit debug shell: bash - # TODO(florian): fix this for Windows. - if: env.DO_MORE_TESTS == 'true' && runner.os != 'Windows' + if: env.DO_MORE_TESTS == 'true' run: | make BUILD=build-debug BUILD_TYPE=Debug test @@ -279,8 +278,7 @@ jobs: - name: Test -O2 with asserts shell: bash - # TODO(florian): fix this for Windows. - if: env.DO_MORE_TESTS == 'true' && runner.os != 'Windows' + if: env.DO_MORE_TESTS == 'true' run: | TOIT_OPTIMIZATION_OVERRIDE=2 TOIT_ASSERT_OVERRIDE=1 make HOST=host-O2 TOOLCHAIN=host test diff --git a/tests/optimizations/CMakeLists.txt b/tests/optimizations/CMakeLists.txt index 5640be1fc..b9daa39b5 100644 --- a/tests/optimizations/CMakeLists.txt +++ b/tests/optimizations/CMakeLists.txt @@ -17,7 +17,16 @@ file(GLOB TOIT_OPTIMIZATION_TESTS RELATIVE ${TOIT_SDK_SOURCE_DIR} "*-test.toit") include(fail.cmake) +set(OPTIMIZATIONS_IS_OVERRIDEN) +if (DEFINED ENV{TOIT_OPTIMIZATION_OVERRIDE}) + set(OPTIMIZATIONS_IS_OVERRIDEN TRUE) +endif() + foreach(file ${TOIT_OPTIMIZATION_TESTS}) + if(OPTIMIZATIONS_IS_OVERRIDEN) + # Don't run optimization tests if the optimization level is overriden. + continue() + endif() if("${file}" IN_LIST TOIT_SKIP_TESTS) continue() endif() diff --git a/tests/type_propagation/CMakeLists.txt b/tests/type_propagation/CMakeLists.txt index 146bbce0b..0d43cc4e2 100644 --- a/tests/type_propagation/CMakeLists.txt +++ b/tests/type_propagation/CMakeLists.txt @@ -87,5 +87,7 @@ function(add_tests flags) endforeach() endfunction() -add_tests("") -add_tests("-O2") +if (NOT DEFINED ENV{TOIT_OPTIMIZATION_OVERRIDE} AND NOT DEFINED ENV{TOIT_ASSERT_OVERRIDE}) + add_tests("") + add_tests("-O2") +endif()