Add handling of reduced test cases (traverse lines trimmed), and add all the test...
[ccan] / ccan / tdb / tools / Makefile
index 49e13732cf950f5bdd49c9d77f1398aa4f021371..d52b9f376f708d3baf6e88b5343c0a4119d77517 100644 (file)
@@ -10,5 +10,20 @@ replay_trace: replay_trace.c keywords.c
 keywords.c: keywords.gperf
        gperf $< > $@
 
+check: replay_trace
+       @rm -f *.reduced_trace
+       @set -e; for f in tests/*.trace.tar.bz2; do             \
+               tar xvfj $$f;                                   \
+               ./replay_trace replay.tdb *.reduced_trace;      \
+               rm -f *.reduced_trace;                          \
+       done
+
+# Usage: make mytest.trace.tar.bz2 TRACEFILES=*.trace
+%.trace.tar.bz2: $(patsubst %.trace,%.reduced_trace,$(wildcard $(TRACEFILES)))
+       tar cvfj $@ $^
+
+%.reduced_trace: %.trace
+       @sed 's/\(^[0-9]* traverse\) .*/\1fn/' < $^ > $@
+
 clean:
        rm -f replay_trace tdbtorture tdbdump *.o