@cryptotaxi247 / kubo / commits / 7b49419d9

Fix dependencies in sharness test makefile

Running make -jN would result in the tests starting to execute before the tests binaries were built, resulting in the error: "Cannot find the tests' local ipfs tool" Each test now depends on the deps. They also depend on a new target for cleaning the test results, so that the tests can write new clean results. The aggregate target also needs to depend on the same test results clean target, as well as the tests themselves, so that the aggregation happens when all tests have finished running. By introducing a separate target for cleaning test results we also ensure that we don't end up removing and rebuilding the binary on each test run. The result is that the tests *can* be run with with -jN > 1, but individual tests may still not supports this, so to get stable test results it's still recommended to run them in sequence.

Tor Arne Vestbø committed Apr 7, 2015 at 19:43 UTC 7b49419d9361c5a7893baf18745ed2bdbdb6604a
1 file changed +8 -5
test/sharness/Makefile
+8 -5
@@ -14,18 +14,21 @@ IPFS_ROOT = ../..
14 # User might want to override those on the command line
15 GOFLAGS =
16
17 -all: clean deps $(T) aggregate
17 +all: aggregate
18
19 -clean:
19 +clean: clean-test-results
20 @echo "*** $@ ***"
21 - -rm -rf test-results
21 -rm -rf bin/ipfs
22
24 -$(T):
23 +clean-test-results:
24 + @echo "*** $@ ***"
25 + -rm -rf test-results
26 +
27 +$(T): clean-test-results deps
28 @echo "*** $@ ***"
29 ./$@
30
28 -aggregate:
31 +aggregate: clean-test-results $(T)
32 @echo "*** $@ ***"
33 lib/test-aggregate-results.sh
34