commit 3ce4bce

shrub  ·  2026-05-15 16:01:32 +0000 UTC
parent dcccc2d
more test fixes
31 files changed,  +102, -101
+10, -10
 1@@ -1,13 +1,13 @@
 2-shin-make: Entering directory '/tmp/MElsqVYUHH'
 3-/tmp/shin-extract/tests/shin-make -f t001.mk foo
 4-shin-make[1]: Entering directory '/tmp/MElsqVYUHH'
 5-/tmp/shin-extract/tests/shin-make
 6+shin-make: Entering directory '#PWD#'
 7+#MAKE# -f t001.mk foo
 8+shin-make[1]: Entering directory '#PWD#'
 9+#MAKE#
10 MAKELEVEL = 1
11-/tmp/shin-extract/tests/shin-make -f t001.mk last
12-shin-make[2]: Entering directory '/tmp/MElsqVYUHH'
13-/tmp/shin-extract/tests/shin-make
14+#MAKE# -f t001.mk last
15+shin-make[2]: Entering directory '#PWD#'
16+#MAKE#
17 MAKELEVEL = 2
18 THE END
19-shin-make[2]: Leaving directory '/tmp/MElsqVYUHH'
20-shin-make[1]: Leaving directory '/tmp/MElsqVYUHH'
21-shin-make: Leaving directory '/tmp/MElsqVYUHH'
22+shin-make[2]: Leaving directory '#PWD#'
23+shin-make[1]: Leaving directory '#PWD#'
24+shin-make: Leaving directory '#PWD#'
+2, -2
1@@ -1,3 +1,3 @@
2-shin-make[1]: Entering directory '/tmp/NB9HxqKAl2'
3+shin-make[1]: Entering directory '#PWD#'
4 This is another included makefile
5-shin-make[1]: Leaving directory '/tmp/NB9HxqKAl2'
6+shin-make[1]: Leaving directory '#PWD#'
+2, -2
1@@ -1,3 +1,3 @@
2-shin-make[1]: Entering directory '/tmp/NB9HxqKAl2'
3+shin-make[1]: Entering directory '#PWD#'
4 This is another included makefile
5-shin-make[1]: Leaving directory '/tmp/NB9HxqKAl2'
6+shin-make[1]: Leaving directory '#PWD#'
+1, -1
1@@ -1,3 +1,3 @@
2-/tmp/shin-extract/tests/shin-make -f "t004.mk" bar
3+#MAKE# -f "t004.mk" bar
4 touch inc
5 echo n --no-print-directory
+2, -2
1@@ -1,3 +1,3 @@
2-shin-make: Entering directory '/tmp/JScldhtGLs'
3+shin-make: Entering directory '#PWD#'
4 hi
5-shin-make: Leaving directory '/tmp/JScldhtGLs'
6+shin-make: Leaving directory '#PWD#'
+2, -2
1@@ -1,3 +1,3 @@
2-shin-make: Entering directory '/tmp/JScldhtGLs'
3+shin-make: Entering directory '#PWD#'
4 hi
5-shin-make: Leaving directory '/tmp/JScldhtGLs'
6+shin-make: Leaving directory '#PWD#'
+2, -2
1@@ -1,3 +1,3 @@
2-shin-make: Entering directory '/tmp/JScldhtGLs'
3+shin-make: Entering directory '#PWD#'
4 touch foo
5-shin-make: Leaving directory '/tmp/JScldhtGLs'
6+shin-make: Leaving directory '#PWD#'
+2, -2
1@@ -1,3 +1,3 @@
2-shin-make: Entering directory '/tmp/JScldhtGLs'
3+shin-make: Entering directory '#PWD#'
4 touch foo
5-shin-make: Leaving directory '/tmp/JScldhtGLs'
6+shin-make: Leaving directory '#PWD#'
+2, -2
1@@ -1,3 +1,3 @@
2-shin-make[1]: Entering directory '/tmp/JScldhtGLs'
3+shin-make[1]: Entering directory '#PWD#'
4 hi
5-shin-make[1]: Leaving directory '/tmp/JScldhtGLs'
6+shin-make[1]: Leaving directory '#PWD#'
+4, -4
 1@@ -1,5 +1,5 @@
 2-shin-make: Entering directory '/tmp/JScldhtGLs'
 3-shin-make[1]: Entering directory '/tmp/JScldhtGLs'
 4+shin-make: Entering directory '#PWD#'
 5+shin-make[1]: Entering directory '#PWD#'
 6 hi
 7-shin-make[1]: Leaving directory '/tmp/JScldhtGLs'
 8-shin-make: Leaving directory '/tmp/JScldhtGLs'
 9+shin-make[1]: Leaving directory '#PWD#'
10+shin-make: Leaving directory '#PWD#'
+2, -2
1@@ -1,3 +1,3 @@
2-shin-make[1]: Entering directory '/tmp/XQlXNTpfXm'
3+shin-make[1]: Entering directory '#PWD#'
4 Executing rule BAR
5-shin-make[1]: Leaving directory '/tmp/XQlXNTpfXm'
6+shin-make[1]: Leaving directory '#PWD#'
+2, -2
 1@@ -4,8 +4,8 @@ GNUMAKEFLAGS =
 2 recurse
 3 MAKEFLAGS = -Itst/bad
 4 GNUMAKEFLAGS =
 5-shin-make[1]: Entering directory '/tmp/788AKhJx2t'
 6+shin-make[1]: Entering directory '#PWD#'
 7 all
 8 MAKEFLAGS = -Itst/bad
 9 GNUMAKEFLAGS =
10-shin-make[1]: Leaving directory '/tmp/788AKhJx2t'
11+shin-make[1]: Leaving directory '#PWD#'
+5, -5
 1@@ -1,5 +1,5 @@
 2-/tmp/shin-extract/tests/shin-make
 3-/tmp/shin-extract/tests/shin-make -f t001.mk foo
 4-shin-make[1]: Entering directory '/tmp/1drWU2zMzD'
 5-/tmp/shin-extract/tests/shin-make
 6-shin-make[1]: Leaving directory '/tmp/1drWU2zMzD'
 7+#MAKE#
 8+#MAKE# -f t001.mk foo
 9+shin-make[1]: Entering directory '#PWD#'
10+#MAKE#
11+shin-make[1]: Leaving directory '#PWD#'
+2, -2
1@@ -1,5 +1,5 @@
2-shin-make: Entering directory '/tmp/Au2OqFkb24'
3+shin-make: Entering directory '#PWD#'
4 w
5 w
6 shin-make: 'all' is up to date.
7-shin-make: Leaving directory '/tmp/Au2OqFkb24'
8+shin-make: Leaving directory '#PWD#'
+2, -2
1@@ -1,5 +1,5 @@
2-shin-make: Entering directory '/tmp/Au2OqFkb24'
3+shin-make: Entering directory '#PWD#'
4 w
5 w
6 shin-make: 'all' is up to date.
7-shin-make: Leaving directory '/tmp/Au2OqFkb24'
8+shin-make: Leaving directory '#PWD#'
+2, -2
1@@ -1,5 +1,5 @@
2-shin-make: Entering directory '/tmp/Au2OqFkb24'
3+shin-make: Entering directory '#PWD#'
4 w
5 w
6 shin-make: 'all' is up to date.
7-shin-make: Leaving directory '/tmp/Au2OqFkb24'
8+shin-make: Leaving directory '#PWD#'
+2, -2
1@@ -1,5 +1,5 @@
2-shin-make: Entering directory '/tmp/Au2OqFkb24'
3+shin-make: Entering directory '#PWD#'
4 w
5 w
6 shin-make: 'all' is up to date.
7-shin-make: Leaving directory '/tmp/Au2OqFkb24'
8+shin-make: Leaving directory '#PWD#'
+2, -2
1@@ -1,5 +1,5 @@
2-shin-make: Entering directory '/tmp/Au2OqFkb24'
3+shin-make: Entering directory '#PWD#'
4 w
5 w
6 shin-make: 'all' is up to date.
7-shin-make: Leaving directory '/tmp/Au2OqFkb24'
8+shin-make: Leaving directory '#PWD#'
+2, -2
1@@ -1,5 +1,5 @@
2-shin-make: Entering directory '/tmp/Au2OqFkb24'
3+shin-make: Entering directory '#PWD#'
4 w
5 w
6 shin-make: 'all' is up to date.
7-shin-make: Leaving directory '/tmp/Au2OqFkb24'
8+shin-make: Leaving directory '#PWD#'
+2, -2
1@@ -1,5 +1,5 @@
2-shin-make: Entering directory '/tmp/Au2OqFkb24'
3+shin-make: Entering directory '#PWD#'
4 w
5 w
6 shin-make: 'all' is up to date.
7-shin-make: Leaving directory '/tmp/Au2OqFkb24'
8+shin-make: Leaving directory '#PWD#'
+3, -3
1@@ -1,5 +1,5 @@
2-/tmp/shin-extract/tests/shin-make -C lib2
3-shin-make[1]: Entering directory '/tmp/Au2OqFkb24/lib2'
4+#MAKE# -C lib2
5+shin-make[1]: Entering directory '#PWD#/lib2'
6 
7 shin-make[1]: 'all' is up to date.
8-shin-make[1]: Leaving directory '/tmp/Au2OqFkb24/lib2'
9+shin-make[1]: Leaving directory '#PWD#/lib2'
+5, -5
 1@@ -1,9 +1,9 @@
 2-shin-make: Entering directory '/tmp/Au2OqFkb24'
 3+shin-make: Entering directory '#PWD#'
 4 w
 5 w
 6-/tmp/shin-extract/tests/shin-make -C lib2
 7-shin-make[1]: Entering directory '/tmp/Au2OqFkb24/lib2'
 8+#MAKE# -C lib2
 9+shin-make[1]: Entering directory '#PWD#/lib2'
10 w
11 shin-make[1]: 'all' is up to date.
12-shin-make[1]: Leaving directory '/tmp/Au2OqFkb24/lib2'
13-shin-make: Leaving directory '/tmp/Au2OqFkb24'
14+shin-make[1]: Leaving directory '#PWD#/lib2'
15+shin-make: Leaving directory '#PWD#'
+5, -5
 1@@ -1,9 +1,9 @@
 2-shin-make: Entering directory '/tmp/Au2OqFkb24'
 3+shin-make: Entering directory '#PWD#'
 4 w
 5 w
 6-/tmp/shin-extract/tests/shin-make -C lib2
 7-shin-make[1]: Entering directory '/tmp/Au2OqFkb24/lib2'
 8+#MAKE# -C lib2
 9+shin-make[1]: Entering directory '#PWD#/lib2'
10 w
11 shin-make[1]: 'all' is up to date.
12-shin-make[1]: Leaving directory '/tmp/Au2OqFkb24/lib2'
13-shin-make: Leaving directory '/tmp/Au2OqFkb24'
14+shin-make[1]: Leaving directory '#PWD#/lib2'
15+shin-make: Leaving directory '#PWD#'
+5, -5
 1@@ -1,9 +1,9 @@
 2-shin-make: Entering directory '/tmp/Au2OqFkb24'
 3+shin-make: Entering directory '#PWD#'
 4 w
 5 w
 6-/tmp/shin-extract/tests/shin-make -C lib2
 7-shin-make[1]: Entering directory '/tmp/Au2OqFkb24/lib2'
 8+#MAKE# -C lib2
 9+shin-make[1]: Entering directory '#PWD#/lib2'
10 w
11 shin-make[1]: 'all' is up to date.
12-shin-make[1]: Leaving directory '/tmp/Au2OqFkb24/lib2'
13-shin-make: Leaving directory '/tmp/Au2OqFkb24'
14+shin-make[1]: Leaving directory '#PWD#/lib2'
15+shin-make: Leaving directory '#PWD#'
+5, -5
 1@@ -1,9 +1,9 @@
 2-shin-make: Entering directory '/tmp/Au2OqFkb24'
 3+shin-make: Entering directory '#PWD#'
 4 w
 5 w
 6-/tmp/shin-extract/tests/shin-make -C lib2
 7-shin-make[1]: Entering directory '/tmp/Au2OqFkb24/lib2'
 8+#MAKE# -C lib2
 9+shin-make[1]: Entering directory '#PWD#/lib2'
10 w
11 shin-make[1]: 'all' is up to date.
12-shin-make[1]: Leaving directory '/tmp/Au2OqFkb24/lib2'
13-shin-make: Leaving directory '/tmp/Au2OqFkb24'
14+shin-make[1]: Leaving directory '#PWD#/lib2'
15+shin-make: Leaving directory '#PWD#'
+5, -5
 1@@ -1,9 +1,9 @@
 2-shin-make: Entering directory '/tmp/Au2OqFkb24'
 3+shin-make: Entering directory '#PWD#'
 4 w
 5 w
 6-/tmp/shin-extract/tests/shin-make -C lib2
 7-shin-make[1]: Entering directory '/tmp/Au2OqFkb24/lib2'
 8+#MAKE# -C lib2
 9+shin-make[1]: Entering directory '#PWD#/lib2'
10 w
11 shin-make[1]: 'all' is up to date.
12-shin-make[1]: Leaving directory '/tmp/Au2OqFkb24/lib2'
13-shin-make: Leaving directory '/tmp/Au2OqFkb24'
14+shin-make[1]: Leaving directory '#PWD#/lib2'
15+shin-make: Leaving directory '#PWD#'
+5, -5
 1@@ -1,9 +1,9 @@
 2-shin-make: Entering directory '/tmp/Au2OqFkb24'
 3+shin-make: Entering directory '#PWD#'
 4 w
 5 w
 6-/tmp/shin-extract/tests/shin-make -C lib2
 7-shin-make[1]: Entering directory '/tmp/Au2OqFkb24/lib2'
 8+#MAKE# -C lib2
 9+shin-make[1]: Entering directory '#PWD#/lib2'
10 w
11 shin-make[1]: 'all' is up to date.
12-shin-make[1]: Leaving directory '/tmp/Au2OqFkb24/lib2'
13-shin-make: Leaving directory '/tmp/Au2OqFkb24'
14+shin-make[1]: Leaving directory '#PWD#/lib2'
15+shin-make: Leaving directory '#PWD#'
+5, -5
 1@@ -1,9 +1,9 @@
 2-shin-make: Entering directory '/tmp/Au2OqFkb24'
 3+shin-make: Entering directory '#PWD#'
 4 w
 5 w
 6-/tmp/shin-extract/tests/shin-make -C lib2
 7-shin-make[1]: Entering directory '/tmp/Au2OqFkb24/lib2'
 8+#MAKE# -C lib2
 9+shin-make[1]: Entering directory '#PWD#/lib2'
10 w
11 shin-make[1]: 'all' is up to date.
12-shin-make[1]: Leaving directory '/tmp/Au2OqFkb24/lib2'
13-shin-make: Leaving directory '/tmp/Au2OqFkb24'
14+shin-make[1]: Leaving directory '#PWD#/lib2'
15+shin-make: Leaving directory '#PWD#'
+5, -5
 1@@ -1,9 +1,9 @@
 2-shin-make: Entering directory '/tmp/Au2OqFkb24'
 3+shin-make: Entering directory '#PWD#'
 4 w
 5 w
 6-/tmp/shin-extract/tests/shin-make -C lib2
 7-shin-make[1]: Entering directory '/tmp/Au2OqFkb24/lib2'
 8+#MAKE# -C lib2
 9+shin-make[1]: Entering directory '#PWD#/lib2'
10 w
11 shin-make[1]: 'all' is up to date.
12-shin-make[1]: Leaving directory '/tmp/Au2OqFkb24/lib2'
13-shin-make: Leaving directory '/tmp/Au2OqFkb24'
14+shin-make[1]: Leaving directory '#PWD#/lib2'
15+shin-make: Leaving directory '#PWD#'
+2, -2
 1@@ -2,7 +2,7 @@ MAKE_RESTARTS=
 2 MAKE_RESTARTS=1
 3 MAKE_RESTARTS=2
 4 recurse MAKE_RESTARTS=
 5-shin-make[1]: Entering directory '/tmp/0nPByD_iSK'
 6+shin-make[1]: Entering directory '#PWD#'
 7 MAKE_RESTARTS=
 8 all MAKE_RESTARTS=
 9-shin-make[1]: Leaving directory '/tmp/0nPByD_iSK'
10+shin-make[1]: Leaving directory '#PWD#'
+5, -4
 1@@ -79,7 +79,7 @@ func runcase(cfg suiteconfig, tc testcase) caseresult {
 2 	}
 3 
 4 	result.ExitMatched = exitstatus == tc.Meta.ExpectedExit
 5-	result.OutputMatched = compareoutput(tc, workdir, env, string(logdata))
 6+	result.OutputMatched = compareoutput(tc, cfg.makepath, workdir, env, string(logdata))
 7 	result.ExtraTmp = extratmp
 8 	result.Passed = result.ExitMatched && result.OutputMatched && !result.ExtraTmp
 9 
10@@ -414,12 +414,12 @@ func leftovertempfiles(tmproot string) (bool, string, error) {
11 // also strips clock skew issues, normalizes newlines, and optionally applies regex
12 // matching for some cases using that (the gnu suite, mostly in makeflags and some
13 // options tests).
14-func compareoutput(tc testcase, workdir string, env []string, actual string) bool {
15+func compareoutput(tc testcase, makepath, workdir string, env []string, actual string) bool {
16 	if !tc.Meta.CompareOutput || tc.Meta.OutputMode == "ignore" {
17 		return true
18 	}
19 
20-	expected := expandexpectedoutput(tc.ExpectedOut, workdir, envpath(env))
21+	expected := expandexpectedoutput(tc.ExpectedOut, makepath, workdir, envpath(env))
22 	filteredactual := stripskewlines(actual)
23 	if filteredactual == expected {
24 		return true
25@@ -447,7 +447,8 @@ func compareoutput(tc testcase, workdir string, env []string, actual string) boo
26 	return re.MatchString(actual) || re.MatchString(normalizedactual)
27 }
28 
29-func expandexpectedoutput(expected, workdir, path string) string {
30+func expandexpectedoutput(expected, makepath, workdir, path string) string {
31+	expected = strings.ReplaceAll(expected, "#MAKE#", filepath.ToSlash(makepath))
32 	expected = strings.ReplaceAll(expected, "#PWD#", filepath.ToSlash(workdir))
33 	expected = strings.ReplaceAll(expected, "#PATH#", path)
34 	return expected