Skip to content

Commit

Permalink
Fix dependencies in sharness test makefile
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
torarnv committed Apr 7, 2015
1 parent d36a9ee commit 7b49419
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions test/sharness/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,21 @@ IPFS_ROOT = ../..
# User might want to override those on the command line
GOFLAGS =

all: clean deps $(T) aggregate
all: aggregate

clean:
clean: clean-test-results
@echo "*** $@ ***"
-rm -rf test-results
-rm -rf bin/ipfs

$(T):
clean-test-results:
@echo "*** $@ ***"
-rm -rf test-results

$(T): clean-test-results deps
@echo "*** $@ ***"
./$@

aggregate:
aggregate: clean-test-results $(T)
@echo "*** $@ ***"
lib/test-aggregate-results.sh

Expand Down

0 comments on commit 7b49419

Please sign in to comment.