]> de.git.xonotic.org Git - xonotic/xonotic.git/blob - misc/tools/the-big-benchmark.sh
move the-big-benchmark to misc/tools
[xonotic/xonotic.git] / misc / tools / the-big-benchmark.sh
1 #!/bin/sh
2
3 set -e
4
5 cd ../..
6
7 echo "The Big Benchmark"
8 echo " ================="
9 echo
10 if [ -f ./all ]; then
11         echo "WARNING: running this script will destroy ANY local changes you"
12         echo "might have on the repository that haven't been pushed yet."
13         echo
14         if [ x"$1" != x"--yes" ]; then
15                 echo "Are you absolutely sure you want to run this?"
16                 echo
17                 while :; do
18                         echo -n "y/n: "
19                         read -r yesno
20                         case "$yesno" in
21                                 y)
22                                         break
23                                         ;;
24                                 n)
25                                         echo "Aborted."
26                                         exit 1
27                                         ;;
28                         esac
29                 done
30         fi
31 fi
32
33 set -x
34
35 rm -f data/benchmark.log
36 rm -f data/engine.log
37 if [ -f ./all ]; then
38         ./all clean --reclone
39         ./all compile -r
40         set -- ./all run "$@"
41 elif [ -z "$*" ]; then
42         
43         case "`uname`" in
44                 MINGW*|Win*)
45                         set -- ./xonotic.exe
46                         ;;
47                 Darwin)
48                         set -- ./Xonotic.app/Contents/MacOS/xonotic-osx-sdl
49                         ;;
50                 Linux)
51                         set -- ./xonotic-linux-sdl.sh
52                         ;;
53                 *)
54                         echo "OS not detected. Usage:"
55                         echo "  $0 how-to-run-xonotic"
56                         exit 1
57                         ;;
58         esac
59 fi
60 (
61         echo
62         echo "Engine log follows:"
63         echo " ==================="
64         set -x
65         for e in omg low med normal high ultra ultimate; do
66                 USE_GDB=no \
67                 "$@" \
68                         +exec effects-$e.cfg \
69                         -nohome \
70                         -benchmarkruns 4 -benchmarkruns_skipfirst \
71                         -benchmark demos/the-big-keybench.dem
72         done
73 ) >data/engine.log 2>&1
74 cat data/engine.log >> data/benchmark.log
75 rm -f data/engine.log
76 if [ -f ./all ]; then
77         ./all clean -r -f -u
78 fi
79 set +x
80
81 echo
82 echo "Please provide the the following info to the Xonotic developers:"
83 echo " - CPU speed"
84 echo " - memory size"
85 echo " - graphics card (which vendor, which model)"
86 echo " - operating system (including whether it is 32bit or 64bit)"
87 echo " - graphics driver version"
88 echo " - the file benchmark.log in the data directory"
89 echo
90 echo "Thank you"