]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/tools/compilationunits.sh
Provisions for unit testing
[xonotic/xonotic-data.pk3dir.git] / qcsrc / tools / compilationunits.sh
index 658fe8682581933e7629259049157738aac2559e..676c3f315a79d440c9f0e9e0aca14d73ead96df7 100755 (executable)
@@ -33,14 +33,21 @@ QCCFLAGS="${QCCFLAGS[@]} ${NOWARN[@]}"
 . qcc.sh
 cd ..
 
-function check() {
+function check1() {
     declare -l base="${1}"
     MODE=${2}
-    find ${base} -type f -name '*.qc' -print0 | sort -z | while read -r -d '' file; do
-        qpp ${file} test.dat \
+    declare -l file="${3}"
+    qpp ${file} test.dat \
             -include lib/_all.inc -include ${base}/_all.qh \
             -I. ${QCCIDENT} ${QCCDEFS} -D${MODE} > ${WORKDIR}/${MODE}.qc
-        qcc ${QCCFLAGS} -o ../${WORKDIR}/test.dat ../${WORKDIR}/${MODE}.qc >/dev/null
+    qcc ${QCCFLAGS} -o ../${WORKDIR}/test.dat ../${WORKDIR}/${MODE}.qc >/dev/null
+}
+
+function check() {
+    declare -l base="${1}"
+    MODE=${2}
+    find ${base} -type f -name '*.qc' -print0 | sort -z | while read -r -d '' file; do
+        check1 ${base} ${MODE} ${file}
     done
 }