From: Yann Collet Date: Fri, 4 Dec 2015 16:45:35 +0000 (+0100) Subject: use time limited fuzzer tests in CI X-Git-Tag: v0.4.3^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1c2ddba469211965de6a26bb277e8141f2dd5410;p=thirdparty%2Fzstd.git use time limited fuzzer tests in CI --- diff --git a/programs/Makefile b/programs/Makefile index 15b4e05c7..c2a1ca267 100644 --- a/programs/Makefile +++ b/programs/Makefile @@ -65,6 +65,7 @@ VOID = /dev/null endif ZBUFFTEST = -T2mn +FUZZERTEST= -T5mn .PHONY: default all clean install uninstall test test32 test-all @@ -258,10 +259,10 @@ test-fullbench32: fullbench32 datagen ./fullbench32 -i1 -P0 test-fuzzer: fuzzer - ./fuzzer + ./fuzzer $(FUZZERTEST) test-fuzzer32: fuzzer32 - ./fuzzer32 + ./fuzzer32 $(FUZZERTEST) test-zbuff: zbufftest ./zbufftest $(ZBUFFTEST) diff --git a/programs/fuzzer.c b/programs/fuzzer.c index d108ff976..0079eebb9 100644 --- a/programs/fuzzer.c +++ b/programs/fuzzer.c @@ -306,9 +306,10 @@ int fuzzerTests(U32 seed, U32 nbTests, unsigned startTest, double compressibilit BYTE* sampleBuffer; /* init */ - DISPLAYUPDATE(2, "\r%6u", testNb); - if (nbTests >= testNb) DISPLAYUPDATE(2, "\r/%6u", nbTests); - DISPLAYUPDATE(2, " "); + if (nbTests >= testNb) + { DISPLAYUPDATE(2, "\r%6u/%6u ", testNb, nbTests); } + else { DISPLAYUPDATE(2, "\r%6u ", testNb); } + FUZ_rand(&coreSeed); lseed = coreSeed ^ prime1; buffNb = FUZ_rand(&lseed) & 127; @@ -471,7 +472,7 @@ int fuzzerTests(U32 seed, U32 nbTests, unsigned startTest, double compressibilit cSize += errorCode; crcOrig = XXH64_digest(&crc64); } - DISPLAY("\r%u fuzzer tests completed \n", testNb); + DISPLAY("\r%u fuzzer tests completed \n", testNb-1); _cleanup: ZSTD_freeCCtx(ctx); @@ -629,8 +630,6 @@ int main(int argc, char** argv) DISPLAY("Seed = %u\n", seed); if (proba!=FUZ_COMPRESSIBILITY_DEFAULT) DISPLAY("Compressibility : %i%%\n", proba); - if (nbTests<=0) nbTests=1; - if (testNb==0) result = basicUnitTests(0, ((double)proba) / 100); /* constant seed for predictability */ if (!result) result = fuzzerTests(seed, nbTests, testNb, ((double)proba) / 100);