Skip to content

Commit a61f3f9

Browse files
authored
Beau null test driver (#1886)
* Implement Automated Test App testing Add Mock ICD Add Headless mode to Test Apps Add Test Runner Add CICD scripts for running tests in Github Actions
1 parent 9af1af9 commit a61f3f9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+23708
-496
lines changed

.github/workflows/ci_build.yml

+113-52
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,20 @@ jobs:
1515
fail-fast: false
1616
matrix:
1717
config:
18-
- {
18+
- {
1919
name: "Ubuntu GCC Release",
2020
os: ubuntu-latest,
2121
artifact: "gfxreconstruct-dev-ubuntu-gcc-release",
22+
test_failure_artifact: "gfxreconstruct-dev-test-failure-ubuntu-gcc-release",
2223
type: "release",
2324
build_dir: "build",
2425
cc: "gcc", cxx: "g++"
2526
}
26-
- {
27+
- {
2728
name: "Ubuntu GCC Debug",
2829
os: ubuntu-latest,
2930
artifact: "gfxreconstruct-dev-ubuntu-gcc-debug",
31+
test_failure_artifact: "gfxreconstruct-dev-test-failure-ubuntu-gcc-debug",
3032
type: "debug",
3133
build_dir: "dbuild",
3234
cc: "gcc", cxx: "g++"
@@ -55,6 +57,20 @@ jobs:
5557
else
5658
python3 scripts/build.py --config ${{ matrix.config.type }} --skip-check-code-style --parallel 0 --test-apps
5759
fi
60+
- name: Run test app test cases
61+
id: test_apps
62+
run: |
63+
cd ${{matrix.config.build_dir}}/linux/x64/output/test
64+
sudo useradd test
65+
sudo usermod -a -G docker test
66+
chmod -R g+w .
67+
sudo -n -u test ./run-tests.sh
68+
- name: Upload test failure artifacts
69+
uses: actions/upload-artifact@v4
70+
if: ${{ failure() && steps.test_apps.conclusion == 'failure' }}
71+
with:
72+
name: ${{ matrix.config.test_failure_artifact }}
73+
path: ${{matrix.config.build_dir}}/linux/x64/output/test
5874
- name: Prepare artifacts
5975
run: |
6076
cp LICENSE.txt ${{ matrix.config.build_dir }}/linux/x64/output/bin/
@@ -77,18 +93,20 @@ jobs:
7793
fail-fast: false
7894
matrix:
7995
config:
80-
- {
96+
- {
8197
name: "Windows MSVC Release",
8298
os: windows-latest,
8399
artifact: "gfxreconstruct-dev-windows-msvc-release",
100+
test_failure_artifact: "gfxreconstruct-dev-test-failure-windows-msvc-release",
84101
type: "release",
85102
build_dir: "build",
86103
cc: "cl", cxx: "cl"
87104
}
88-
- {
105+
- {
89106
name: "Windows MSVC Debug",
90107
os: windows-latest,
91108
artifact: "gfxreconstruct-dev-windows-msvc-debug",
109+
test_failure_artifact: "gfxreconstruct-dev-test-failure-windows-msvc-debug",
92110
type: "debug",
93111
build_dir: "dbuild",
94112
cc: "cl", cxx: "cl"
@@ -120,6 +138,20 @@ jobs:
120138
- name: Run build script
121139
run: |
122140
python scripts\build.py --skip-check-code-style --config ${{ matrix.config.type }} --parallel 0 --test-apps
141+
- name: Run test app test cases
142+
id: test_apps
143+
run: |
144+
curl.exe -o vulkan-sdk.zip https://sdk.lunarg.com/sdk/download/1.3.296.0/windows/VulkanRT-1.3.296.0-Components.zip
145+
Expand-Archive vulkan-sdk.zip -DestinationPath $pwd\vulkan-sdk
146+
$env:Path += ";$pwd\vulkan-sdk\VulkanRT-1.3.296.0-Components\x64"
147+
cd ${{matrix.config.build_dir}}\windows\x64\output\test
148+
./run-tests.ps1
149+
- name: Upload test failure artifacts
150+
uses: actions/upload-artifact@v4
151+
if: ${{ failure() && steps.test_apps.conclusion == 'failure' }}
152+
with:
153+
name: ${{ matrix.config.test_failure_artifact }}
154+
path: ${{matrix.config.build_dir}}\windows\x64\output\test
123155
- name: Prepare artifacts
124156
run: |
125157
copy LICENSE.txt ${{ matrix.config.build_dir }}\windows\x64\output\bin\
@@ -141,17 +173,19 @@ jobs:
141173
fail-fast: false
142174
matrix:
143175
config:
144-
- {
176+
- {
145177
name: "macOS Release",
146178
os: macos-latest,
147179
artifact: "gfxreconstruct-dev-macOS-release",
180+
test_failure_artifact: "gfxreconstruct-dev-test-failure-macOS-release",
148181
type: "release",
149182
build_dir: "build"
150183
}
151-
- {
184+
- {
152185
name: "macOS Debug",
153186
os: macos-latest,
154187
artifact: "gfxreconstruct-dev-macOS-debug",
188+
test_failure_artifact: "gfxreconstruct-dev-test-failure-macOS-debug",
155189
type: "debug",
156190
build_dir: "dbuild"
157191
}
@@ -172,6 +206,31 @@ jobs:
172206
- name: Run build script
173207
run: |
174208
python3 scripts/build.py --skip-check-code-style --config ${{ matrix.config.type }} --cmake-extra "CMAKE_PREFIX_PATH=$HOME/deps" --cmake-extra CMAKE_OSX_DEPLOYMENT_TARGET=11.0 --parallel 0 --test-apps
209+
- name: Run test app test cases
210+
id: test_apps
211+
run: |
212+
WORKING_PATH="$(pwd)/${{matrix.config.build_dir}}/darwin/universal/output/test"
213+
cd $WORKING_PATH
214+
curl https://sdk.lunarg.com/sdk/download/1.4.304.0/mac/vulkansdk-macos-1.4.304.0.zip -o ./vulkan-sdk.zip
215+
unzip ./vulkan-sdk.zip -d ./vulkan-sdk
216+
sudo ./vulkan-sdk/InstallVulkan.app/Contents/MacOS/InstallVulkan --root $(pwd)/VulkanSDK/1.3.304.0 --accept-licenses --default-answer --confirm-command install
217+
sudo dscl . -create /Users/test
218+
sudo dscl . append /Groups/staff GroupMembership test
219+
sudo dscl . -create /Users/test UserShell /bin/bash
220+
sudo dscl . -create /Users/test RealName "Test"
221+
sudo dscl . -create /Users/test UniqueID "1001"
222+
sudo dscl . -create /Users/test PrimaryGroupID 80
223+
sudo dscl . -create /Users/test NFSHomeDirectory /Users/test
224+
sudo mkdir -p /Users/test
225+
sudo chown -R test:staff /Users/test
226+
sudo chmod -R g+w .
227+
sudo su - test -c "cd $WORKING_PATH && VULKAN_LIBRARY_PATH=$(pwd)/VulkanSDK/1.3.304.0/macOS/lib/libvulkan.dylib ./run-tests_macos.sh"
228+
- name: Upload test failure artifacts
229+
uses: actions/upload-artifact@v4
230+
if: ${{ failure() && steps.test_apps.conclusion == 'failure' }}
231+
with:
232+
name: ${{ matrix.config.test_failure_artifact }}
233+
path: ${{matrix.config.build_dir}}/darwin/universal/output/test
175234
- name: Prepare artifacts
176235
run: |
177236
cp LICENSE.txt ${{ matrix.config.build_dir }}/darwin/universal/output/bin/
@@ -198,58 +257,60 @@ jobs:
198257
fail-fast: false
199258
matrix:
200259
config:
201-
- {
260+
- {
202261
name: "Android Debug",
203262
os: ubuntu-latest,
204263
type: "debug",
205-
artifact: "gfxreconstruct-dev-android-debug"
264+
artifact: "gfxreconstruct-dev-android-debug",
265+
test_failure_artifact: "gfxreconstruct-dev-test-failure-android-debug"
206266
}
207-
- {
267+
- {
208268
name: "Android Release",
209269
os: ubuntu-latest,
210270
type: "release",
211-
artifact: "gfxreconstruct-dev-android-release"
271+
artifact: "gfxreconstruct-dev-android-release",
272+
test_failure_artifact: "gfxreconstruct-dev-test-failure-android-release"
212273
}
213274
steps:
214-
- name: Clone repository
215-
uses: actions/checkout@v4
216-
with:
217-
submodules: 'recursive'
218-
- name: Update submodules
219-
run: |
220-
git submodule update --init
221-
- name: Set up Java
222-
uses: "actions/setup-java@v4"
223-
with:
224-
java-version: 17
225-
distribution: "temurin"
226-
- name: Gradle build
227-
run: |
228-
cd android
229-
if [ "${{ matrix.config.type }}" == "release" ]
230-
then
231-
sh gradlew assembleRelease -Parm64-v8a
232-
else
233-
sh gradlew assembleDebug -Parm64-v8a
234-
fi
235-
- name: Prepare artifacts
236-
run: |
237-
mkdir gfxreconstruct-dev
238-
mkdir gfxreconstruct-dev/layer
239-
mkdir gfxreconstruct-dev/tools
240-
cp LICENSE.txt gfxreconstruct-dev/
241-
cp LICENSE_ThirdParty.txt gfxreconstruct-dev/
242-
cp USAGE_android.md gfxreconstruct-dev/
243-
cp layer/vk_layer_settings.txt gfxreconstruct-dev/
244-
if [ "${{ matrix.config.type }}" == "release" ]
245-
then
246-
cp -r android/layer/build/intermediates/cxx/RelWithDebInfo/*/obj/arm64-v8a gfxreconstruct-dev/layer/
247-
else
248-
cp android/tools/replay/build/outputs/apk/debug/replay-debug.apk gfxreconstruct-dev/tools/
249-
fi
250-
cp android/scripts/gfxrecon.py gfxreconstruct-dev/tools/
251-
- name: Upload artifacts
252-
uses: actions/upload-artifact@v4
253-
with:
254-
name: ${{ matrix.config.artifact }}
255-
path: ./gfxreconstruct-dev
275+
- name: Clone repository
276+
uses: actions/checkout@v4
277+
with:
278+
submodules: 'recursive'
279+
- name: Update submodules
280+
run: |
281+
git submodule update --init
282+
- name: Set up Java
283+
uses: "actions/setup-java@v4"
284+
with:
285+
java-version: 17
286+
distribution: "temurin"
287+
- name: Gradle build
288+
run: |
289+
cd android
290+
if [ "${{ matrix.config.type }}" == "release" ]
291+
then
292+
sh gradlew assembleRelease -Parm64-v8a
293+
else
294+
sh gradlew assembleDebug -Parm64-v8a
295+
fi
296+
- name: Prepare artifacts
297+
run: |
298+
mkdir gfxreconstruct-dev
299+
mkdir gfxreconstruct-dev/layer
300+
mkdir gfxreconstruct-dev/tools
301+
cp LICENSE.txt gfxreconstruct-dev/
302+
cp LICENSE_ThirdParty.txt gfxreconstruct-dev/
303+
cp USAGE_android.md gfxreconstruct-dev/
304+
cp layer/vk_layer_settings.txt gfxreconstruct-dev/
305+
if [ "${{ matrix.config.type }}" == "release" ]
306+
then
307+
cp -r android/layer/build/intermediates/cxx/RelWithDebInfo/*/obj/arm64-v8a gfxreconstruct-dev/layer/
308+
else
309+
cp android/tools/replay/build/outputs/apk/debug/replay-debug.apk gfxreconstruct-dev/tools/
310+
fi
311+
cp android/scripts/gfxrecon.py gfxreconstruct-dev/tools/
312+
- name: Upload artifacts
313+
uses: actions/upload-artifact@v4
314+
with:
315+
name: ${{ matrix.config.artifact }}
316+
path: ./gfxreconstruct-dev

0 commit comments

Comments
 (0)