From 0a7f483c72679cbb9ddccb2e5e433bc3af71b80e Mon Sep 17 00:00:00 2001 From: pentarctagon Date: Thu, 26 Dec 2019 23:02:25 -0600 Subject: [PATCH] Add debug and release Windows jobs to travis. This also removes the separate WML_tests.cmd scripts from VC14 and VC16, now instead using the same run_wml_tests script as the linux jobs. There is currently no caching of the Windows jobs, since msbuild unfortunately uses timestamps rather than more complete information like scons/ccache in order to determine if things need to be rebuilt. Since git doesn't preserve any sort of last modified timestamp, the cloned repo into the travis job is always "newer" than the cached compiled output, and therefore wesnoth is always fully rebuilt. Ideally, assuming this sticks around and gets out of early access from travis, we could then use just travis instead of travis and appveyor. --- .travis.yml | 6 ++++ projectfiles/VC14/WML_tests.cmd | 52 ------------------------------- projectfiles/VC14/wesnoth.vcxproj | 14 +-------- projectfiles/VC16/WML_tests.cmd | 50 ----------------------------- projectfiles/VC16/wesnoth.vcxproj | 10 +----- utils/travis/steps/install.sh | 12 +++++++ utils/travis/steps/script.sh | 5 +++ 7 files changed, 25 insertions(+), 124 deletions(-) delete mode 100644 projectfiles/VC14/WML_tests.cmd delete mode 100644 projectfiles/VC16/WML_tests.cmd diff --git a/.travis.yml b/.travis.yml index de3a37044cd..eb6bc47f627 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,6 +15,12 @@ git: matrix: include: + - os: windows + env: OPT=Debug + + - os: windows + env: OPT=Release + - compiler: gcc env: CXXSTD=14 NLS=true LTS=1604 BRANCH=master diff --git a/projectfiles/VC14/WML_tests.cmd b/projectfiles/VC14/WML_tests.cmd deleted file mode 100644 index 6744b656a1c..00000000000 --- a/projectfiles/VC14/WML_tests.cmd +++ /dev/null @@ -1,52 +0,0 @@ -:: WML_tests.cmd : Run the WML unit tests specified in wml_test_schedule - -:: preamble: don't spam stdout with commands, don't expand ERRORLEVEL to 0 -@echo off -setlocal enabledelayedexpansion - -if "%SKIP_WMLTESTS%" == "TRUE" exit 0 - -:: if OMP_WAIT_POLICY isn't set, the process restarts itself and !ERRORLEVEL!=0 -set OMP_WAIT_POLICY=PASSIVE - -:: save file paths and command line arguments -cd ..\..\ -set LoadFile=wml_test_schedule -set binary=%~f1%wesnoth.exe -set opt=--log-strict=warning --noaddons - -echo running WML tests: -set tSTART=%time% - -:: ignore lines beginning with # -:: %%G contains whether the test should pass (0), timeout (2) or fail (1,4) -:: %%H is the name of the WML unit test to be executed -for /f "eol=# tokens=1,2 delims= " %%G in (%LoadFile%) do ( - WindowsTimeout.exe "%binary% %opt% -u%%H" 20000 - if !ERRORLEVEL! neq %%G ( - if !ERRORLEVEL! equ 2 ( - echo( - echo WML_tests.cmd: Warning WML2: Test '%%H' timed out, expected return value %%G - ) else ( - echo( - echo WML_tests.cmd: Error WML1: Test '%%H' returned !ERRORLEVEL!, expected %%G - ) - set /a "fail_num+=1" - ) - :: minimalistic progress bar - ../../packaging/windows/wesnoth.exe.manifest;%(AdditionalManifestFiles) - - WML unit tests for Wesnoth - WML_tests.cmd - @@ -271,10 +267,6 @@ ../../packaging/windows/wesnoth.exe.manifest;%(AdditionalManifestFiles) - - WML unit tests for Wesnoth - WML_tests.cmd $(OutDir) - @@ -317,10 +309,6 @@ ../../packaging/windows/wesnoth.exe.manifest;%(AdditionalManifestFiles) - - WML unit tests for Wesnoth - WML_tests.cmd - @@ -4134,4 +4122,4 @@ - \ No newline at end of file + diff --git a/projectfiles/VC16/WML_tests.cmd b/projectfiles/VC16/WML_tests.cmd deleted file mode 100644 index e04d46f6187..00000000000 --- a/projectfiles/VC16/WML_tests.cmd +++ /dev/null @@ -1,50 +0,0 @@ -:: WML_tests.cmd : Run the WML unit tests specified in wml_test_schedule - -:: preamble: don't spam stdout with commands, don't expand ERRORLEVEL to 0 -@echo off -setlocal enabledelayedexpansion - -:: if OMP_WAIT_POLICY isn't set, the process restarts itself and !ERRORLEVEL!=0 -set OMP_WAIT_POLICY=PASSIVE - -:: save file paths and command line arguments -cd ..\..\ -set LoadFile=wml_test_schedule -set binary=%~f1%wesnoth.exe -set opt=--log-strict=warning --noaddons - -echo running WML tests: -set tSTART=%time% - -:: ignore lines beginning with # -:: %%G contains whether the test should pass (0), timeout (2) or fail (1,4) -:: %%H is the name of the WML unit test to be executed -for /f "eol=# tokens=1,2 delims= " %%G in (%LoadFile%) do ( - WindowsTimeout.exe "%binary% %opt% -u%%H" 20000 - if !ERRORLEVEL! neq %%G ( - if !ERRORLEVEL! equ 2 ( - echo( - echo WML_tests.cmd: Warning WML2: Test '%%H' timed out, expected return value %%G - ) else ( - echo( - echo WML_tests.cmd: Error WML1: Test '%%H' returned !ERRORLEVEL!, expected %%G - ) - set /a "fail_num+=1" - ) - :: minimalistic progress bar - ../../packaging/windows/wesnoth.exe.manifest;%(AdditionalManifestFiles) - - WML unit tests for Wesnoth - WML_tests.cmd $(OutDir) - @@ -324,10 +320,6 @@ ../../packaging/windows/wesnoth.exe.manifest;%(AdditionalManifestFiles) - - WML unit tests for Wesnoth - WML_tests.cmd - @@ -4164,4 +4156,4 @@ - \ No newline at end of file + diff --git a/utils/travis/steps/install.sh b/utils/travis/steps/install.sh index 0d7e74b0dfb..ccf1f6b4438 100755 --- a/utils/travis/steps/install.sh +++ b/utils/travis/steps/install.sh @@ -26,6 +26,18 @@ if [ "$TRAVIS_OS_NAME" = "osx" ]; then HOMEBREW_NO_AUTO_UPDATE=1 brew install scons cairo pango moreutils sdl2_image sdl2_ttf sdl2_mixer glew ccache HOMEBREW_NO_AUTO_UPDATE=1 brew reinstall libffi fi +elif [ "$TRAVIS_OS_NAME" = "windows" ]; then + start=`pwd` + choco install python --version=3.6.8 + cd /c/Python36 + ln -s python.exe python3.exe + cd $start + cd .. + wget https://github.com/aquileia/external/archive/VC15.zip -O VC15.zip + 7z x VC15.zip + mv external-VC15 external + cd $start + export PATH="/c/Python36:"$PATH":/c/Program Files (x86)/Microsoft Visual Studio/2017/BuildTools/MSBuild/15.0/Bin/amd64:$start/../external/dll" else if [ "$NLS" != "true" ]; then echo "po/" >> .dockerignore diff --git a/utils/travis/steps/script.sh b/utils/travis/steps/script.sh index c7b726621ee..7946d3ae893 100755 --- a/utils/travis/steps/script.sh +++ b/utils/travis/steps/script.sh @@ -39,6 +39,11 @@ if [ "$TRAVIS_OS_NAME" = "osx" ]; then make VERBOSE=1 -j2 fi fi +elif [ "$TRAVIS_OS_NAME" = "windows" ]; then + powershell "MSBuild.exe projectfiles/VC14/wesnoth.sln -p:PlatformToolset=v141 -p:Configuration=$OPT" + if [ "$OPT" == "Release" ]; then + ./run_wml_tests -g -v -c -t "$WML_TEST_TIME" + fi else # additional permissions required due to flatpak's use of bubblewrap docker run --cap-add=ALL --privileged \