]> git.xonotic.org Git - xonotic/xonotic.git/blob - misc/tools/the-big-benchmark.sh
benchmark: enable developer log
[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 rm -f data/benchmark.log
34 rm -f data/engine.log
35 if [ -f ./all ]; then
36         ./all clean --reclone
37         ./all compile -r
38         set -- ./all run "$@"
39 elif [ -z "$*" ]; then
40         case "`uname`" in
41                 Darwin)
42                         set -- ./Xonotic.app/Contents/MacOS/xonotic-osx-sdl
43                         ;;
44                 Linux)
45                         set -- ./xonotic-linux-sdl.sh
46                         ;;
47                 *)
48                         echo "OS not detected. Usage:"
49                         echo "  $0 how-to-run-xonotic"
50                         echo "On Windows when using a release build or an autobuild,"
51                         echo "use the-big-benchmark.bat instead!"
52                         exit 1
53                         ;;
54         esac
55 fi
56 (
57         echo
58         echo "Engine log follows:"
59         echo " ==================="
60         set -x
61         for e in omg low med normal high ultra ultimate; do
62                 USE_GDB=no \
63                 "$@" \
64                         +exec effects-$e.cfg \
65                         +developer 1 \
66                         -nohome \
67                         -benchmarkruns 4 -benchmarkruns_skipfirst \
68                         -benchmark demos/the-big-keybench.dem
69         done
70 ) >data/engine.log 2>&1
71 cat data/engine.log >> data/benchmark.log
72 rm -f data/engine.log
73 if [ -f ./all ]; then
74         ./all clean -r -f -u
75 fi
76 set +x
77
78 echo
79 echo "Please provide the the following info to the Xonotic developers:"
80 echo " - CPU speed"
81 echo " - memory size"
82 echo " - graphics card (which vendor, which model)"
83 echo " - operating system (including whether it is 32bit or 64bit)"
84 echo " - graphics driver version"
85 echo " - the file benchmark.log in the data directory"
86 echo
87 echo "Thank you"