-
-
Notifications
You must be signed in to change notification settings - Fork 31
/
DownloadPiglit.sh
executable file
·54 lines (42 loc) · 1.09 KB
/
DownloadPiglit.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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/bin/bash
echo "This script downloads and sorts glsl tests from git://anongit.freedesktop.org/git/piglit (repo)."
echo "Downloaded files are under license, see repo for details."
# Move to this directory
cd "$(dirname "$0")"
if [ -d piglit-repo ]; then
echo "Repo exists"
cd piglit-repo
git pull
cd ..
else
echo "Cloning repo"
git clone --depth=1 git://anongit.freedesktop.org/git/piglit piglit-repo
fi
if [ -d piglit ]; then
echo Deleting piglit directory
# To clean
rm -rf piglit/
fi
echo Creating piglit directory
mkdir piglit
mkdir piglit/pass
mkdir piglit/fail
mkdir piglit/other
cd piglit-repo
rm -rf ./examples/
for FILE in $(find . -type f -name *.frag) $(find . -type f -name *.vert);
do
if [ ! -z "$(grep "expect_result: pass" "$FILE")" ]; then
cp "$FILE" "../piglit/pass/$(basename "$FILE")"
elif [ ! -z "$(grep "expect_result: fail" "$FILE")" ]; then
cp "$FILE" "../piglit/fail/$(basename "$FILE")"
else
cp "$FILE" "../piglit/other/$(basename "$FILE")"
fi
done
cd ..
if [ "$1" != "keeprepo" ]; then
rm -rf piglit-repo
echo "Repo deleted"
fi
echo Done