From 0640475e4be6629d6d9f70bfaca1a3d6dc99518b Mon Sep 17 00:00:00 2001 From: bones_was_here Date: Tue, 22 Mar 2022 01:21:08 +1000 Subject: [PATCH] pipeline: use make jobserver to run 3 compilationunits.sh in parallel compilationunits.sh has 3 main tasks, one for each progs. They were run sequentially without making use of multi threading. Also make clean now removes the temp files created by compilationunits.sh --- .gitlab-ci.yml | 2 +- Makefile | 10 +++++++--- qcsrc/Makefile | 7 +++++++ qcsrc/tools/compilationunits.sh | 5 +++-- 4 files changed, 18 insertions(+), 6 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 89ac1ce36..cc7b5bd06 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -22,7 +22,7 @@ test_compilation_units: - qcsrc/**/* stage: test script: - - ./qcsrc/tools/compilationunits.sh + - make test test_sv_game: stage: test diff --git a/Makefile b/Makefile index ab7fa6c1b..9ba235e48 100644 --- a/Makefile +++ b/Makefile @@ -23,13 +23,13 @@ qc: check-cvars .PHONY: skin skin: gfx/menu/default/skinvalues.txt +gfx/menu/default/skinvalues.txt: qcsrc/menu/skin-customizables.inc + $(PERL) qcsrc/menu/skin-customizables.inc > gfx/menu/default/skinvalues.txt + .PHONY: clean clean: $(MAKE) -C qcsrc clean -gfx/menu/default/skinvalues.txt: qcsrc/menu/skin-customizables.inc - $(PERL) qcsrc/menu/skin-customizables.inc > gfx/menu/default/skinvalues.txt - .PHONY: sv sv: $(MAKE) -C qcsrc sv @@ -37,3 +37,7 @@ sv: .PHONY: pk3 pk3: $(MAKE) -C qcsrc pk3 + +.PHONY: test +test: + $(MAKE) -C qcsrc test diff --git a/qcsrc/Makefile b/qcsrc/Makefile index f562bd4f6..ee9e7e64a 100644 --- a/qcsrc/Makefile +++ b/qcsrc/Makefile @@ -81,6 +81,7 @@ clean: | $(WORKDIR) $(RM) $(WORKDIR)/qccversion.* $(RM) $(WORKDIR)/csprogs-* $(RM) $(WORKDIR)/autoexec/csprogs-*.cfg + $(RM) $(WORKDIR)/*.dat $(RM) csprogs-*.pk3 .PHONY: qc @@ -94,6 +95,12 @@ pk3: csprogs-$(VER).pk3 +COMPTESTS = test-server test-client test-menu +.PHONY: test $(COMPTESTS) +test: $(COMPTESTS) +$(COMPTESTS): + tools/compilationunits.sh $@ + %-$(VER).pk3: $(PROGS_OUT)/%.dat diff --git a/qcsrc/tools/compilationunits.sh b/qcsrc/tools/compilationunits.sh index 7a7ff17b6..375b534ae 100755 --- a/qcsrc/tools/compilationunits.sh +++ b/qcsrc/tools/compilationunits.sh @@ -66,10 +66,10 @@ function check1() { MODE=${prog} includes="-include lib/_all.inc" [ -f ${prog}/_all.qh ] && includes="${includes} -include ${prog}/_all.qh" - qpp ${file} test.dat \ + qpp ${file} test-${prog}.dat \ ${includes} \ -I. ${QCCIDENT} ${QCCDEFS} > ${WORKDIR}/${prog}.qc - qcc ${QCCFLAGS} -o ../${WORKDIR}/test.dat ../${WORKDIR}/${prog}.qc >/dev/null + qcc ${QCCFLAGS} -o ../${WORKDIR}/test-${prog}.dat ../${WORKDIR}/${prog}.qc >/dev/null } function check() { @@ -85,6 +85,7 @@ if [ ${#@} -eq 0 ]; then check menu else for var in ${@}; do + var=${var#test-} check ${var} done fi -- 2.39.2