+test_sv_unit:
+ stage: test
+ script:
+ - git clone --depth=1 --branch=master https://gitlab.com/xonotic/darkplaces.git darkplaces
+ - cd darkplaces && make sv-debug -j $(nproc) && export ENGINE="$PWD/darkplaces-dedicated -xonotic"
+ - cd ..
+
+ - mkdir maps && wget -O maps/gitlab-ci.bsp https://gitlab.com/xonotic/xonotic-maps.pk3dir/raw/master/maps/_init/_init.bsp
+ - make
+ - while read line; do
+ echo $line;
+ if [[ $line == "All tests OK" ]]; then exit 0; fi;
+ done < <(${ENGINE} +developer 1 +map gitlab-ci +sv_cmd runtest +exit)
+ - exit 1
+