shithub: mc

Download patch

ref: a44d4b5e4d8e265df68194dadc0fa8410a77e7f8
parent: c90b97b335a792b54d2f33523623a56b29297d84
author: Ori Bernstein <[email protected]>
date: Mon Apr 20 15:48:16 EDT 2015

Add '.' to start of search path when running tests.

    We always want to prioritize the current directory and pick
    up the most recently built packages in it when testing.

--- a/mbld/test.myr
+++ b/mbld/test.myr
@@ -37,14 +37,9 @@
 	for tn in b.all
 		match gettarg(b.targs, tn)
 		| `Test t:
-			for s in t.incpath
-				if std.sleq(".", s)
-					goto founddot
-				;;
+			if t.incpath.len == 0 || !std.sleq(t.incpath[0], ".")
+				t.incpath = std.slput(t.incpath, 0, std.sldup("."))
 			;;
-			t.incpath = std.slpush(t.incpath, std.sldup("."))
-
-:founddot
 			buildbin(b, t, false)
 			bin = std.strcat("./", t.name)
 			if !runtest(bin)