mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-09-27 00:14:40 -07:00
debug ctest and readd msbuild flags (guarded)
This commit is contained in:
parent
45fd6770ec
commit
c1eb26754a
2 changed files with 41 additions and 4 deletions
|
|
@ -146,6 +146,7 @@ if [[ $MAKE_TEST ]]; then
|
||||||
fi
|
fi
|
||||||
if [[ $USE_CCACHE == "1" ]]; then
|
if [[ $USE_CCACHE == "1" ]]; then
|
||||||
flags+=("-DUSE_CCACHE=1")
|
flags+=("-DUSE_CCACHE=1")
|
||||||
|
ccache --version
|
||||||
if [[ -n $CCACHE_SIZE ]]; then
|
if [[ -n $CCACHE_SIZE ]]; then
|
||||||
# note, this setting persists after running the script
|
# note, this setting persists after running the script
|
||||||
ccache --max-size "$CCACHE_SIZE"
|
ccache --max-size "$CCACHE_SIZE"
|
||||||
|
|
@ -176,7 +177,7 @@ function ccachestatsverbose() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# Compile
|
# Prepare
|
||||||
if [[ $RUNNER_OS == macOS ]]; then
|
if [[ $RUNNER_OS == macOS ]]; then
|
||||||
# QTDIR is needed for macOS since we actually only use the cached thin Qt binaries instead of the install-qt-action,
|
# QTDIR is needed for macOS since we actually only use the cached thin Qt binaries instead of the install-qt-action,
|
||||||
# which sets a few environment variables
|
# which sets a few environment variables
|
||||||
|
|
@ -252,6 +253,13 @@ if [[ $RUNNER_OS == macOS ]]; then
|
||||||
chmod +x "$hdiutil_script"
|
chmod +x "$hdiutil_script"
|
||||||
flags+=(-DCPACK_COMMAND_HDIUTIL="$hdiutil_script")
|
flags+=(-DCPACK_COMMAND_HDIUTIL="$hdiutil_script")
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
elif [[ $RUNNER_OS == Windows ]]; then
|
||||||
|
if [[ "$CMAKE_GENERATOR" =~ ^Visual\ Studio ]]; then
|
||||||
|
# Enable MTT, see https://devblogs.microsoft.com/cppblog/improved-parallelism-in-msbuild/
|
||||||
|
# and https://devblogs.microsoft.com/cppblog/cpp-build-throughput-investigation-and-tune-up/#multitooltask-mtt
|
||||||
|
buildflags+=(-- -p:UseMultiToolTask=true -p:EnableClServerMode=true)
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $USE_CCACHE == "1" ]]; then
|
if [[ $USE_CCACHE == "1" ]]; then
|
||||||
|
|
@ -260,12 +268,14 @@ if [[ $USE_CCACHE == "1" ]]; then
|
||||||
echo "::endgroup::"
|
echo "::endgroup::"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Configure CMake
|
||||||
echo "::group::Configure cmake"
|
echo "::group::Configure cmake"
|
||||||
cmake --version
|
cmake --version
|
||||||
echo "Running cmake with flags: ${flags[*]}"
|
echo "Running cmake with flags: ${flags[*]}"
|
||||||
cmake .. "${flags[@]}"
|
cmake .. "${flags[@]}"
|
||||||
echo "::endgroup::"
|
echo "::endgroup::"
|
||||||
|
|
||||||
|
# Build
|
||||||
echo "::group::Build project"
|
echo "::group::Build project"
|
||||||
echo "Running cmake --build with flags: ${buildflags[*]}"
|
echo "Running cmake --build with flags: ${buildflags[*]}"
|
||||||
cmake --build . "${buildflags[@]}" --verbose
|
cmake --build . "${buildflags[@]}" --verbose
|
||||||
|
|
@ -298,8 +308,35 @@ if [[ $RUNNER_OS == macOS ]]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $MAKE_TEST ]]; then
|
if [[ $MAKE_TEST ]]; then
|
||||||
|
if [[ $RUNNER_OS == Windows ]]; then
|
||||||
|
echo "::group::Run dummy_test manually"
|
||||||
|
|
||||||
|
echo "dir"
|
||||||
|
pwd
|
||||||
|
ls -la
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
echo "find"
|
||||||
|
find . -name "dummy_test.exe"
|
||||||
|
find tests -maxdepth 1 -type f \( -name "*.dll" -o -name "*.exe" \)
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
echo "dependencies"
|
||||||
|
dumpbin //DEPENDENTS tests/dummy_test.exe
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
echo "dummy_test"
|
||||||
|
./tests/dummy_test.exe --gtest_list_tests
|
||||||
|
echo "Exit code: $?"
|
||||||
|
|
||||||
|
echo "::endgroup::"
|
||||||
|
fi
|
||||||
|
|
||||||
echo "::group::Run tests"
|
echo "::group::Run tests"
|
||||||
ctest -C "$BUILDTYPE" --output-on-failure
|
ctest -N -V
|
||||||
|
echo ""
|
||||||
|
ctest --version
|
||||||
|
ctest -C "$BUILDTYPE" -VV --output-on-failure
|
||||||
echo "::endgroup::"
|
echo "::endgroup::"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,10 +11,9 @@ add_test(NAME server_card_counter_test COMMAND server_card_counter_test)
|
||||||
add_test(NAME server_counter_test COMMAND server_counter_test)
|
add_test(NAME server_counter_test COMMAND server_counter_test)
|
||||||
|
|
||||||
add_test(NAME deck_hash_performance_test COMMAND deck_hash_performance_test)
|
add_test(NAME deck_hash_performance_test COMMAND deck_hash_performance_test)
|
||||||
|
set_tests_properties(dummy_test PROPERTIES TIMEOUT 5)
|
||||||
set_tests_properties(deck_hash_performance_test PROPERTIES TIMEOUT 5)
|
set_tests_properties(deck_hash_performance_test PROPERTIES TIMEOUT 5)
|
||||||
|
|
||||||
# Find GTest
|
|
||||||
|
|
||||||
add_executable(dummy_test dummy_test.cpp)
|
add_executable(dummy_test dummy_test.cpp)
|
||||||
add_executable(expression_test expression_test.cpp)
|
add_executable(expression_test expression_test.cpp)
|
||||||
add_executable(clamped_arithmetic_test clamped_arithmetic_test.cpp)
|
add_executable(clamped_arithmetic_test clamped_arithmetic_test.cpp)
|
||||||
|
|
@ -24,6 +23,7 @@ add_executable(deck_hash_performance_test deck_hash_performance_test.cpp)
|
||||||
add_executable(server_card_counter_test server_card_counter_test.cpp)
|
add_executable(server_card_counter_test server_card_counter_test.cpp)
|
||||||
add_executable(server_counter_test server_counter_test.cpp)
|
add_executable(server_counter_test server_counter_test.cpp)
|
||||||
|
|
||||||
|
# Find GTest
|
||||||
find_package(GTest)
|
find_package(GTest)
|
||||||
|
|
||||||
if(NOT GTEST_FOUND)
|
if(NOT GTEST_FOUND)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue