commit 9cdeaa54beefaecc0ed66c046d39d823b98848ba
Author: Samuel Thibault <samuel.thibault@ens-lyon.org>
Date:   Sat Dec 28 22:46:17 2024 +0100

    tests: Fix parallel build of iso files
    
    We need to use a separate iso tree directory.

commit 831ab600e46756d0795e4060813650c391e90dda
Author: Samuel Thibault <samuel.thibault@ens-lyon.org>
Date:   Sat Dec 28 22:46:52 2024 +0100

    tests: Fix out-of-order generation of mig files
    
    Make is allowed to run the tests/module-% prereqs out-of-order, so
    explicit the dependency between installing .defs files and generating
    .user/server.c.

diff --git a/tests/user-qemu.mk b/tests/user-qemu.mk
index b48f49ec..055b0149 100644
--- a/tests/user-qemu.mk
+++ b/tests/user-qemu.mk
@@ -175,15 +175,16 @@ QEMU_OPTS += -cpu core2duo-v1
 endif
 
 tests/test-%.iso: tests/module-% gnumach $(srcdir)/tests/grub.cfg.single.template
-	rm -rf $(builddir)/tests/isofiles
-	mkdir -p $(builddir)/tests/isofiles/boot/grub/
+	rm -rf $(builddir)/tests/isofiles-$*
+	mkdir -p $(builddir)/tests/isofiles-$*/boot/grub/
 	< $(srcdir)/tests/grub.cfg.single.template		\
 		sed -e "s|BOOTMODULE|$(notdir $<)|g"		\
 		    -e "s/GNUMACHARGS/$(GNUMACH_ARGS)/g"	\
 		    -e "s/TEST_START_MARKER/$(TEST_START_MARKER)/g"	\
-		>$(builddir)/tests/isofiles/boot/grub/grub.cfg
-	cp gnumach $< $(builddir)/tests/isofiles/boot/
-	grub-mkrescue -o $@ $(builddir)/tests/isofiles
+		>$(builddir)/tests/isofiles-$*/boot/grub/grub.cfg
+	cp gnumach $< $(builddir)/tests/isofiles-$*/boot/
+	grub-mkrescue -o $@ $(builddir)/tests/isofiles-$*
+	rm -rf $(builddir)/tests/isofiles-$*
 
 tests/test-%: tests/test-%.iso $(srcdir)/tests/run-qemu.sh.template
 	< $(srcdir)/tests/run-qemu.sh.template			\
diff --git a/tests/user-qemu.mk b/tests/user-qemu.mk
index 055b0149..3dd2e46c 100644
--- a/tests/user-qemu.mk
+++ b/tests/user-qemu.mk
@@ -36,6 +36,7 @@ $(MIG_OUTDIR):
 	mkdir -p $@
 
 define generate_mig_client
+$(MACH_TESTINCLUDE)/$(1)/$(2).defs: $(MACH_TESTINSTALL)
 $(MIG_OUTDIR)/$(2).user.c: prepare-test $(MIG_OUTDIR) $(MACH_TESTINCLUDE)/$(1)/$(2).defs
 	$(USER_CPP) $(USER_CPPFLAGS) $(MIG_CPPFLAGS) 	\
 		-o $(MIG_OUTDIR)/$(2).user.defs 	\
@@ -48,6 +49,7 @@ $(MIG_OUTDIR)/$(2).user.c: prepare-test $(MIG_OUTDIR) $(MACH_TESTINCLUDE)/$(1)/$
 endef
 
 define generate_mig_server
+$(MACH_TESTINCLUDE)/$(1)/$(2).defs: $(MACH_TESTINSTALL)
 $(MIG_OUTDIR)/$(2).server.c: prepare-test $(MIG_OUTDIR) $(srcdir)/include/$(1)/$(2).defs
 	$(USER_CPP) $(USER_CPPFLAGS) $(MIG_CPPFLAGS) 	\
 		-o $(MIG_OUTDIR)/$(2).server.defs 	\
