1
0
mirror of https://github.com/facebook/zstd.git synced 2025-08-07 06:23:00 +03:00

[CircleCI] Fix short-tests-0

short-tests-0 were silently failing. I think because of the && make clean construction. Switch to ; instead.

Also fix all the test failures that were exposed.

`make all` is failing on CircleCI because it is missing Docker. Move that test
to GitHub actions, and switch the pedantic CircleCI test to `make allmost`.
This commit is contained in:
Nick Terrell
2021-12-01 11:49:58 -08:00
parent e34e58b458
commit 91f5891dd0
7 changed files with 31 additions and 29 deletions

View File

@@ -15,12 +15,13 @@ jobs:
name: Test name: Test
command: | command: |
./tests/test-license.py ./tests/test-license.py
cc -v; CFLAGS="-O0 -Werror -pedantic" make all && make clean cc -v
make c99build && make clean CFLAGS="-O0 -Werror -pedantic" make allmost; make clean
make c11build && make clean make c99build; make clean
make -j regressiontest&& make clean make c11build; make clean
make shortest && make clean make -j regressiontest; make clean
make cxxtest && make clean make shortest; make clean
make cxxtest; make clean
# the second half of the jobs are in this test # the second half of the jobs are in this test
short-tests-1: short-tests-1:
docker: docker:

View File

@@ -10,6 +10,13 @@ on:
branches: [ dev, release, actionsTest ] branches: [ dev, release, actionsTest ]
jobs: jobs:
make-all:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: make all
run: make all
# lasts ~24mn # lasts ~24mn
make-test: make-test:
runs-on: ubuntu-latest runs-on: ubuntu-latest

View File

@@ -57,7 +57,7 @@ typedef enum {
* Check the zstd error code and die if an error occurred after printing a * Check the zstd error code and die if an error occurred after printing a
* message. * message.
*/ */
#define CHECK_ZSTD(fn, ...) \ #define CHECK_ZSTD(fn) \
do { \ do { \
size_t const err = (fn); \ size_t const err = (fn); \
CHECK(!ZSTD_isError(err), "%s", ZSTD_getErrorName(err)); \ CHECK(!ZSTD_isError(err), "%s", ZSTD_getErrorName(err)); \

View File

@@ -258,7 +258,10 @@
# elif ZSTD_HAS_CPP_ATTRIBUTE(fallthrough) # elif ZSTD_HAS_CPP_ATTRIBUTE(fallthrough)
# define ZSTD_FALLTHROUGH [[fallthrough]] # define ZSTD_FALLTHROUGH [[fallthrough]]
# elif __has_attribute(__fallthrough__) # elif __has_attribute(__fallthrough__)
# define ZSTD_FALLTHROUGH __attribute__((__fallthrough__)) /* Leading semicolon is to satisfy gcc-11 with -pedantic. Without the semicolon
* gcc complains about: a label can only be part of a statement and a declaration is not a statement.
*/
# define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
# else # else
# define ZSTD_FALLTHROUGH # define ZSTD_FALLTHROUGH
# endif # endif

View File

@@ -1333,7 +1333,7 @@ typedef struct {
searchMax_f searchMax; searchMax_f searchMax;
} ZSTD_LazyVTable; } ZSTD_LazyVTable;
#define GEN_ZSTD_BT_VTABLE(dictMode, mls, ...) \ #define GEN_ZSTD_BT_VTABLE(dictMode, mls) \
static size_t ZSTD_BtFindBestMatch_##dictMode##_##mls( \ static size_t ZSTD_BtFindBestMatch_##dictMode##_##mls( \
ZSTD_matchState_t* ms, \ ZSTD_matchState_t* ms, \
const BYTE* ip, const BYTE* const iLimit, \ const BYTE* ip, const BYTE* const iLimit, \
@@ -1346,7 +1346,7 @@ typedef struct {
ZSTD_BtFindBestMatch_##dictMode##_##mls \ ZSTD_BtFindBestMatch_##dictMode##_##mls \
}; };
#define GEN_ZSTD_HC_VTABLE(dictMode, mls, ...) \ #define GEN_ZSTD_HC_VTABLE(dictMode, mls) \
static size_t ZSTD_HcFindBestMatch_##dictMode##_##mls( \ static size_t ZSTD_HcFindBestMatch_##dictMode##_##mls( \
ZSTD_matchState_t* ms, \ ZSTD_matchState_t* ms, \
const BYTE* ip, const BYTE* const iLimit, \ const BYTE* ip, const BYTE* const iLimit, \

View File

@@ -62,15 +62,6 @@
#define vard2 r10d #define vard2 r10d
#define vard3 r11d #define vard3 r11d
/* Helper macro: args if idx != 4. */
#define IF_NOT_4_0(...) __VA_ARGS__
#define IF_NOT_4_1(...) __VA_ARGS__
#define IF_NOT_4_2(...) __VA_ARGS__
#define IF_NOT_4_3(...) __VA_ARGS__
#define IF_NOT_4_4(...)
#define IF_NOT_4_(idx, ...) IF_NOT_4_##idx(__VA_ARGS__)
#define IF_NOT_4(idx, ...) IF_NOT_4_(idx, __VA_ARGS__)
/* Calls X(N) for each stream 0, 1, 2, 3. */ /* Calls X(N) for each stream 0, 1, 2, 3. */
#define FOR_EACH_STREAM(X) \ #define FOR_EACH_STREAM(X) \
X(0); \ X(0); \
@@ -211,11 +202,11 @@ HUF_decompress4X1_usingDTable_internal_bmi2_asm_loop:
movb %ah, idx(%op##n) movb %ah, idx(%op##n)
/* Assumes GET_NEXT_DELT has been called. /* Assumes GET_NEXT_DELT has been called.
* Calls DECODE_FROM_DELT then GET_NEXT_DELT if n < 4 * Calls DECODE_FROM_DELT then GET_NEXT_DELT
*/ */
#define DECODE(n, idx) \ #define DECODE_AND_GET_NEXT(n, idx) \
DECODE_FROM_DELT(n, idx); \ DECODE_FROM_DELT(n, idx); \
IF_NOT_4(idx, GET_NEXT_DELT(n)) GET_NEXT_DELT(n) \
/* // ctz & nbBytes is stored in bits[n] /* // ctz & nbBytes is stored in bits[n]
* // nbBits is stored in %rax * // nbBits is stored in %rax
@@ -254,11 +245,11 @@ HUF_decompress4X1_usingDTable_internal_bmi2_asm_loop:
/* Decode 5 symbols in each of the 4 streams (20 total) /* Decode 5 symbols in each of the 4 streams (20 total)
* Must have called GET_NEXT_DELT for each stream * Must have called GET_NEXT_DELT for each stream
*/ */
FOR_EACH_STREAM_WITH_INDEX(DECODE, 0) FOR_EACH_STREAM_WITH_INDEX(DECODE_AND_GET_NEXT, 0)
FOR_EACH_STREAM_WITH_INDEX(DECODE, 1) FOR_EACH_STREAM_WITH_INDEX(DECODE_AND_GET_NEXT, 1)
FOR_EACH_STREAM_WITH_INDEX(DECODE, 2) FOR_EACH_STREAM_WITH_INDEX(DECODE_AND_GET_NEXT, 2)
FOR_EACH_STREAM_WITH_INDEX(DECODE, 3) FOR_EACH_STREAM_WITH_INDEX(DECODE_AND_GET_NEXT, 3)
FOR_EACH_STREAM_WITH_INDEX(DECODE, 4) FOR_EACH_STREAM_WITH_INDEX(DECODE_FROM_DELT, 4)
/* Load ip[1,2,3] from stack (var[] aliases them) /* Load ip[1,2,3] from stack (var[] aliases them)
* ip[] is needed for RELOAD_BITS * ip[] is needed for RELOAD_BITS

View File

@@ -1855,7 +1855,7 @@ static int fuzzerTests(U32 seed, unsigned nbTests, unsigned startTest, double co
&& oldTestLog /* at least one test happened */ && resetAllowed) { && oldTestLog /* at least one test happened */ && resetAllowed) {
maxTestSize = FUZ_randomLength(&lseed, oldTestLog+2); maxTestSize = FUZ_randomLength(&lseed, oldTestLog+2);
maxTestSize = MIN(maxTestSize, srcBufferSize-16); maxTestSize = MIN(maxTestSize, srcBufferSize-16);
{ U64 const pledgedSrcSize = (FUZ_rand(&lseed) & 3) ? ZSTD_CONTENTSIZE_UNKNOWN : maxTestSize; { U64 const pledgedSrcSize = (FUZ_rand(&lseed) & 3) ? ZSTD_CONTENTSIZE_UNKNOWN : maxTestSize;
CHECK_Z( ZSTD_CCtx_reset(zc, ZSTD_reset_session_only) ); CHECK_Z( ZSTD_CCtx_reset(zc, ZSTD_reset_session_only) );
CHECK_Z( ZSTD_CCtx_setPledgedSrcSize(zc, pledgedSrcSize) ); CHECK_Z( ZSTD_CCtx_setPledgedSrcSize(zc, pledgedSrcSize) );
} }
@@ -2357,7 +2357,7 @@ static int fuzzerTests_newAPI(U32 seed, int nbTests, int startTest,
/* multi - fragments decompression test */ /* multi - fragments decompression test */
if (!dictSize /* don't reset if dictionary : could be different */ && (FUZ_rand(&lseed) & 1)) { if (!dictSize /* don't reset if dictionary : could be different */ && (FUZ_rand(&lseed) & 1)) {
DISPLAYLEVEL(5, "resetting DCtx (dict:%p) \n", dict); DISPLAYLEVEL(5, "resetting DCtx (dict:%p) \n", (void const*)dict);
CHECK_Z( ZSTD_resetDStream(zd) ); CHECK_Z( ZSTD_resetDStream(zd) );
} else { } else {
if (dictSize) if (dictSize)