From 2a3f4b2378c14865bc2f6ad76f21ae6444c833c8 Mon Sep 17 00:00:00 2001 From: Cyril SIX Date: Fri, 13 Sep 2019 16:11:03 +0200 Subject: Scaling down compression tests --- test/compression/Makefile | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'test/compression/Makefile') diff --git a/test/compression/Makefile b/test/compression/Makefile index 2e14e646..48521b14 100644 --- a/test/compression/Makefile +++ b/test/compression/Makefile @@ -1,5 +1,7 @@ include ../../Makefile.config +SIMU=timeout --signal=SIGKILL 20s $(EXECUTE) + CC=../../ccomp CFLAGS=$(CCOMPOPTS) -U__GNUC__ -stdlib ../../runtime -dclight -dasm LIBS= @@ -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; \ @@ -49,7 +55,7 @@ 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) sh -c "./$$i -c -i $(LIGHTERFILE) -o $(TESTCOMPR) && ./$$i -d -i $(TESTCOMPR) -o /dev/null"; \ done @rm -f $(TESTCOMPR) -- cgit From db96b0e2b156cfa527493f5890cd805f8aa4543a Mon Sep 17 00:00:00 2001 From: Xavier Leroy Date: Sun, 25 Aug 2019 19:22:03 +0200 Subject: Revise the "bench" entries of the test suite Initially, the "bench" entries of the test suite used a "xtime" utility developed in-house and not publically available. This commit adds a version of "xtime" written in OCaml (tools/xtime.ml) and updates the "bench" entries of the test/*/Makefile to use it. --- test/compression/Makefile | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'test/compression/Makefile') diff --git a/test/compression/Makefile b/test/compression/Makefile index 2e14e646..e8f3cf4d 100644 --- a/test/compression/Makefile +++ b/test/compression/Makefile @@ -3,7 +3,7 @@ include ../../Makefile.config 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 @@ -48,8 +48,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) -- cgit