summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--Makefile8
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
diff --git a/Makefile b/Makefile
index c1044cde1..e65ddb380 100644
--- a/Makefile
+++ b/Makefile
@@ -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