forked from shader-slang/slang
-
Notifications
You must be signed in to change notification settings - Fork 0
/
github_test.sh
33 lines (25 loc) · 993 Bytes
/
github_test.sh
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
#!/usr/bin/env bash
# CONFIGURATION=release or debug
if [ "${CC}" == "gcc" ] && [ "${CONFIGURATION}" == "release" ]
then
SLANG_TEST_CATEGORY=full
else
SLANG_TEST_CATEGORY=smoke
fi
PLATFORM=$(uname -s | tr '[:upper:]' '[:lower:]')
ARCHITECTURE=$(uname -p)
if [ "${ARCHITECTURE}" == "x86_64" ]; then
ARCHITECTURE="x64"
fi
TARGET=${PLATFORM}-${ARCHITECTURE}
OUTPUTDIR=bin/${TARGET}/${CONFIGURATION}/
if [ "${ARCHITECTURE}" == "x64" ]; then
LOCATION=$(curl -s https://api.github.com/repos/shader-slang/swiftshader/releases/latest \
| grep "tag_name" \
| awk '{print "https://github.com/shader-slang/swiftshader/releases/download/" substr($2, 2, length($2)-3) "/vk_swiftshader_linux_x64.zip"}')
curl -L -o libswiftshader.zip $LOCATION
unzip libswiftshader.zip -d $OUTPUTDIR
fi
SLANG_TEST=${OUTPUTDIR}slang-test
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$OUTPUTDIR
${SLANG_TEST} -bindir ${OUTPUTDIR} -travis -category ${SLANG_TEST_CATEGORY} ${SLANG_TEST_FLAGS}