diff --git a/.gitignore b/.gitignore index 7b5c200..5f8b7e8 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,5 @@ tags .*.swp *.dep tmpl.* +tests/*/itest.cc +tests/*/itest.h diff --git a/Makefile b/Makefile index aa4d88f..6a659a0 100644 --- a/Makefile +++ b/Makefile @@ -46,7 +46,15 @@ tmpl.h: tmpl.cc grep '$*_' $^ | sed -e 's/^/extern /' -e 's/ =.*/;/' >> $@ echo '#endif' >> $@ -clean: +.PHONY: tests +tests: PATH := $(shell pwd):$(PATH) +tests: all + $(MAKE) -C $@ + +tests-clean: + $(MAKE) -C tests clean + +clean: tests-clean -rm -f $(TARGET) *.o .*.dep tmpl.cc tmpl.h -include $(CXXDEPS) diff --git a/tests/Makefile b/tests/Makefile new file mode 100644 index 0000000..decd03a --- /dev/null +++ b/tests/Makefile @@ -0,0 +1,14 @@ + +all: + for d in *; do \ + if [ -d $$d ]; then \ + make -C $$d; \ + fi; \ + done + +clean: + for d in *; do \ + if [ -d $$d ]; then \ + make -C $$d clean; \ + fi; \ + done diff --git a/tests/build/Makefile b/tests/build/Makefile new file mode 100644 index 0000000..078fd11 --- /dev/null +++ b/tests/build/Makefile @@ -0,0 +1,14 @@ + +TARGET := test +I_SOURCE := itest +CXXFLAGS := -O2 +LDFLAGS := -lpcre + +all: $(TARGET) + +$(TARGET): + imbecile $(I_SOURCE).I + $(CXX) -o $@ *.cc $(LDFLAGS) + +clean: + -rm -f $(TARGET) *.o $(I_SOURCE).cc $(I_SOURCE).h diff --git a/tests/build/build_test.I b/tests/build/itest.I similarity index 100% rename from tests/build/build_test.I rename to tests/build/itest.I