Skip to content

Commit

Permalink
Try a workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremy-rifkin committed May 19, 2024
1 parent 1e6ddeb commit af6c5df
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -118,14 +118,16 @@ if(PROJECT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
add_executable(${test_name} ${test_file})
target_link_libraries(${test_name} PRIVATE libassert-lib)
target_include_directories(${test_name} PRIVATE src)
target_compile_features(${test_name} PUBLIC cxx_std_20)
add_test(NAME ${test_name} COMMAND ${test_name})
target_compile_features(${test_name} PUBLIC cxx_std_17)
# add_test(NAME ${test_name} COMMAND ${test_name})
add_test(NAME ${test_name} COMMAND ci-wrapper.py $<TARGET_FILE:${test_name}>)
list(APPEND dsym_targets ${test_name})
endforeach()

target_link_libraries(lexer PRIVATE GTest::gtest_main)
target_link_libraries(fmt-test PRIVATE GTest::gtest_main fmt::fmt)
target_link_libraries(assertion_tests PRIVATE GTest::gtest_main)
target_compile_options(assertion_tests PRIVATE $<$<CXX_COMPILER_ID:MSVC>:/permissive- /Zc:preprocessor>)
target_compile_definitions(fmt-test PRIVATE LIBASSERT_USE_FMT)
target_compile_options(lexer PRIVATE $<$<CXX_COMPILER_ID:MSVC>:/Zc:preprocessor>)
target_compile_options(fmt-test PRIVATE $<$<CXX_COMPILER_ID:MSVC>:/Zc:preprocessor>)
Expand Down
23 changes: 23 additions & 0 deletions tests/ci-wrapper.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# -*- coding: utf-8 -*-
import os
import subprocess
import sys

env = os.environ.copy()
lp = "{}/../bin".format(os.path.dirname(os.path.realpath(__file__)))
if "LD_LIBRARY_PATH" in env:
env["LD_LIBRARY_PATH"] += ":" + lp
else:
env["LD_LIBRARY_PATH"] = lp

# Workaround for https://github.com/actions/runner-images/issues/8803
buggy_path = "C:\\Program Files\\Git\\mingw64\\bin;C:\\Program Files\\Git\\usr\\bin;C:\\Users\\runneradmin\\bin;"
if env["PATH"].startswith(buggy_path):
env["PATH"] = env["PATH"].replace(buggy_path, "", 1)

p = subprocess.Popen(
sys.argv[1:],
env=env
)
p.wait()
sys.exit(p.returncode)

0 comments on commit af6c5df

Please sign in to comment.