]> de.git.xonotic.org Git - xonotic/xonotic.git/blob - misc/tools/the-big-benchmark.sh
benchmark fixes
[xonotic/xonotic.git] / misc / tools / the-big-benchmark.sh
1 #!/bin/sh
2
3 set -e
4
5 if [ -d "${0%/*}" ]; then
6         cd "${0%/*}"
7 fi
8 cd ../..
9
10 echo "The Big Benchmark"
11 echo " ================="
12 echo
13 if [ -f ./all ]; then
14         echo "WARNING: running this script will destroy ANY local changes you"
15         echo "might have on the repository that haven't been pushed yet."
16         echo
17         if [ x"$1" != x"--yes" ]; then
18                 echo "Are you absolutely sure you want to run this?"
19                 echo
20                 while :; do
21                         echo -n "y/n: "
22                         read -r yesno
23                         case "$yesno" in
24                                 y)
25                                         break
26                                         ;;
27                                 n)
28                                         echo "Aborted."
29                                         exit 1
30                                         ;;
31                         esac
32                 done
33         fi
34 fi
35
36 rm -f data/benchmark.log
37 rm -f data/engine.log
38 if [ -f ./all ]; then
39         ./all clean --reclone
40         ./all compile -r
41         set -- ./all run "$@"
42 elif [ -z "$*" ]; then
43         case "`uname`" in
44                 Darwin)
45                         set -- ./Xonotic.app/Contents/MacOS/xonotic-osx-sdl
46                         ;;
47                 Linux)
48                         set -- ./xonotic-linux-sdl.sh
49                         ;;
50                 *)
51                         echo "OS not detected. Usage:"
52                         echo "  $0 how-to-run-xonotic"
53                         echo "On Windows when using a release build or an autobuild,"
54                         echo "use the-big-benchmark.bat instead!"
55                         exit 1
56                         ;;
57         esac
58 fi
59 (
60         echo
61         echo "Engine log follows:"
62         echo " ==================="
63         set -x
64         for e in omg low med normal high ultra ultimate; do
65                 USE_GDB=no \
66                 "$@" \
67                         +exec effects-$e.cfg \
68                         +developer 1 \
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"