Commit Diff


commit - f53af81cd3a09fb1c5e1e1511094971eda210976
commit + 5e5c37b59cbae92fc6e67b5dc70e8a412fa967c4
blob - b94225d1085d01075d56827a43d7b1a89368f0c0
blob + 6c47defd771e97468a534c2f3feaca47494d223f
--- script.c
+++ script.c
@@ -555,7 +555,10 @@ test_done(char *name, char *dir)
 	test->dir = dir;
 	test->body = finalize(&blocks, NULL);
 
-	TAILQ_INSERT_HEAD(&tests, test, entry);
+	if (TAILQ_EMPTY(&tests))
+		TAILQ_INSERT_HEAD(&tests, test, entry);
+	else
+		TAILQ_INSERT_TAIL(&tests, test, entry);
 }
 
 static int