diff options
author | Shawn O. Pearce <spearce@spearce.org> | 2008-12-18 08:17:05 -0800 |
---|---|---|
committer | Shawn O. Pearce <spearce@spearce.org> | 2008-12-18 08:17:05 -0800 |
commit | c18626eef6cbd1b420b85fc9f8a44d5031ad2fcd (patch) | |
tree | 3517bc697600fa61730369f35cd91da86e12d595 | |
parent | 7b6e8067ec96acef9a4184b43210d583b6d2f99a (diff) | |
download | libgit2-c18626eef6cbd1b420b85fc9f8a44d5031ad2fcd.tar.gz |
Run tests in their own subdirectory
This way tests can run in parallel without stepping on each other's
temporary work files. If a test passes the directory is removed
completely; if a test fails only empty directories are removed.
This permits inspection of the failed test's left behind state.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | Makefile | 8 |
2 files changed, 8 insertions, 1 deletions
diff --git a/.gitignore b/.gitignore index 5213c6928..0269c3f82 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ /apidocs /src/git/config.h +/trash-*.exe *.o *.a *.exe @@ -28,6 +28,7 @@ clean: rm -f $(GIT_LIB) rm -f src/*.o rm -f tests/*.o tests/*.exe tests/*.toc + rm -rf trash-*.exe rm -f src/git/config.h rm -rf apidocs @@ -81,7 +82,12 @@ $(TEST_EXE): tests/%.exe: tests/%.o tests/%_main.o $(T_LIB) -L. -lgit2 $(TEST_RUN): tests/%.run: tests/%.exe - @$< + @t=trash-$(<F) && \ + mkdir $$t && \ + if (cd $$t && ../$<); \ + then rm -rf $$t; \ + else rmdir $$t; exit 1; \ + fi .PHONY: all .PHONY: clean |