]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/test/compilationunit.sh
Merge branch 'terencehill/connection_msg_fix' into 'master'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / test / compilationunit.sh
1 #!/bin/bash
2 set -eu
3 cd "$(dirname "$0")"
4 cd ..
5
6 declare -a NOWARN=(
7   -Wno-field-redeclared
8   -Wno-unused-variable
9   -Wno-implicit-function-pointer
10 )
11 declare QCC=../../../gmqcc/gmqcc
12
13 declare -a QCC_FLAGS=(
14   -std=gmqcc
15   -Wall -Werror
16   -fftepp -fftepp-predefs -Wcpp
17   -futf8
18   -freturn-assignments
19   -frelaxed-switch
20   -Ooverlap-locals
21 )
22
23 function check() {
24   declare -l base="${1}"
25   declare -la predefs=("-D${2}" "lib/_all.inc" "${base}/_all.qh")
26   find "$base" -type f -name '*.qc' -print0 | sort -z | while read -r -d '' file; do
27     echo "$file"
28     ${QCC} "${QCC_FLAGS[@]}" "${NOWARN[@]}" "${predefs[@]}" "$file" >/dev/null
29   done
30 }
31
32 check client CSQC
33 check server SVQC
34 check menu MENUQC