shortened Appveyor release tests
fuzzer supports time suffix `s` for "seconds"
This commit is contained in:
+1
-1
@@ -166,7 +166,7 @@
|
|||||||
make -C contrib\pzstd check &&
|
make -C contrib\pzstd check &&
|
||||||
make -C contrib\pzstd clean
|
make -C contrib\pzstd clean
|
||||||
)
|
)
|
||||||
- SET "FUZZERTEST=-T1mn"
|
- SET "FUZZERTEST=-T30s"
|
||||||
- if [%HOST%]==[visual] if [%CONFIGURATION%]==[Release] (
|
- if [%HOST%]==[visual] if [%CONFIGURATION%]==[Release] (
|
||||||
CD tests &&
|
CD tests &&
|
||||||
SET ZSTD=./zstd.exe &&
|
SET ZSTD=./zstd.exe &&
|
||||||
|
|||||||
+40
-41
@@ -1003,7 +1003,7 @@ _output_error:
|
|||||||
/*_*******************************************************
|
/*_*******************************************************
|
||||||
* Command line
|
* Command line
|
||||||
*********************************************************/
|
*********************************************************/
|
||||||
int FUZ_usage(const char* programName)
|
static int FUZ_usage(const char* programName)
|
||||||
{
|
{
|
||||||
DISPLAY( "Usage :\n");
|
DISPLAY( "Usage :\n");
|
||||||
DISPLAY( " %s [args]\n", programName);
|
DISPLAY( " %s [args]\n", programName);
|
||||||
@@ -1019,20 +1019,39 @@ int FUZ_usage(const char* programName)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*! readU32FromChar() :
|
||||||
|
@return : unsigned integer value read from input in `char` format
|
||||||
|
allows and interprets K, KB, KiB, M, MB and MiB suffix.
|
||||||
|
Will also modify `*stringPtr`, advancing it to position where it stopped reading.
|
||||||
|
Note : function result can overflow if digit string > MAX_UINT */
|
||||||
|
static unsigned readU32FromChar(const char** stringPtr)
|
||||||
|
{
|
||||||
|
unsigned result = 0;
|
||||||
|
while ((**stringPtr >='0') && (**stringPtr <='9'))
|
||||||
|
result *= 10, result += **stringPtr - '0', (*stringPtr)++ ;
|
||||||
|
if ((**stringPtr=='K') || (**stringPtr=='M')) {
|
||||||
|
result <<= 10;
|
||||||
|
if (**stringPtr=='M') result <<= 10;
|
||||||
|
(*stringPtr)++ ;
|
||||||
|
if (**stringPtr=='i') (*stringPtr)++;
|
||||||
|
if (**stringPtr=='B') (*stringPtr)++;
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
int main(int argc, const char** argv)
|
int main(int argc, const char** argv)
|
||||||
{
|
{
|
||||||
U32 seed=0;
|
U32 seed = 0;
|
||||||
int seedset=0;
|
int seedset = 0;
|
||||||
int argNb;
|
int argNb;
|
||||||
int nbTests = nbTestsDefault;
|
int nbTests = nbTestsDefault;
|
||||||
int testNb = 0;
|
int testNb = 0;
|
||||||
U32 proba = FUZ_compressibility_default;
|
U32 proba = FUZ_compressibility_default;
|
||||||
int result=0;
|
int result = 0;
|
||||||
U32 mainPause = 0;
|
U32 mainPause = 0;
|
||||||
U32 maxDuration = 0;
|
U32 maxDuration = 0;
|
||||||
int bigTests = 1;
|
int bigTests = 1;
|
||||||
const char* programName = argv[0];
|
const char* const programName = argv[0];
|
||||||
|
|
||||||
/* Check command line */
|
/* Check command line */
|
||||||
for (argNb=1; argNb<argc; argNb++) {
|
for (argNb=1; argNb<argc; argNb++) {
|
||||||
@@ -1050,75 +1069,55 @@ int main(int argc, const char** argv)
|
|||||||
{
|
{
|
||||||
case 'h':
|
case 'h':
|
||||||
return FUZ_usage(programName);
|
return FUZ_usage(programName);
|
||||||
|
|
||||||
case 'v':
|
case 'v':
|
||||||
argument++;
|
argument++;
|
||||||
g_displayLevel=4;
|
g_displayLevel = 4;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'q':
|
case 'q':
|
||||||
argument++;
|
argument++;
|
||||||
g_displayLevel--;
|
g_displayLevel--;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'p': /* pause at the end */
|
case 'p': /* pause at the end */
|
||||||
argument++;
|
argument++;
|
||||||
mainPause = 1;
|
mainPause = 1;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'i':
|
case 'i':
|
||||||
argument++; maxDuration=0;
|
argument++; maxDuration = 0;
|
||||||
nbTests=0;
|
nbTests = readU32FromChar(&argument);
|
||||||
while ((*argument>='0') && (*argument<='9')) {
|
|
||||||
nbTests *= 10;
|
|
||||||
nbTests += *argument - '0';
|
|
||||||
argument++;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'T':
|
case 'T':
|
||||||
argument++;
|
argument++;
|
||||||
nbTests=0; maxDuration=0;
|
nbTests = 0;
|
||||||
while ((*argument>='0') && (*argument<='9')) {
|
maxDuration = readU32FromChar(&argument);
|
||||||
maxDuration *= 10;
|
if (*argument=='s') argument++; /* seconds */
|
||||||
maxDuration += *argument - '0';
|
if (*argument=='m') maxDuration *= 60, argument++; /* minutes */
|
||||||
argument++;
|
|
||||||
}
|
|
||||||
if (*argument=='m') maxDuration *=60, argument++;
|
|
||||||
if (*argument=='n') argument++;
|
if (*argument=='n') argument++;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 's':
|
case 's':
|
||||||
argument++;
|
argument++;
|
||||||
seed=0;
|
seedset = 1;
|
||||||
seedset=1;
|
seed = readU32FromChar(&argument);
|
||||||
while ((*argument>='0') && (*argument<='9')) {
|
|
||||||
seed *= 10;
|
|
||||||
seed += *argument - '0';
|
|
||||||
argument++;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 't':
|
case 't':
|
||||||
argument++;
|
argument++;
|
||||||
testNb=0;
|
testNb = readU32FromChar(&argument);
|
||||||
while ((*argument>='0') && (*argument<='9')) {
|
|
||||||
testNb *= 10;
|
|
||||||
testNb += *argument - '0';
|
|
||||||
argument++;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'P': /* compressibility % */
|
case 'P': /* compressibility % */
|
||||||
argument++;
|
argument++;
|
||||||
proba=0;
|
proba = readU32FromChar(&argument);
|
||||||
while ((*argument>='0') && (*argument<='9')) {
|
if (proba>100) proba = 100;
|
||||||
proba *= 10;
|
|
||||||
proba += *argument - '0';
|
|
||||||
argument++;
|
|
||||||
}
|
|
||||||
if (proba>100) proba=100;
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return FUZ_usage(programName);
|
return (FUZ_usage(programName), 1);
|
||||||
} } } } /* for (argNb=1; argNb<argc; argNb++) */
|
} } } } /* for (argNb=1; argNb<argc; argNb++) */
|
||||||
|
|
||||||
/* Get Seed */
|
/* Get Seed */
|
||||||
|
|||||||
Reference in New Issue
Block a user