mirror of
https://github.com/rehlds/rehlds.git
synced 2024-12-27 23:25:45 +03:00
workflows/build.yml: add testing HLDS demo
This commit is contained in:
parent
e9a39d73f2
commit
7cfea77b93
129
.github/workflows/build.yml
vendored
129
.github/workflows/build.yml
vendored
@ -15,10 +15,13 @@ jobs:
|
||||
windows:
|
||||
name: 'Windows'
|
||||
runs-on: windows-latest
|
||||
|
||||
env:
|
||||
solution: 'msvc/ReHLDS.sln'
|
||||
buildPlatform: 'Win32'
|
||||
buildConfiguration: 'Release'
|
||||
buildRelease: 'Release'
|
||||
buildReleasePlay: 'Release Play'
|
||||
buildTest: 'Test Fixes'
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
@ -39,29 +42,41 @@ jobs:
|
||||
vs-version: '16.8'
|
||||
|
||||
- name: Build ReHLDS
|
||||
run:
|
||||
msbuild ${{ env.solution }} /t:Clean,Build -p:Configuration="${{ env.buildConfiguration }}" /p:Platform=${{ env.buildPlatform }} /p:PlatformToolset=v140_xp /p:XPDeprecationWarning=false
|
||||
run: |
|
||||
msbuild ${{ env.solution }} -p:Configuration="${{ env.buildRelease }}" /t:Clean,Build /p:Platform=${{ env.buildPlatform }} /p:PlatformToolset=v140_xp /p:XPDeprecationWarning=false
|
||||
msbuild ${{ env.solution }} -p:Configuration="${{ env.buildReleasePlay }}" /t:Clean,Build /p:Platform=${{ env.buildPlatform }} /p:PlatformToolset=v140_xp /p:XPDeprecationWarning=false
|
||||
|
||||
- name: Build and Testing
|
||||
run: |
|
||||
msbuild ${{ env.solution }} -p:Configuration="${{ env.buildTest }}" /t:Clean,Build /p:Platform=${{ env.buildPlatform }} /p:PlatformToolset=v140_xp /p:XPDeprecationWarning=false
|
||||
.\"msvc\Test Fixes\swds.exe"
|
||||
If ($LASTEXITCODE -ne 0 -And
|
||||
$LASTEXITCODE -ne 3)
|
||||
{[Environment]::Exit(1)}
|
||||
shell: "pwsh"
|
||||
|
||||
- name: Move files
|
||||
run: |
|
||||
mkdir publish\debug
|
||||
mkdir publish\tests
|
||||
mkdir publish\bin\win32\valve\dlls
|
||||
move msvc\${{ env.buildConfiguration }}\hlds.exe publish\bin\win32\hlds.exe
|
||||
move msvc\${{ env.buildConfiguration }}\hltv.exe publish\bin\win32\hltv.exe
|
||||
move msvc\${{ env.buildConfiguration }}\swds.dll publish\bin\win32\swds.dll
|
||||
move msvc\${{ env.buildConfiguration }}\core.dll publish\bin\win32\core.dll
|
||||
move msvc\${{ env.buildConfiguration }}\proxy.dll publish\bin\win32\proxy.dll
|
||||
move msvc\${{ env.buildConfiguration }}\demoplayer.dll publish\bin\win32\demoplayer.dll
|
||||
move msvc\${{ env.buildConfiguration }}\filesystem_stdio.dll publish\bin\win32\filesystem_stdio.dll
|
||||
move msvc\${{ env.buildConfiguration }}\director.dll publish\bin\win32\valve\dlls\director.dll
|
||||
move msvc\${{ env.buildConfiguration }}\hlds.pdb publish\debug\hlds.pdb
|
||||
move msvc\${{ env.buildConfiguration }}\hltv.pdb publish\debug\hltv.pdb
|
||||
move msvc\${{ env.buildConfiguration }}\swds.pdb publish\debug\swds.pdb
|
||||
move msvc\${{ env.buildConfiguration }}\core.pdb publish\debug\core.pdb
|
||||
move msvc\${{ env.buildConfiguration }}\proxy.pdb publish\debug\proxy.pdb
|
||||
move msvc\${{ env.buildConfiguration }}\demoplayer.pdb publish\debug\demoplayer.pdb
|
||||
move msvc\${{ env.buildConfiguration }}\filesystem_stdio.pdb publish\debug\filesystem_stdio.pdb
|
||||
move msvc\${{ env.buildConfiguration }}\director.pdb publish\debug\director.pdb
|
||||
move "msvc\${{ env.buildReleasePlay }}\swds.dll" publish\tests\swds.dll
|
||||
move msvc\${{ env.buildRelease }}\hlds.exe publish\bin\win32\hlds.exe
|
||||
move msvc\${{ env.buildRelease }}\hltv.exe publish\bin\win32\hltv.exe
|
||||
move msvc\${{ env.buildRelease }}\swds.dll publish\bin\win32\swds.dll
|
||||
move msvc\${{ env.buildRelease }}\core.dll publish\bin\win32\core.dll
|
||||
move msvc\${{ env.buildRelease }}\proxy.dll publish\bin\win32\proxy.dll
|
||||
move msvc\${{ env.buildRelease }}\demoplayer.dll publish\bin\win32\demoplayer.dll
|
||||
move msvc\${{ env.buildRelease }}\filesystem_stdio.dll publish\bin\win32\filesystem_stdio.dll
|
||||
move msvc\${{ env.buildRelease }}\director.dll publish\bin\win32\valve\dlls\director.dll
|
||||
move msvc\${{ env.buildRelease }}\hlds.pdb publish\debug\hlds.pdb
|
||||
move msvc\${{ env.buildRelease }}\hltv.pdb publish\debug\hltv.pdb
|
||||
move msvc\${{ env.buildRelease }}\swds.pdb publish\debug\swds.pdb
|
||||
move msvc\${{ env.buildRelease }}\core.pdb publish\debug\core.pdb
|
||||
move msvc\${{ env.buildRelease }}\proxy.pdb publish\debug\proxy.pdb
|
||||
move msvc\${{ env.buildRelease }}\demoplayer.pdb publish\debug\demoplayer.pdb
|
||||
move msvc\${{ env.buildRelease }}\filesystem_stdio.pdb publish\debug\filesystem_stdio.pdb
|
||||
move msvc\${{ env.buildRelease }}\director.pdb publish\debug\director.pdb
|
||||
|
||||
- name: Deploy artifacts
|
||||
uses: actions/upload-artifact@v2
|
||||
@ -69,6 +84,79 @@ jobs:
|
||||
name: win32
|
||||
path: publish/*
|
||||
|
||||
testdemos:
|
||||
name: 'Test demos'
|
||||
runs-on: ubuntu-latest
|
||||
container: s1lentq/testdemos:latest
|
||||
needs: [windows]
|
||||
|
||||
env:
|
||||
WINEDEBUG: -all
|
||||
WINEDLLOVERRIDES: mshtml=
|
||||
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
working-directory: ../../../opt/HLDS
|
||||
|
||||
steps:
|
||||
- name: Deploying windows artifacts
|
||||
uses: actions/download-artifact@v2
|
||||
with:
|
||||
name: win32
|
||||
|
||||
- name: Play demos
|
||||
run: |
|
||||
chown root ~
|
||||
cp -r deps/rehlds/* .
|
||||
mv $GITHUB_WORKSPACE/tests/swds.dll .
|
||||
|
||||
descs=(
|
||||
"Half-Life: Physics singleplayer"
|
||||
"Half-Life: Multiplayer on crossfire map"
|
||||
"Half-Life: Shooting with several weapons"
|
||||
"CS: Multiplayer"
|
||||
)
|
||||
|
||||
demos=(
|
||||
"rehlds-phys-single1"
|
||||
"crossfire-1-multiplayer-1"
|
||||
"shooting-hl-1"
|
||||
"cstrike-muliplayer-1"
|
||||
)
|
||||
|
||||
retVal=0
|
||||
for i in "${!demos[@]}"; do
|
||||
params=$(cat "testdemos/${demos[i]}.params")
|
||||
|
||||
echo -e "\e[1m[$((i + 1))/${#demos[@]}] \e[1;36m${descs[i]} testing...\e[0m"
|
||||
echo -e " - \e[0;33mParameters $params\e[0m"
|
||||
|
||||
wine hlds.exe --rehlds-enable-all-hooks --rehlds-test-play "testdemos/${demos[i]}.bin" $params &> result.log || retVal=$?
|
||||
|
||||
if [ $retVal -ne 777 ] && [ $retVal -ne 9 ]; then
|
||||
# Print with catchy messages
|
||||
while read line; do
|
||||
echo -e " \e[0;33m$line"
|
||||
done <<< $(cat result.log | sed '0,/demo failed/I!d;/wine:/d;/./,$!d')
|
||||
|
||||
echo " 🔸 🔸 🔸 🔸 🔸 🔸 🔸 🔸 🔸 🔸"
|
||||
while read line; do
|
||||
echo -e " \e[1;31m$line";
|
||||
done < rehlds_demo_error.txt
|
||||
echo -e " \e[30;41mExit code: $retVal\e[0m"
|
||||
echo -e "\e[1m[$((i + 1))/${#demos[@]}] \e[1;36m${descs[i]} testing...\e[1;31m Failed ❌"
|
||||
exit 6 # Test demo failed
|
||||
else
|
||||
# Print result HLDS console
|
||||
while read line; do
|
||||
echo -e " \e[0;33m$line"
|
||||
done <<< $(cat result.log | sed '/wine:/d;/./,$!d')
|
||||
echo -e " \e[30;43mExit code: $retVal\e[0m"
|
||||
echo -e "\e[1m[$((i + 1))/${#demos[@]}] \e[1;36m${descs[i]} testing...\e[1;32m Succeed ✔"
|
||||
fi
|
||||
done
|
||||
|
||||
linux:
|
||||
name: 'Linux'
|
||||
runs-on: ubuntu-latest
|
||||
@ -138,9 +226,10 @@ jobs:
|
||||
rm -f appversion.h
|
||||
|
||||
publish:
|
||||
needs: [windows, linux]
|
||||
name: 'Publish'
|
||||
runs-on: ubuntu-latest
|
||||
needs: [windows, testdemos, linux]
|
||||
|
||||
steps:
|
||||
- name: Deploying linux artifacts
|
||||
uses: actions/download-artifact@v2
|
||||
|
@ -13,14 +13,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cppunitlite", "..\dep\cppun
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "bzip2", "..\dep\bzip2\msvc\bzip2.vcxproj", "{792DF067-9904-4579-99B9-46C17277ADE3}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "gradle", "gradle", "{FFC337A9-D58C-4D62-B8BB-A54DD4E4DF41}"
|
||||
ProjectSection(SolutionItems) = preProject
|
||||
..\build.gradle = ..\build.gradle
|
||||
..\gradle.properties = ..\gradle.properties
|
||||
..\settings.gradle = ..\settings.gradle
|
||||
..\shared.gradle = ..\shared.gradle
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dedicated", "..\rehlds\dedicated\msvc\dedicated.vcxproj", "{D49883F3-5C5C-4B9F-B9C7-B31518F228D4}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{D2516ABB-21F2-4393-8CC9-2BD2D3316CD6}"
|
||||
@ -70,10 +62,10 @@ Global
|
||||
{CEB94F7C-E459-4673-AABB-36E2074396C0}.Release Play|Win32.Build.0 = Release|Win32
|
||||
{CEB94F7C-E459-4673-AABB-36E2074396C0}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{CEB94F7C-E459-4673-AABB-36E2074396C0}.Release|Win32.Build.0 = Release|Win32
|
||||
{CEB94F7C-E459-4673-AABB-36E2074396C0}.Test Fixes|Win32.ActiveCfg = Release|Win32
|
||||
{CEB94F7C-E459-4673-AABB-36E2074396C0}.Test Fixes|Win32.Build.0 = Release|Win32
|
||||
{CEB94F7C-E459-4673-AABB-36E2074396C0}.Tests|Win32.ActiveCfg = Release|Win32
|
||||
{CEB94F7C-E459-4673-AABB-36E2074396C0}.Tests|Win32.Build.0 = Release|Win32
|
||||
{CEB94F7C-E459-4673-AABB-36E2074396C0}.Test Fixes|Win32.ActiveCfg = Debug|Win32
|
||||
{CEB94F7C-E459-4673-AABB-36E2074396C0}.Test Fixes|Win32.Build.0 = Debug|Win32
|
||||
{CEB94F7C-E459-4673-AABB-36E2074396C0}.Tests|Win32.ActiveCfg = Debug|Win32
|
||||
{CEB94F7C-E459-4673-AABB-36E2074396C0}.Tests|Win32.Build.0 = Debug|Win32
|
||||
{792DF067-9904-4579-99B9-46C17277ADE3}.Debug Play|Win32.ActiveCfg = Debug|Win32
|
||||
{792DF067-9904-4579-99B9-46C17277ADE3}.Debug Play|Win32.Build.0 = Debug|Win32
|
||||
{792DF067-9904-4579-99B9-46C17277ADE3}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
@ -82,94 +74,66 @@ Global
|
||||
{792DF067-9904-4579-99B9-46C17277ADE3}.Release Play|Win32.Build.0 = Release|Win32
|
||||
{792DF067-9904-4579-99B9-46C17277ADE3}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{792DF067-9904-4579-99B9-46C17277ADE3}.Release|Win32.Build.0 = Release|Win32
|
||||
{792DF067-9904-4579-99B9-46C17277ADE3}.Test Fixes|Win32.ActiveCfg = Release|Win32
|
||||
{792DF067-9904-4579-99B9-46C17277ADE3}.Test Fixes|Win32.Build.0 = Release|Win32
|
||||
{792DF067-9904-4579-99B9-46C17277ADE3}.Tests|Win32.ActiveCfg = Release|Win32
|
||||
{792DF067-9904-4579-99B9-46C17277ADE3}.Tests|Win32.Build.0 = Release|Win32
|
||||
{792DF067-9904-4579-99B9-46C17277ADE3}.Test Fixes|Win32.ActiveCfg = Debug|Win32
|
||||
{792DF067-9904-4579-99B9-46C17277ADE3}.Test Fixes|Win32.Build.0 = Debug|Win32
|
||||
{792DF067-9904-4579-99B9-46C17277ADE3}.Tests|Win32.ActiveCfg = Debug|Win32
|
||||
{792DF067-9904-4579-99B9-46C17277ADE3}.Tests|Win32.Build.0 = Debug|Win32
|
||||
{D49883F3-5C5C-4B9F-B9C7-B31518F228D4}.Debug Play|Win32.ActiveCfg = Debug|Win32
|
||||
{D49883F3-5C5C-4B9F-B9C7-B31518F228D4}.Debug Play|Win32.Build.0 = Debug|Win32
|
||||
{D49883F3-5C5C-4B9F-B9C7-B31518F228D4}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{D49883F3-5C5C-4B9F-B9C7-B31518F228D4}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{D49883F3-5C5C-4B9F-B9C7-B31518F228D4}.Release Play|Win32.ActiveCfg = Release|Win32
|
||||
{D49883F3-5C5C-4B9F-B9C7-B31518F228D4}.Release Play|Win32.Build.0 = Release|Win32
|
||||
{D49883F3-5C5C-4B9F-B9C7-B31518F228D4}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{D49883F3-5C5C-4B9F-B9C7-B31518F228D4}.Release|Win32.Build.0 = Release|Win32
|
||||
{D49883F3-5C5C-4B9F-B9C7-B31518F228D4}.Test Fixes|Win32.ActiveCfg = Release|Win32
|
||||
{D49883F3-5C5C-4B9F-B9C7-B31518F228D4}.Test Fixes|Win32.Build.0 = Release|Win32
|
||||
{D49883F3-5C5C-4B9F-B9C7-B31518F228D4}.Tests|Win32.ActiveCfg = Release|Win32
|
||||
{D49883F3-5C5C-4B9F-B9C7-B31518F228D4}.Tests|Win32.Build.0 = Release|Win32
|
||||
{D49883F3-5C5C-4B9F-B9C7-B31518F228D4}.Test Fixes|Win32.ActiveCfg = Debug|Win32
|
||||
{D49883F3-5C5C-4B9F-B9C7-B31518F228D4}.Tests|Win32.ActiveCfg = Debug|Win32
|
||||
{D5CAB879-D54F-456F-8592-31D549CFD1D8}.Debug Play|Win32.ActiveCfg = Debug|Win32
|
||||
{D5CAB879-D54F-456F-8592-31D549CFD1D8}.Debug Play|Win32.Build.0 = Debug|Win32
|
||||
{D5CAB879-D54F-456F-8592-31D549CFD1D8}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{D5CAB879-D54F-456F-8592-31D549CFD1D8}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{D5CAB879-D54F-456F-8592-31D549CFD1D8}.Release Play|Win32.ActiveCfg = Release|Win32
|
||||
{D5CAB879-D54F-456F-8592-31D549CFD1D8}.Release Play|Win32.Build.0 = Release|Win32
|
||||
{D5CAB879-D54F-456F-8592-31D549CFD1D8}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{D5CAB879-D54F-456F-8592-31D549CFD1D8}.Release|Win32.Build.0 = Release|Win32
|
||||
{D5CAB879-D54F-456F-8592-31D549CFD1D8}.Test Fixes|Win32.ActiveCfg = Release|Win32
|
||||
{D5CAB879-D54F-456F-8592-31D549CFD1D8}.Test Fixes|Win32.Build.0 = Release|Win32
|
||||
{D5CAB879-D54F-456F-8592-31D549CFD1D8}.Tests|Win32.ActiveCfg = Release|Win32
|
||||
{D5CAB879-D54F-456F-8592-31D549CFD1D8}.Tests|Win32.Build.0 = Release|Win32
|
||||
{D5CAB879-D54F-456F-8592-31D549CFD1D8}.Test Fixes|Win32.ActiveCfg = Debug|Win32
|
||||
{D5CAB879-D54F-456F-8592-31D549CFD1D8}.Tests|Win32.ActiveCfg = Debug|Win32
|
||||
{52F752EA-73D1-422D-B805-17EF1FB20E09}.Debug Play|Win32.ActiveCfg = Debug|Win32
|
||||
{52F752EA-73D1-422D-B805-17EF1FB20E09}.Debug Play|Win32.Build.0 = Debug|Win32
|
||||
{52F752EA-73D1-422D-B805-17EF1FB20E09}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{52F752EA-73D1-422D-B805-17EF1FB20E09}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{52F752EA-73D1-422D-B805-17EF1FB20E09}.Release Play|Win32.ActiveCfg = Release|Win32
|
||||
{52F752EA-73D1-422D-B805-17EF1FB20E09}.Release Play|Win32.Build.0 = Release|Win32
|
||||
{52F752EA-73D1-422D-B805-17EF1FB20E09}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{52F752EA-73D1-422D-B805-17EF1FB20E09}.Release|Win32.Build.0 = Release|Win32
|
||||
{52F752EA-73D1-422D-B805-17EF1FB20E09}.Test Fixes|Win32.ActiveCfg = Release|Win32
|
||||
{52F752EA-73D1-422D-B805-17EF1FB20E09}.Test Fixes|Win32.Build.0 = Release|Win32
|
||||
{52F752EA-73D1-422D-B805-17EF1FB20E09}.Tests|Win32.ActiveCfg = Release|Win32
|
||||
{52F752EA-73D1-422D-B805-17EF1FB20E09}.Tests|Win32.Build.0 = Release|Win32
|
||||
{52F752EA-73D1-422D-B805-17EF1FB20E09}.Test Fixes|Win32.ActiveCfg = Debug|Win32
|
||||
{52F752EA-73D1-422D-B805-17EF1FB20E09}.Tests|Win32.ActiveCfg = Debug|Win32
|
||||
{05292761-0847-4A68-BA10-9D384DC0D3EE}.Debug Play|Win32.ActiveCfg = Debug|Win32
|
||||
{05292761-0847-4A68-BA10-9D384DC0D3EE}.Debug Play|Win32.Build.0 = Debug|Win32
|
||||
{05292761-0847-4A68-BA10-9D384DC0D3EE}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{05292761-0847-4A68-BA10-9D384DC0D3EE}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{05292761-0847-4A68-BA10-9D384DC0D3EE}.Release Play|Win32.ActiveCfg = Release|Win32
|
||||
{05292761-0847-4A68-BA10-9D384DC0D3EE}.Release Play|Win32.Build.0 = Release|Win32
|
||||
{05292761-0847-4A68-BA10-9D384DC0D3EE}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{05292761-0847-4A68-BA10-9D384DC0D3EE}.Release|Win32.Build.0 = Release|Win32
|
||||
{05292761-0847-4A68-BA10-9D384DC0D3EE}.Test Fixes|Win32.ActiveCfg = Release|Win32
|
||||
{05292761-0847-4A68-BA10-9D384DC0D3EE}.Test Fixes|Win32.Build.0 = Release|Win32
|
||||
{05292761-0847-4A68-BA10-9D384DC0D3EE}.Tests|Win32.ActiveCfg = Release|Win32
|
||||
{05292761-0847-4A68-BA10-9D384DC0D3EE}.Tests|Win32.Build.0 = Release|Win32
|
||||
{05292761-0847-4A68-BA10-9D384DC0D3EE}.Test Fixes|Win32.ActiveCfg = Debug|Win32
|
||||
{05292761-0847-4A68-BA10-9D384DC0D3EE}.Tests|Win32.ActiveCfg = Debug|Win32
|
||||
{04D0594C-57F5-4277-AF1B-EAE90AED0C3C}.Debug Play|Win32.ActiveCfg = Debug|Win32
|
||||
{04D0594C-57F5-4277-AF1B-EAE90AED0C3C}.Debug Play|Win32.Build.0 = Debug|Win32
|
||||
{04D0594C-57F5-4277-AF1B-EAE90AED0C3C}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{04D0594C-57F5-4277-AF1B-EAE90AED0C3C}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{04D0594C-57F5-4277-AF1B-EAE90AED0C3C}.Release Play|Win32.ActiveCfg = Release|Win32
|
||||
{04D0594C-57F5-4277-AF1B-EAE90AED0C3C}.Release Play|Win32.Build.0 = Release|Win32
|
||||
{04D0594C-57F5-4277-AF1B-EAE90AED0C3C}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{04D0594C-57F5-4277-AF1B-EAE90AED0C3C}.Release|Win32.Build.0 = Release|Win32
|
||||
{04D0594C-57F5-4277-AF1B-EAE90AED0C3C}.Test Fixes|Win32.ActiveCfg = Release|Win32
|
||||
{04D0594C-57F5-4277-AF1B-EAE90AED0C3C}.Test Fixes|Win32.Build.0 = Release|Win32
|
||||
{04D0594C-57F5-4277-AF1B-EAE90AED0C3C}.Tests|Win32.ActiveCfg = Release|Win32
|
||||
{04D0594C-57F5-4277-AF1B-EAE90AED0C3C}.Tests|Win32.Build.0 = Release|Win32
|
||||
{04D0594C-57F5-4277-AF1B-EAE90AED0C3C}.Test Fixes|Win32.ActiveCfg = Debug|Win32
|
||||
{04D0594C-57F5-4277-AF1B-EAE90AED0C3C}.Tests|Win32.ActiveCfg = Debug|Win32
|
||||
{ADDFF069-D39D-4A1B-87C9-85A62B980547}.Debug Play|Win32.ActiveCfg = Debug|Win32
|
||||
{ADDFF069-D39D-4A1B-87C9-85A62B980547}.Debug Play|Win32.Build.0 = Debug|Win32
|
||||
{ADDFF069-D39D-4A1B-87C9-85A62B980547}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{ADDFF069-D39D-4A1B-87C9-85A62B980547}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{ADDFF069-D39D-4A1B-87C9-85A62B980547}.Release Play|Win32.ActiveCfg = Release|Win32
|
||||
{ADDFF069-D39D-4A1B-87C9-85A62B980547}.Release Play|Win32.Build.0 = Release|Win32
|
||||
{ADDFF069-D39D-4A1B-87C9-85A62B980547}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{ADDFF069-D39D-4A1B-87C9-85A62B980547}.Release|Win32.Build.0 = Release|Win32
|
||||
{ADDFF069-D39D-4A1B-87C9-85A62B980547}.Test Fixes|Win32.ActiveCfg = Release|Win32
|
||||
{ADDFF069-D39D-4A1B-87C9-85A62B980547}.Test Fixes|Win32.Build.0 = Release|Win32
|
||||
{ADDFF069-D39D-4A1B-87C9-85A62B980547}.Tests|Win32.ActiveCfg = Release|Win32
|
||||
{ADDFF069-D39D-4A1B-87C9-85A62B980547}.Tests|Win32.Build.0 = Release|Win32
|
||||
{ADDFF069-D39D-4A1B-87C9-85A62B980547}.Test Fixes|Win32.ActiveCfg = Debug|Win32
|
||||
{ADDFF069-D39D-4A1B-87C9-85A62B980547}.Tests|Win32.ActiveCfg = Debug|Win32
|
||||
{A428392F-52FB-489E-87D8-623528C7F4F9}.Debug Play|Win32.ActiveCfg = Debug|Win32
|
||||
{A428392F-52FB-489E-87D8-623528C7F4F9}.Debug Play|Win32.Build.0 = Debug|Win32
|
||||
{A428392F-52FB-489E-87D8-623528C7F4F9}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{A428392F-52FB-489E-87D8-623528C7F4F9}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{A428392F-52FB-489E-87D8-623528C7F4F9}.Release Play|Win32.ActiveCfg = Release|Win32
|
||||
{A428392F-52FB-489E-87D8-623528C7F4F9}.Release Play|Win32.Build.0 = Release|Win32
|
||||
{A428392F-52FB-489E-87D8-623528C7F4F9}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{A428392F-52FB-489E-87D8-623528C7F4F9}.Release|Win32.Build.0 = Release|Win32
|
||||
{A428392F-52FB-489E-87D8-623528C7F4F9}.Test Fixes|Win32.ActiveCfg = Release|Win32
|
||||
{A428392F-52FB-489E-87D8-623528C7F4F9}.Test Fixes|Win32.Build.0 = Release|Win32
|
||||
{A428392F-52FB-489E-87D8-623528C7F4F9}.Tests|Win32.ActiveCfg = Release|Win32
|
||||
{A428392F-52FB-489E-87D8-623528C7F4F9}.Tests|Win32.Build.0 = Release|Win32
|
||||
{A428392F-52FB-489E-87D8-623528C7F4F9}.Test Fixes|Win32.ActiveCfg = Debug|Win32
|
||||
{A428392F-52FB-489E-87D8-623528C7F4F9}.Tests|Win32.ActiveCfg = Debug|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
@ -202,11 +202,5 @@ echo.>>"%srcdir%\appversion.h"
|
||||
echo #endif //__APPVERSION_H__>>"%srcdir%\appversion.h"
|
||||
echo.>>"%srcdir%\appversion.h"
|
||||
|
||||
::
|
||||
:: Do update of version.cpp file last modify time to force it recompile
|
||||
::
|
||||
copy /b "%srcdir%\version.cpp"+,, "%srcdir%\version.cpp"
|
||||
endlocal
|
||||
|
||||
:_exit
|
||||
exit /B 0
|
||||
|
206
rehlds/dedicated/msvc/PreBuild.bat
Normal file
206
rehlds/dedicated/msvc/PreBuild.bat
Normal file
@ -0,0 +1,206 @@
|
||||
@setlocal enableextensions enabledelayedexpansion
|
||||
@echo off
|
||||
::
|
||||
:: Pre-build auto-versioning script
|
||||
::
|
||||
|
||||
set srcdir=%~1
|
||||
set repodir=%~2
|
||||
|
||||
set old_version=
|
||||
set version_major=0
|
||||
set version_minor=0
|
||||
set version_maintenance=0
|
||||
set version_modifed=
|
||||
|
||||
set commitSHA=
|
||||
set commitURL=
|
||||
set commitCount=0
|
||||
set branch_name=master
|
||||
|
||||
for /f "delims=" %%a in ('wmic OS Get localdatetime ^| find "."') do set "dt=%%a"
|
||||
set "YYYY=%dt:~0,4%"
|
||||
set "MM=%dt:~4,2%"
|
||||
set "DD=%dt:~6,2%"
|
||||
set "hour=%dt:~8,2%"
|
||||
set "min=%dt:~10,2%"
|
||||
set "sec=%dt:~12,2%"
|
||||
|
||||
::
|
||||
:: Remove leading zero from MM (e.g 09 > 9)
|
||||
::
|
||||
for /f "tokens=* delims=0" %%I in ("%MM%") do set MM=%%I
|
||||
|
||||
::
|
||||
:: Index into array to get month name
|
||||
::
|
||||
for /f "tokens=%MM%" %%I in ("Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec") do set "month=%%I"
|
||||
|
||||
::
|
||||
:: Check for git.exe presence
|
||||
::
|
||||
CALL git.exe describe >NUL 2>&1
|
||||
set errlvl="%ERRORLEVEL%"
|
||||
|
||||
::
|
||||
:: Read old appversion.h, if present
|
||||
::
|
||||
IF EXIST "%srcdir%\appversion.h" (
|
||||
FOR /F "usebackq tokens=1,2,3" %%i in ("%srcdir%\appversion.h") do (
|
||||
IF %%i==#define (
|
||||
IF %%j==APP_VERSION (
|
||||
:: Remove quotes
|
||||
set v=%%k
|
||||
set old_version=!v:"=!
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
IF %errlvl% == "1" (
|
||||
echo can't locate git.exe - auto-versioning step won't be performed
|
||||
|
||||
:: if we haven't appversion.h, we need to create it
|
||||
IF NOT "%old_version%" == "" (
|
||||
set commitCount=0
|
||||
)
|
||||
)
|
||||
|
||||
::
|
||||
:: Read major, minor and maintenance version components from Version.h
|
||||
::
|
||||
IF EXIST "%srcdir%\version.h" (
|
||||
FOR /F "usebackq tokens=1,2,3" %%i in ("%srcdir%\version.h") do (
|
||||
IF %%i==#define (
|
||||
IF %%j==VERSION_MAJOR set version_major=%%k
|
||||
IF %%j==VERSION_MINOR set version_minor=%%k
|
||||
IF %%j==VERSION_MAINTENANCE set version_maintenance=%%k
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
::
|
||||
:: Read revision and release date from it
|
||||
::
|
||||
IF NOT %errlvl% == "1" (
|
||||
:: Get current branch
|
||||
FOR /F "tokens=*" %%i IN ('"git -C "%repodir%\." rev-parse --abbrev-ref HEAD"') DO (
|
||||
set branch_name=%%i
|
||||
)
|
||||
|
||||
FOR /F "tokens=*" %%i IN ('"git -C "%repodir%\." rev-list --count !branch_name!"') DO (
|
||||
IF NOT [%%i] == [] (
|
||||
set commitCount=%%i
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
::
|
||||
:: Get remote url repository
|
||||
::
|
||||
IF NOT %errlvl% == "1" (
|
||||
|
||||
set branch_remote=origin
|
||||
:: Get remote name by current branch
|
||||
FOR /F "tokens=*" %%i IN ('"git -C "%repodir%\." config branch.!branch_name!.remote"') DO (
|
||||
set branch_remote=%%i
|
||||
)
|
||||
:: Get remote url
|
||||
FOR /F "tokens=2 delims=@" %%i IN ('"git -C "%repodir%\." config remote.!branch_remote!.url"') DO (
|
||||
set commitURL=%%i
|
||||
)
|
||||
:: Get commit id
|
||||
FOR /F "tokens=*" %%i IN ('"git -C "%repodir%\." rev-parse --verify HEAD"') DO (
|
||||
set shafull=%%i
|
||||
set commitSHA=!shafull:~0,+7!
|
||||
)
|
||||
|
||||
IF [!commitURL!] == [] (
|
||||
|
||||
FOR /F "tokens=1" %%i IN ('"git -C "%repodir%\." config remote.!branch_remote!.url"') DO (
|
||||
set commitURL=%%i
|
||||
)
|
||||
|
||||
:: strip .git
|
||||
if "x!commitURL:~-4!"=="x.git" (
|
||||
set commitURL=!commitURL:~0,-4!
|
||||
)
|
||||
|
||||
:: append extra string
|
||||
If NOT "!commitURL!"=="!commitURL:bitbucket.org=!" (
|
||||
set commitURL=!commitURL!/commits/
|
||||
) ELSE (
|
||||
set commitURL=!commitURL!/commit/
|
||||
)
|
||||
|
||||
) ELSE (
|
||||
:: strip .git
|
||||
if "x!commitURL:~-4!"=="x.git" (
|
||||
set commitURL=!commitURL:~0,-4!
|
||||
)
|
||||
:: replace : to /
|
||||
set commitURL=!commitURL::=/!
|
||||
|
||||
:: append extra string
|
||||
If NOT "!commitURL!"=="!commitURL:bitbucket.org=!" (
|
||||
set commitURL=https://!commitURL!/commits/
|
||||
) ELSE (
|
||||
set commitURL=https://!commitURL!/commit/
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
::
|
||||
:: Detect local modifications
|
||||
::
|
||||
set localChanged=0
|
||||
IF NOT %errlvl% == "1" (
|
||||
FOR /F "tokens=*" %%i IN ('"git -C "%repodir%\." ls-files -m"') DO (
|
||||
set localChanged=1
|
||||
)
|
||||
)
|
||||
|
||||
IF [%localChanged%]==[1] (
|
||||
set version_modifed=+m
|
||||
)
|
||||
|
||||
::
|
||||
:: Now form full version string like 1.0.0.1
|
||||
::
|
||||
|
||||
set new_version=%version_major%.%version_minor%.%version_maintenance%.%commitCount%-dev%version_modifed%
|
||||
|
||||
::
|
||||
:: Update appversion.h if version has changed or modifications/mixed revisions detected
|
||||
::
|
||||
IF NOT "%new_version%"=="%old_version%" goto _update
|
||||
goto _exit
|
||||
|
||||
:_update
|
||||
echo Updating appversion.h, new version is "%new_version%", the old one was %old_version%
|
||||
|
||||
echo #ifndef __APPVERSION_H__>"%srcdir%\appversion.h"
|
||||
echo #define __APPVERSION_H__>>"%srcdir%\appversion.h"
|
||||
echo.>>"%srcdir%\appversion.h"
|
||||
echo // >>"%srcdir%\appversion.h"
|
||||
echo // This file is generated automatically.>>"%srcdir%\appversion.h"
|
||||
echo // Don't edit it.>>"%srcdir%\appversion.h"
|
||||
echo // >>"%srcdir%\appversion.h"
|
||||
echo.>>"%srcdir%\appversion.h"
|
||||
echo // Version defines>>"%srcdir%\appversion.h"
|
||||
echo #define APP_VERSION "%new_version%">>"%srcdir%\appversion.h"
|
||||
|
||||
echo.>>"%srcdir%\appversion.h"
|
||||
echo #define APP_COMMIT_DATE "%month% %DD% %YYYY%">>"%srcdir%\appversion.h"
|
||||
echo #define APP_COMMIT_TIME "%hour%:%min%:%sec%">>"%srcdir%\appversion.h"
|
||||
|
||||
echo.>>"%srcdir%\appversion.h"
|
||||
echo #define APP_COMMIT_SHA "%commitSHA%">>"%srcdir%\appversion.h"
|
||||
echo #define APP_COMMIT_URL "%commitURL%">>"%srcdir%\appversion.h"
|
||||
echo.>>"%srcdir%\appversion.h"
|
||||
|
||||
echo #endif //__APPVERSION_H__>>"%srcdir%\appversion.h"
|
||||
echo.>>"%srcdir%\appversion.h"
|
||||
|
||||
:_exit
|
||||
exit /B 0
|
@ -71,7 +71,7 @@
|
||||
<AdditionalDependencies>ws2_32.lib;winmm.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
<PreBuildEvent>
|
||||
<Command>IF EXIST "$(ProjectDir)PreBuild.bat" (CALL "$(ProjectDir)PreBuild.bat" "$(ProjectDir)..\version\" "$(ProjectDir)..\")</Command>
|
||||
<Command>IF EXIST "$(ProjectDir)PreBuild.bat" (CALL "$(ProjectDir)PreBuild.bat" "$(ProjectDir)..\..\version\" "$(ProjectDir)..\..\")</Command>
|
||||
</PreBuildEvent>
|
||||
<PreBuildEvent>
|
||||
<Message>Setup version from Git revision</Message>
|
||||
@ -116,7 +116,7 @@
|
||||
<AdditionalDependencies>ws2_32.lib;winmm.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
<PreBuildEvent>
|
||||
<Command>IF EXIST "$(ProjectDir)PreBuild.bat" (CALL "$(ProjectDir)PreBuild.bat" "$(ProjectDir)..\version\" "$(ProjectDir)..\")</Command>
|
||||
<Command>IF EXIST "$(ProjectDir)PreBuild.bat" (CALL "$(ProjectDir)PreBuild.bat" "$(ProjectDir)..\..\version\" "$(ProjectDir)..\..\")</Command>
|
||||
</PreBuildEvent>
|
||||
<PreBuildEvent>
|
||||
<Message>Setup version from Git revision</Message>
|
||||
|
@ -202,11 +202,5 @@ echo.>>"%srcdir%\appversion.h"
|
||||
echo #endif //__APPVERSION_H__>>"%srcdir%\appversion.h"
|
||||
echo.>>"%srcdir%\appversion.h"
|
||||
|
||||
::
|
||||
:: Do update of version.cpp file last modify time to force it recompile
|
||||
::
|
||||
copy /b "%srcdir%\version.cpp"+,, "%srcdir%\version.cpp"
|
||||
endlocal
|
||||
|
||||
:_exit
|
||||
exit /B 0
|
||||
|
@ -176,9 +176,17 @@
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Play|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\unittests\rehlds_tests_shared.cpp" />
|
||||
<ClCompile Include="..\unittests\rehlds_tests_shared.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Play|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Play|Win32'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\unittests\security_tests.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Play|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Play|Win32'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\unittests\struct_offsets_tests.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
@ -553,21 +561,27 @@
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<TargetName>swds</TargetName>
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug Play|Win32'">
|
||||
<TargetName>swds</TargetName>
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Tests|Win32'">
|
||||
<TargetName>filesystem_stdio</TargetName>
|
||||
<TargetName>swds</TargetName>
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Test Fixes|Win32'">
|
||||
<TargetName>filesystem_stdio</TargetName>
|
||||
<TargetName>swds</TargetName>
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release Play|Win32'">
|
||||
<TargetName>swds</TargetName>
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<TargetName>swds</TargetName>
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<PreBuildEvent>
|
||||
@ -655,7 +669,7 @@
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>REHLDS_API;REHLDS_FLIGHT_REC;REHLDS_OPT_PEDANTIC;HAVE_OPT_STRTOOLS;REHLDS_SELF;REHLDS_UNIT_TESTS;_BUILD_FROM_IDE;USE_BREAKPAD_HANDLER;DEDICATED;SWDS;_CRT_SECURE_NO_WARNINGS;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>REHLDS_API;REHLDS_FLIGHT_REC;REHLDS_OPT_PEDANTIC;HAVE_OPT_STRTOOLS;REHLDS_SELF;REHLDS_UNIT_TESTS;USE_BREAKPAD_HANDLER;DEDICATED;SWDS;_CRT_SECURE_NO_WARNINGS;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>precompiled.h</PrecompiledHeaderFile>
|
||||
@ -691,7 +705,7 @@
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>REHLDS_API;REHLDS_FLIGHT_REC;REHLDS_OPT_PEDANTIC;REHLDS_FIXES;HAVE_OPT_STRTOOLS;REHLDS_SELF;REHLDS_UNIT_TESTS;_BUILD_FROM_IDE;USE_BREAKPAD_HANDLER;DEDICATED;SWDS;_CRT_SECURE_NO_WARNINGS;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>REHLDS_API;REHLDS_FLIGHT_REC;REHLDS_OPT_PEDANTIC;REHLDS_FIXES;HAVE_OPT_STRTOOLS;REHLDS_SELF;REHLDS_SSE;REHLDS_JIT;REHLDS_UNIT_TESTS;USE_BREAKPAD_HANDLER;DEDICATED;SWDS;_CRT_SECURE_NO_WARNINGS;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>precompiled.h</PrecompiledHeaderFile>
|
||||
@ -728,7 +742,7 @@
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>REHLDS_FLIGHT_REC;REHLDS_OPT_PEDANTIC;REHLDS_SELF;REHLDS_CHECKS;HAVE_OPT_STRTOOLS;USE_BREAKPAD_HANDLER;DEDICATED;SWDS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>REHLDS_FLIGHT_REC;REHLDS_OPT_PEDANTIC;REHLDS_SELF;USE_BREAKPAD_HANDLER;DEDICATED;SWDS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
<AdditionalOptions>/arch:IA32 %(AdditionalOptions)</AdditionalOptions>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
|
@ -6,11 +6,5 @@ int main(int argc, char* argv[]) {
|
||||
printf("TestRunner: main()\n");
|
||||
|
||||
GradleAdapter a;
|
||||
int res = a.testsEntryPoint(argc, argv);
|
||||
|
||||
#ifdef _BUILD_FROM_IDE
|
||||
system("PAUSE");
|
||||
#endif
|
||||
|
||||
return res;
|
||||
return a.testsEntryPoint(argc, argv);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user