aboutsummaryrefslogtreecommitdiffstats
path: root/test/compression/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'test/compression/Makefile')
-rw-r--r--test/compression/Makefile19
1 files changed, 12 insertions, 7 deletions
diff --git a/test/compression/Makefile b/test/compression/Makefile
index 2e14e646..ff7032d5 100644
--- a/test/compression/Makefile
+++ b/test/compression/Makefile
@@ -1,9 +1,11 @@
include ../../Makefile.config
+SIMU=timeout --signal=SIGKILL 20s $(EXECUTE)
+
CC=../../ccomp
CFLAGS=$(CCOMPOPTS) -U__GNUC__ -stdlib ../../runtime -dclight -dasm
LIBS=
-TIME=xtime -o /dev/null -mintime 1.0
+TIME=ocaml unix.cma ../../tools/xtime.ml -mintime 2.0 -minruns 2
EXE=arcode lzw lzss
@@ -30,15 +32,19 @@ TESTFILE:=$(firstword $(wildcard /usr/share/dict/words) ./lzss)
TESTCOMPR=/tmp/testcompr.$$$$
TESTEXPND=/tmp/testexpnd.$$$$
+LIGHTERFILEPRE:=/tmp/lighter
+LIGHTERFILE:=$(LIGHTERFILEPRE)aa
+
test:
- @rm -f $(TESTCOMPR) $(TESTEXPND); \
- echo "Test data: $(TESTFILE)"; \
+ @split -l15 $(TESTFILE) $(LIGHTERFILEPRE); \
+ rm -f $(TESTCOMPR) $(TESTEXPND); \
+ echo "Test data: $(LIGHTERFILE)"; \
for i in $(EXE); do \
echo "$$i: compression..."; \
- $(SIMU) ./$$i -c -i $(TESTFILE) -o $(TESTCOMPR); \
+ $(SIMU) ./$$i -c -i $(LIGHTERFILE) -o $(TESTCOMPR); \
echo "$$i: decompression..."; \
$(SIMU) ./$$i -d -i $(TESTCOMPR) -o $(TESTEXPND); \
- if cmp $(TESTFILE) $(TESTEXPND); \
+ if cmp $(LIGHTERFILE) $(TESTEXPND); \
then echo "$$i: passed"; \
else echo "$$i: FAILED"; exit 2; \
fi; \
@@ -48,8 +54,7 @@ test:
bench:
@rm -f $(TESTCOMPR)
@for i in $(EXE); do \
- echo -n "$$i: "; \
- $(TIME) sh -c "./$$i -c -i $(TESTFILE) -o $(TESTCOMPR) && ./$$i -d -i $(TESTCOMPR) -o /dev/null"; \
+ $(TIME) -name $$i -- sh -c "./$$i -c -i $(TESTFILE) -o $(TESTCOMPR) && ./$$i -d -i $(TESTCOMPR) -o /dev/null"; \
done
@rm -f $(TESTCOMPR)