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.
This commit is contained in:
pentarctagon 2019-12-26 23:02:25 -06:00 committed by Pentarctagon
parent 21d133828b
commit 0a7f483c72
7 changed files with 25 additions and 124 deletions

View file

@ -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

View file

@ -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
<nul (set/p progress=.)
set /a "test_num+=1"
)
echo(
if not DEFINED fail_num ( set "fail_num=none" )
set /a "minutes = 1%time:~3,2% - 1%tSTART:~3,2%"
set /a "seconds = 1%time:~6,2% - 1%tSTART:~6,2%"
if %seconds% LSS 0 (
set /a "seconds+=60"
set /a "minutes-=1"
)
echo %test_num% WML tests completed in %minutes%m %seconds%s, %fail_num% of them failed
:: restore the state before execution
cd %~p0
echo on

View file

@ -189,10 +189,6 @@
<Manifest>
<AdditionalManifestFiles>../../packaging/windows/wesnoth.exe.manifest;%(AdditionalManifestFiles)</AdditionalManifestFiles>
</Manifest>
<PostBuildEvent>
<Message>WML unit tests for Wesnoth</Message>
<Command>WML_tests.cmd</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Test_Debug|Win32'">
<BuildLog>
@ -271,10 +267,6 @@
<Manifest>
<AdditionalManifestFiles>../../packaging/windows/wesnoth.exe.manifest;%(AdditionalManifestFiles)</AdditionalManifestFiles>
</Manifest>
<PostBuildEvent>
<Message>WML unit tests for Wesnoth</Message>
<Command>WML_tests.cmd $(OutDir)</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDEBUG|Win32'">
<BuildLog>
@ -317,10 +309,6 @@
<Manifest>
<AdditionalManifestFiles>../../packaging/windows/wesnoth.exe.manifest;%(AdditionalManifestFiles)</AdditionalManifestFiles>
</Manifest>
<PostBuildEvent>
<Message>WML unit tests for Wesnoth</Message>
<Command>WML_tests.cmd</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
<ResourceCompile Include="..\..\packaging\windows\wesnoth.rc" />
@ -4134,4 +4122,4 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
</Project>

View file

@ -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
<nul (set/p progress=.)
set /a "test_num+=1"
)
echo(
if not DEFINED fail_num ( set "fail_num=none" )
set /a "minutes = 1%time:~3,2% - 1%tSTART:~3,2%"
set /a "seconds = 1%time:~6,2% - 1%tSTART:~6,2%"
if %seconds% LSS 0 (
set /a "seconds+=60"
set /a "minutes-=1"
)
echo %test_num% WML tests completed in %minutes%m %seconds%s, %fail_num% of them failed
:: restore the state before execution
cd %~p0
echo on

View file

@ -277,10 +277,6 @@
<Manifest>
<AdditionalManifestFiles>../../packaging/windows/wesnoth.exe.manifest;%(AdditionalManifestFiles)</AdditionalManifestFiles>
</Manifest>
<PostBuildEvent>
<Message>WML unit tests for Wesnoth</Message>
<Command>WML_tests.cmd $(OutDir)</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDEBUG|x64'">
<BuildLog>
@ -324,10 +320,6 @@
<Manifest>
<AdditionalManifestFiles>../../packaging/windows/wesnoth.exe.manifest;%(AdditionalManifestFiles)</AdditionalManifestFiles>
</Manifest>
<PostBuildEvent>
<Message>WML unit tests for Wesnoth</Message>
<Command>WML_tests.cmd</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
<ResourceCompile Include="..\..\packaging\windows\wesnoth.rc" />
@ -4164,4 +4156,4 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
</Project>

View file

@ -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

View file

@ -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 \