-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathtest_unit.ps1
More file actions
159 lines (110 loc) · 6.01 KB
/
test_unit.ps1
File metadata and controls
159 lines (110 loc) · 6.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
Set-StrictMode -Version 3.0
$ErrorActionPreference = "Stop"
$PSNativeCommandUserErrorActionPerference = $true
# get the location of this file
$scriptpath = $MyInvocation.MyCommand.Path
# get the directory path to this file
$wd = Split-Path $scriptpath
# set the working directory as this file's directory
Push-Location $wd
# TODO: get rid of hard-coded path
$steamappspath = "C:\Program Files (x86)\Steam\steamapps\"
# TODO: this depends on Steam being installed - quite hefty just to test for Windows and Linux - maybe copy the required engine files into the repo to make this stand-alone?
New-Item -ItemType Directory -Force -Path build/
Set-Location -Path build/
Write-Output "----------------------------------"
Write-Output "Building for Team Fortress 2 (x86)"
Write-Output "----------------------------------"
# build the project with tests
python ../configure.py -s tf2 --mms-path $wd/alliedmodders/metamod-source/ --sm-path $wd/alliedmodders/sourcemod/ --hl2sdk-root $wd/alliedmodders/ --enable-tests --target-arch x86
ambuild
Write-Output "---------------------------------"
Write-Output "Testing for Team Fortress 2 (x86)"
Write-Output "---------------------------------"
# add the engine's bin directory to the path because the tests depend on tier0.dll and vstdlib.dll (use dumpbin /IMPORTS)
$env:Path = "$steamappspath\common\Team Fortress 2\bin;" + $env:Path
tests/testrunner/testrunner.exe
Write-Output ""
Write-Output "=================================="
Write-Output ""
Write-Output "----------------------------------"
Write-Output "Building for Team Fortress 2 (x64)"
Write-Output "----------------------------------"
# build the project with tests
python ../configure.py -s tf2 --mms-path $wd/alliedmodders/metamod-source/ --sm-path $wd/alliedmodders/sourcemod/ --hl2sdk-root $wd/alliedmodders/ --enable-tests --target-arch x64
ambuild
Write-Output "---------------------------------"
Write-Output "Testing for Team Fortress 2 (x64)"
Write-Output "---------------------------------"
# add the engine's bin directory to the path because the tests depend on tier0.dll and vstdlib.dll (use dumpbin /IMPORTS)
$env:Path = "$steamappspath\common\Team Fortress 2\bin\x64;" + $env:Path
tests/testrunner/testrunner.exe
Write-Output ""
Write-Output "=================================="
Write-Output ""
Write-Output "------------------------------------------"
Write-Output "Building for Half-Life 2: Deathmatch (x86)"
Write-Output "------------------------------------------"
# build the project with tests
python ../configure.py -s hl2dm --mms-path $wd/alliedmodders/metamod-source/ --sm-path $wd/alliedmodders/sourcemod/ --hl2sdk-root $wd/alliedmodders/ --enable-tests --target-arch x86
ambuild
Write-Output "-----------------------------------------"
Write-Output "Testing for Half-Life 2: Deathmatch (x86)"
Write-Output "-----------------------------------------"
# add the engine's bin directory to the path because the tests depend on tier0.dll and vstdlib.dll (use dumpbin /IMPORTS)
$env:Path = "$steamappspath\common\Half-Life 2 Deathmatch\bin;" + $env:Path
tests/testrunner/testrunner.exe
Write-Output ""
Write-Output "=================================="
Write-Output ""
Write-Output "------------------------------------------"
Write-Output "Building for Half-Life 2: Deathmatch (x64)"
Write-Output "------------------------------------------"
# build the project with tests
python ../configure.py -s hl2dm --mms-path $wd/alliedmodders/metamod-source/ --sm-path $wd/alliedmodders/sourcemod/ --hl2sdk-root $wd/alliedmodders/ --enable-tests --target-arch x64
ambuild
Write-Output "-----------------------------------------"
Write-Output "Testing for Half-Life 2: Deathmatch (x64)"
Write-Output "-----------------------------------------"
# add the engine's bin directory to the path because the tests depend on tier0.dll and vstdlib.dll (use dumpbin /IMPORTS)
# TODO: using Team Fortress 2's engine for now
$env:Path = "$steamappspath\common\Team Fortress 2\bin\x64;" + $env:Path
tests/testrunner/testrunner.exe
Write-Output ""
Write-Output "=================================="
Write-Output ""
# TODO: delete this until tests are enabled for these engine branches
Remove-Item -Path tests -Recurse -Force
Write-Output "----------------------------------"
Write-Output "Building for Source SDK 2013 (x86)"
Write-Output "----------------------------------"
# TODO: build the project with tests
python ../configure.py -s sdk2013 --mms-path $wd/alliedmodders/metamod-source/ --sm-path $wd/alliedmodders/sourcemod/ --hl2sdk-root $wd/alliedmodders/ --target-arch x86
ambuild
Write-Output ""
Write-Output "=================================="
Write-Output ""
Write-Output "-------------------------------------------"
Write-Output "Building for Half-Life 2: Episode Two (x86)"
Write-Output "-------------------------------------------"
# TODO: build the project with tests
python ../configure.py -s ep2 --mms-path $wd/alliedmodders/metamod-source/ --sm-path $wd/alliedmodders/sourcemod/ --hl2sdk-root $wd/alliedmodders/ --target-arch x86
ambuild
Write-Output ""
Write-Output "=================================="
Write-Output ""
Write-Output "-------------------------------------------"
Write-Output "Building for Half-Life 2: Episode One (x86)"
Write-Output "-------------------------------------------"
# build the project with tests
python ../configure.py -s episode1 --mms-path $wd/alliedmodders/metamod-source/ --sm-path $wd/alliedmodders/sourcemod/ --hl2sdk-root $wd/alliedmodders/ --enable-tests --target-arch x86
ambuild
Write-Output "------------------------------------------"
Write-Output "Testing for Half-Life 2: Episode One (x86)"
Write-Output "------------------------------------------"
# add the engine's bin directory to the path because the tests depend on tier0.dll and vstdlib.dll (use dumpbin /IMPORTS)
$env:Path = "$steamappspath\common\Source SDK Base\bin;" + $env:Path
tests/testrunner/testrunner.exe
# delete this because building without tests fails if it's here
# TODO: why isn't tests/testrunner/testrunner.exe being deleted?
Remove-Item -Path tests -Recurse -Force