Skip to content

Commit

Permalink
Merge #33: Productionize testing + add CI
Browse files Browse the repository at this point in the history
84b87d5 Add Cirrus CI (Pieter Wuille)
de1ea97 Report configuration in ./configure (Pieter Wuille)
37f2a41 Rename test_exhaust to test (Pieter Wuille)
0499d6b Improve randomized tests (Pieter Wuille)
6a82ae2 Improve exhaustive tests (Pieter Wuille)
a92954f Make test complexity configurable on cmdline (Pieter Wuille)
4c01bf7 Clean up test code a bit (Pieter Wuille)
a430875 Remove exhaustive test analysis output (Pieter Wuille)
c5b22c6 Simplify exhaustive test (Pieter Wuille)
1564917 Rename count -> capacity in tests (Pieter Wuille)
7657fd4 Remove multi-threadedness of test-exhaust (Pieter Wuille)
7adad14 Bugfix: RecFindRoots sanity check fails on 32-bit (Pieter Wuille)
fbdadf8 Bugfix: construct 64-bit clmul field when requested (Pieter Wuille)

Pull request description:

  Various improvements to testing:
  * Add Cirrus CI
  * exercise the C++ wrapper interface
  * operate on all field implementations simultaneously, and compare the results
  * make tests not run forever (but controlled by command-line complexity argument)
  * make tests single threaded
  * generic improvements to the tests
  * rename the test binary from `test-exhaust` to `test`
  * drop analysis/debug output

  Also fix two bugs discovered while writing these improvements:
  * when requesting a clmul 64-bit field, a sketch for 63 bits was returned.
  * an internal sanity check in the root finding function could fail incorrectly on 32-bit platforms

ACKs for top commit:
  gmaxwell:
    ACK 84b87d5
  jonatack:
    ACK 84b87d5 per `git range-diff 7408bde 707aaad 84b87d5`, only skimmed the CI changes

Tree-SHA512: 8ce00d504c9b3265492b4efb9fa3f4ccf1a727e20e8ab30a1593fe9a74793a966cead41fd31435c8b739d3923bbc03c88d5c79b3dac88d7920503ed55f0aca75
  • Loading branch information
sipa committed Apr 26, 2021
2 parents 7408bde + 84b87d5 commit 901bbd3
Show file tree
Hide file tree
Showing 11 changed files with 518 additions and 751 deletions.
129 changes: 129 additions & 0 deletions .cirrus.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
env:
BUILD: check
HOST:
MAKEFLAGS: -j4
BENCH: yes
TESTRUNS:
EXEC_CMD:

cat_logs_snippet: &CAT_LOGS
on_failure:
cat_config_log_script:
- cat config.log || true
cat_test_env_script:
- cat test_env.log || true
cat_ci_env_script:
- env

merge_base_script_snippet: &MERGE_BASE
merge_base_script:
- if [ "$CIRRUS_PR" = "" ]; then exit 0; fi
- git fetch $CIRRUS_REPO_CLONE_URL $CIRRUS_BASE_BRANCH
- git config --global user.email "[email protected]"
- git config --global user.name "ci"
- git merge FETCH_HEAD # Merge base to detect silent merge conflicts

task:
name: "x86_64: Linux (Debian stable)"
container:
dockerfile: ci/linux-debian.Dockerfile
memory: 2G
cpu: 4
matrix: &ENV_MATRIX
- env:
- env:
BUILD: distcheck
- env:
CFLAGS: "-fsanitize=undefined -fno-omit-frame-pointer"
LDFLAGS: "-fsanitize=undefined -fno-omit-frame-pointer"
UBSAN_OPTIONS: "print_stacktrace=1:halt_on_error=1"
BENCH: no
- env:
EXEC_CMD: valgrind --error-exitcode=42
TESTRUNS: 1
BUILD:
matrix:
- env:
CC: gcc
- env:
CC: clang
<< : *MERGE_BASE
test_script:
- ./ci/cirrus.sh
<< : *CAT_LOGS

task:
name: "i686: Linux (Debian stable)"
container:
dockerfile: ci/linux-debian.Dockerfile
memory: 2G
cpu: 4
env:
HOST: i686-linux-gnu
matrix:
- env:
CC: i686-linux-gnu-gcc
- env:
CC: clang --target=i686-pc-linux-gnu -isystem /usr/i686-linux-gnu/include
test_script:
- ./ci/cirrus.sh
<< : *CAT_LOGS

task:
name: "x86_64: macOS Catalina"
macos_instance:
image: catalina-base
env:
# Cirrus gives us a fixed number of 12 virtual CPUs.
MAKEFLAGS: -j13
matrix:
- env: {}
- env: {BUILD: distcheck}
- env:
CFLAGS: "-fsanitize=undefined -fno-omit-frame-pointer"
LDFLAGS: "-fsanitize=undefined -fno-omit-frame-pointer"
UBSAN_OPTIONS: "print_stacktrace=1:halt_on_error=1"
matrix:
- env:
CC: gcc-9
- env:
CC: clang
brew_script:
- brew install automake libtool gcc@9
<< : *MERGE_BASE
test_script:
- ./ci/cirrus.sh
<< : *CAT_LOGS

task:
name: "s390x (big-endian): Linux (Debian stable, QEMU)"
container:
dockerfile: ci/linux-debian.Dockerfile
cpu: 4
memory: 2G
env:
EXEC_CMD: qemu-s390x -L /usr/s390x-linux-gnu
HOST: s390x-linux-gnu
BUILD:
<< : *MERGE_BASE
test_script:
# https://sourceware.org/bugzilla/show_bug.cgi?id=27008
- rm /etc/ld.so.cache
- ./ci/cirrus.sh
<< : *CAT_LOGS

task:
name: "x86_64-w64-mingw32: Linux (Debian stable, Wine)"
container:
dockerfile: ci/linux-debian.Dockerfile
cpu: 4
memory: 2G
env:
EXEC_CMD: wine
HOST: x86_64-w64-mingw32
CXXFLAGS: -O2 -static -static-libgcc -static-libstdc++
BUILD:
<< : *MERGE_BASE
test_script:
- ./ci/cirrus.sh
<< : *CAT_LOGS
26 changes: 13 additions & 13 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -58,26 +58,26 @@ if USE_BENCHMARK
noinst_PROGRAMS += bench
endif
if USE_TESTS
noinst_PROGRAMS += test-exhaust test-exhaust-verify
TESTS = test-exhaust test-exhaust-verify
noinst_PROGRAMS += test test-verify
TESTS = test test-verify
endif

bench_SOURCES = $(MINISKETCH_BENCH_SOURCES_INT)
bench_CPPFLAGS = $(AM_CPPFLAGS) $(RELEASE_DEFINES)
bench_LDADD = $(LIBMINISKETCH)
bench_LDFLAGS = $(AM_LDFLAGS) -static

test_exhaust_SOURCES = $(MINISKETCH_TEST_SOURCES_INT)
test_exhaust_CPPFLAGS = $(AM_CPPFLAGS) $(RELEASE_DEFINES)
test_exhaust_CXXFLAGS = $(AM_CXXFLAGS) $(PTHREAD_CFLAGS)
test_exhaust_LDADD = $(LIBMINISKETCH)
test_exhaust_LDFLAGS = $(AM_LDFLAGS) $(PTHREAD_CFLAGS) -static

test_exhaust_verify_SOURCES = $(MINISKETCH_TEST_SOURCES_INT)
test_exhaust_verify_CPPFLAGS = $(AM_CPPFLAGS) $(VERIFY_DEFINES)
test_exhaust_verify_CXXFLAGS = $(AM_CXXFLAGS) $(PTHREAD_CFLAGS)
test_exhaust_verify_LDADD = $(LIBMINISKETCH_VERIFY)
test_exhaust_verify_LDFLAGS = $(AM_LDFLAGS) $(PTHREAD_CFLAGS) -static
test_SOURCES = $(MINISKETCH_TEST_SOURCES_INT)
test_CPPFLAGS = $(AM_CPPFLAGS) $(RELEASE_DEFINES)
test_CXXFLAGS = $(AM_CXXFLAGS)
test_LDADD = $(LIBMINISKETCH)
test_LDFLAGS = $(AM_LDFLAGS) -static

test_verify_SOURCES = $(MINISKETCH_TEST_SOURCES_INT)
test_verify_CPPFLAGS = $(AM_CPPFLAGS) $(VERIFY_DEFINES)
test_verify_CXXFLAGS = $(AM_CXXFLAGS)
test_verify_LDADD = $(LIBMINISKETCH_VERIFY)
test_verify_LDFLAGS = $(AM_LDFLAGS) -static

EXTRA_DIST=
EXTRA_DIST += LICENSE
Expand Down
Loading

0 comments on commit 901bbd3

Please sign in to comment.