Skip to content

Commit

Permalink
v2.3.3: merging fix/247.
Browse files Browse the repository at this point in the history
Fixes #247.
  • Loading branch information
Snaipe committed Nov 5, 2018
2 parents 514b4d8 + 7d23251 commit a64b860
Show file tree
Hide file tree
Showing 22 changed files with 104 additions and 80 deletions.
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 2.3.2
current_version = 2.3.3
commit = False
parse = ^
(?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+) # minimum 'N.N.N'
Expand Down
2 changes: 1 addition & 1 deletion .cmake/Modules/Properties.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Redistribution and use of this file is allowed according to the terms of the MIT license.
# For details see the LICENSE file distributed with Criterion.

set (PROJECT_VERSION "2.3.2")
set (PROJECT_VERSION "2.3.3")
set (PROJECT_SOVERSION 3)
set (PROJECT_SONAME 3.1.0)

Expand Down
2 changes: 1 addition & 1 deletion .cmake/copy-source.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ add_to_sources() {
add_to_sources https://github.com/Snaipe/libcsptr dependencies/libcsptr 0d52904
add_to_sources https://github.com/Snaipe/dyncall dependencies/dyncall 51e79a8
add_to_sources https://github.com/nanomsg/nanomsg dependencies/nanomsg 7e12a20
add_to_sources https://github.com/diacritic/BoxFort dependencies/boxfort 7ed0cf2
add_to_sources https://github.com/diacritic/BoxFort dependencies/boxfort 926bd4c
)
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ cr_add_subproject (nanomsg
)

cr_add_subproject (boxfort PATH dependencies/boxfort
GIT "https://github.com/diacritic/BoxFort.git#7ed0cf2"
GIT "https://github.com/diacritic/BoxFort.git#926bd4c"
PATH dependencies/boxfort
OPTS
-DBXF_TESTS=OFF
Expand Down
10 changes: 10 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
2018-11-05 Franklin "Snaipe" Mathieu <[email protected]>

* criterion: version 2.3.3
* Fix: Clang 5.0.x was producing test executables that caused Criterion to
fork-bomb the host system. The issue has been fixed, and Criterion
now pro-actively aborts itself if it detects a fork-bomb loop to avoid
similar issues in the future.

The full git changelog may be accessed with `git log v2.3.2..v2.3.3`.

2017-04-08 Franklin "Snaipe" Mathieu <[email protected]>

* criterion: version 2.3.2
Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: 2.3.2_b{build}-{branch}
version: 2.3.3_b{build}-{branch}

os: Visual Studio 2015

Expand Down
3 changes: 2 additions & 1 deletion doc/conf.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
import sys
import os
import re

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
Expand Down Expand Up @@ -54,7 +55,7 @@
# built documents.
#
# The full version, including alpha/beta/rc tags.
release = '2.3.2'
release = '2.3.3'
# The short X.Y version.
version = re.search(r'\d+\.\d+', release).group(0)

Expand Down
13 changes: 13 additions & 0 deletions src/core/runner.c
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,13 @@ void disable_unmatching(struct criterion_test_set *set)

CR_API struct criterion_test_set *criterion_initialize(void)
{
/* make sure we don't re-enter from a test worker. See #247. */
if (getenv("BXFI_MAP")) {
cr_panic("Re-entering criterion from a test worker. This is a "
"catastrophic bug, please report it on the issue tracker.\n"
"Bailing out to avoid fork-bombing the system.");
}

init_i18n();

#ifndef ENABLE_VALGRIND_ERRORS
Expand Down Expand Up @@ -357,6 +364,12 @@ static int criterion_run_all_tests_impl(struct criterion_test_set *set)

CR_API int criterion_run_all_tests(struct criterion_test_set *set)
{
/* make sure we don't re-enter from a test worker. See #247. */
if (getenv("BXFI_MAP")) {
cr_panic("Re-entering criterion from a test worker. This is a "
"catastrophic bug, please report it on the issue tracker.\n"
"Bailing out to avoid fork-bombing the system.");
}
#ifndef ENABLE_VALGRIND_ERRORS
VALGRIND_DISABLE_ERROR_REPORTING;
#endif
Expand Down
2 changes: 1 addition & 1 deletion src/core/runner_coroutine.c
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ static bxf_instance *run_test(struct run_next_context *ctx,
if (rc < 0)
cr_panic("Could not initialize test context: %s", strerror(-rc));

struct bxf_spawn_params sp = {
struct bxf_spawn_params_s sp = {
.fn = run_test_child,
.callback = death_callback,
.inherit.context = inst_ctx,
Expand Down
12 changes: 6 additions & 6 deletions test/cram/core.t
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
Checking the version

$ simple.c.bin --version
Tests compiled with Criterion v2.3.2
Tests compiled with Criterion v2.3.3

$ simple.cc.bin --version
Tests compiled with Criterion v2.3.2
Tests compiled with Criterion v2.3.3

Running the simplest test

Expand All @@ -21,7 +21,7 @@ Running the simplest test
Running with verbose output

$ simple.c.bin --verbose
[\x1b[0;34m----\x1b[0m] Criterion v2.3.2 (esc)
[\x1b[0;34m----\x1b[0m] Criterion v2.3.3 (esc)
[\x1b[0;34m====\x1b[0m] Running \x1b[0;34m2\x1b[0m tests from \x1b[0;33mmisc\x1b[0m: (esc)
[\x1b[0;34mRUN \x1b[0m] misc::failing (esc)
[\x1b[0;34m----\x1b[0m] \x1b[0;1msimple.c\x1b[0m:\x1b[0;31m4\x1b[0m: Assertion failed: The expression 0 is false. (esc)
Expand All @@ -31,7 +31,7 @@ Running with verbose output
[\x1b[0;34m====\x1b[0m] \x1b[0;1mSynthesis: Tested: \x1b[0;34m2\x1b[0;1m | Passing: \x1b[0;32m1\x1b[0;1m | Failing: \x1b[0;31m1\x1b[0;1m | Crashing: \x1b[0m0\x1b[0;1m \x1b[0m (esc)

$ simple.cc.bin --verbose
[\x1b[0;34m----\x1b[0m] Criterion v2.3.2 (esc)
[\x1b[0;34m----\x1b[0m] Criterion v2.3.3 (esc)
[\x1b[0;34m====\x1b[0m] Running \x1b[0;34m2\x1b[0m tests from \x1b[0;33mmisc\x1b[0m: (esc)
[\x1b[0;34mRUN \x1b[0m] misc::failing (esc)
[\x1b[0;34m----\x1b[0m] \x1b[0;1msimple.cc\x1b[0m:\x1b[0;31m4\x1b[0m: Assertion failed: The expression 0 is false. (esc)
Expand Down Expand Up @@ -67,7 +67,7 @@ Testing the fixtures
Testing descriptions

$ description.c.bin --verbose
[\x1b[0;34m----\x1b[0m] Criterion v2.3.2 (esc)
[\x1b[0;34m----\x1b[0m] Criterion v2.3.3 (esc)
[\x1b[0;34m====\x1b[0m] Running \x1b[0;34m2\x1b[0m tests from \x1b[0;33mmisc\x1b[0m: (esc)
[\x1b[0;34mRUN \x1b[0m] misc::failing (esc)
[\x1b[0;34m----\x1b[0m] Just a failing test (esc)
Expand All @@ -78,7 +78,7 @@ Testing descriptions
[\x1b[0;34m====\x1b[0m] \x1b[0;1mSynthesis: Tested: \x1b[0;34m1\x1b[0;1m | Passing: \x1b[0;32m0\x1b[0;1m | Failing: \x1b[0;31m1\x1b[0;1m | Crashing: \x1b[0m0\x1b[0;1m \x1b[0m (esc)

$ description.cc.bin --verbose
[\x1b[0;34m----\x1b[0m] Criterion v2.3.2 (esc)
[\x1b[0;34m----\x1b[0m] Criterion v2.3.3 (esc)
[\x1b[0;34m====\x1b[0m] Running \x1b[0;34m2\x1b[0m tests from \x1b[0;33mmisc\x1b[0m: (esc)
[\x1b[0;34mRUN \x1b[0m] misc::failing (esc)
[\x1b[0;34m----\x1b[0m] Just a failing test (esc)
Expand Down
10 changes: 5 additions & 5 deletions test/cram/crashes.t
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Simple crashes & signal testing
Simple crashes & signal testing (verbose)

$ signal.c.bin --verbose
[\x1b[0;34m----\x1b[0m] Criterion v2.3.2 (esc)
[\x1b[0;34m----\x1b[0m] Criterion v2.3.3 (esc)
[\x1b[0;34m====\x1b[0m] Running \x1b[0;34m3\x1b[0m tests from \x1b[0;33msimple\x1b[0m: (esc)
[\x1b[0;34mRUN \x1b[0m] simple::caught (esc)
\[\\x1b\[0;32mPASS\\x1b\[0m\] simple::caught: \(\d\.\d\ds\) \(esc\) (re)
Expand All @@ -27,7 +27,7 @@ Simple crashes & signal testing (verbose)
[\x1b[0;34m====\x1b[0m] \x1b[0;1mSynthesis: Tested: \x1b[0;34m3\x1b[0;1m | Passing: \x1b[0;32m1\x1b[0;1m | Failing: \x1b[0;31m2\x1b[0;1m | Crashing: \x1b[0;31m1\x1b[0;1m \x1b[0m (esc)

$ signal.cc.bin --verbose
[\x1b[0;34m----\x1b[0m] Criterion v2.3.2 (esc)
[\x1b[0;34m----\x1b[0m] Criterion v2.3.3 (esc)
[\x1b[0;34m====\x1b[0m] Running \x1b[0;34m3\x1b[0m tests from \x1b[0;33msimple\x1b[0m: (esc)
[\x1b[0;34mRUN \x1b[0m] simple::caught (esc)
\[\\x1b\[0;32mPASS\\x1b\[0m\] simple::caught: \(\d\.\d\ds\) \(esc\) (re)
Expand All @@ -53,7 +53,7 @@ Crashes outside of the test
Crashes outside of the test (verbose)

$ other-crashes.c.bin --verbose
[\x1b[0;34m----\x1b[0m] Criterion v2.3.2 (esc)
[\x1b[0;34m----\x1b[0m] Criterion v2.3.3 (esc)
[\x1b[0;34m====\x1b[0m] Running \x1b[0;34m2\x1b[0m tests from \x1b[0;33mmisc\x1b[0m: (esc)
[\x1b[0;34mRUN \x1b[0m] misc::setup_crash (esc)
[\x1b[0;34m----\x1b[0m] \x1b[0;1mWarning! The test `misc::setup_crash` crashed during its setup or teardown.\x1b[0m (esc)
Expand All @@ -63,7 +63,7 @@ Crashes outside of the test (verbose)
[\x1b[0;34m====\x1b[0m] \x1b[0;1mSynthesis: Tested: \x1b[0;34m2\x1b[0;1m | Passing: \x1b[0;32m1\x1b[0;1m | Failing: \x1b[0;31m1\x1b[0;1m | Crashing: \x1b[0;31m1\x1b[0;1m \x1b[0m (esc)

$ other-crashes.cc.bin --verbose
[\x1b[0;34m----\x1b[0m] Criterion v2.3.2 (esc)
[\x1b[0;34m----\x1b[0m] Criterion v2.3.3 (esc)
[\x1b[0;34m====\x1b[0m] Running \x1b[0;34m2\x1b[0m tests from \x1b[0;33mmisc\x1b[0m: (esc)
[\x1b[0;34mRUN \x1b[0m] misc::setup_crash (esc)
[\x1b[0;34m----\x1b[0m] \x1b[0;1mWarning! The test `misc::setup_crash` crashed during its setup or teardown.\x1b[0m (esc)
Expand All @@ -90,7 +90,7 @@ C++ Exceptions should be handled
C++ Exceptions should be handled (verbose)

$ exception.cc.bin --verbose
[\x1b[0;34m----\x1b[0m] Criterion v2.3.2 (esc)
[\x1b[0;34m----\x1b[0m] Criterion v2.3.3 (esc)
[\x1b[0;34m====\x1b[0m] Running \x1b[0;34m6\x1b[0m tests from \x1b[0;33mexception\x1b[0m: (esc)
[\x1b[0;34mRUN \x1b[0m] exception::raise_any (esc)
[\x1b[0;34m----\x1b[0m] exception::raise_any: Caught some unexpected exception during the test execution. (esc)
Expand Down
4 changes: 2 additions & 2 deletions test/cram/exit.t
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Testing tests that call exit()

$ exit.c.bin --verbose
[\x1b[0;34m----\x1b[0m] Criterion v2.3.2 (esc)
[\x1b[0;34m----\x1b[0m] Criterion v2.3.3 (esc)
[\x1b[0;34m====\x1b[0m] Running \x1b[0;34m3\x1b[0m tests from \x1b[0;33mexit\x1b[0m: (esc)
[\x1b[0;34mRUN \x1b[0m] exit::expected_exit (esc)
\[\\x1b\[0;32mPASS\\x1b\[0m\] exit::expected_exit: \(\d\.\d\ds\) \(esc\) (re)
Expand All @@ -18,7 +18,7 @@ Testing tests that call exit()
[\x1b[0;34m====\x1b[0m] \x1b[0;1mSynthesis: Tested: \x1b[0;34m5\x1b[0;1m | Passing: \x1b[0;32m3\x1b[0;1m | Failing: \x1b[0;31m2\x1b[0;1m | Crashing: \x1b[0;31m1\x1b[0;1m \x1b[0m (esc)

$ exit.cc.bin --verbose
[\x1b[0;34m----\x1b[0m] Criterion v2.3.2 (esc)
[\x1b[0;34m----\x1b[0m] Criterion v2.3.3 (esc)
[\x1b[0;34m====\x1b[0m] Running \x1b[0;34m3\x1b[0m tests from \x1b[0;33mexit\x1b[0m: (esc)
[\x1b[0;34mRUN \x1b[0m] exit::expected_exit (esc)
\[\\x1b\[0;32mPASS\\x1b\[0m\] exit::expected_exit: \(\d\.\d\ds\) \(esc\) (re)
Expand Down
4 changes: 2 additions & 2 deletions test/cram/fail-fast.t
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Testing --fail-fast

$ simple.c.bin --fail-fast --verbose
[\x1b[0;34m----\x1b[0m] Criterion v2.3.2 (esc)
[\x1b[0;34m----\x1b[0m] Criterion v2.3.3 (esc)
[\x1b[0;34m====\x1b[0m] Running \x1b[0;34m2\x1b[0m tests from \x1b[0;33mmisc\x1b[0m: (esc)
[\x1b[0;34mRUN \x1b[0m] misc::failing (esc)
[\x1b[0;34m----\x1b[0m] \x1b[0;1msimple.c\x1b[0m:\x1b[0;31m4\x1b[0m: Assertion failed: The expression 0 is false. (esc)
Expand All @@ -12,7 +12,7 @@ Testing --fail-fast
Testing CRITERION_FAIL_FAST

$ CRITERION_FAIL_FAST=1 simple.c.bin --verbose
[\x1b[0;34m----\x1b[0m] Criterion v2.3.2 (esc)
[\x1b[0;34m----\x1b[0m] Criterion v2.3.3 (esc)
[\x1b[0;34m====\x1b[0m] Running \x1b[0;34m2\x1b[0m tests from \x1b[0;33mmisc\x1b[0m: (esc)
[\x1b[0;34mRUN \x1b[0m] misc::failing (esc)
[\x1b[0;34m----\x1b[0m] \x1b[0;1msimple.c\x1b[0m:\x1b[0;31m4\x1b[0m: Assertion failed: The expression 0 is false. (esc)
Expand Down
6 changes: 3 additions & 3 deletions test/cram/help.t
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Display the help message

$ simple.c.bin --help
Tests compiled with Criterion v2.3.2
Tests compiled with Criterion v2.3.3

usage: .*simple\.c\.bin(\.exe)? OPTIONS (re)
options:
Expand All @@ -26,7 +26,7 @@ Display the help message
-OP:F or --output=PROVIDER=FILE: write test report to FILE using the specified provider
$ simple.cc.bin --help
Tests compiled with Criterion v2.3.2
Tests compiled with Criterion v2.3.3
usage: .*simple\.cc\.bin(\.exe)? OPTIONS (re)
options:
Expand Down Expand Up @@ -55,7 +55,7 @@ Display usage on invalid CLI flags

$ simple.c.bin --an-invalid-option
.*simple\.c\.bin(\.exe)?: (unknown|unrecognized) option [`'"]?-- ?an-invalid-option['"]? (re)
Tests compiled with Criterion v2.3.2
Tests compiled with Criterion v2.3.3
usage: .*simple\.c\.bin(\.exe)? OPTIONS (re)
options:
Expand Down
18 changes: 9 additions & 9 deletions test/cram/json.t
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Testing multiple samples with --json

$ simple.c.bin --json
{
"id": "Criterion v2.3.2",
"id": "Criterion v2.3.3",
"passed": 1,
"failed": 1,
"errored": 0,
Expand Down Expand Up @@ -35,7 +35,7 @@ Testing multiple samples with --json

$ signal.c.bin --json
{
"id": "Criterion v2.3.2",
"id": "Criterion v2.3.3",
"passed": 1,
"failed": 2,
"errored": 1,
Expand Down Expand Up @@ -74,7 +74,7 @@ Testing multiple samples with --json

$ asserts.c.bin --json
{
"id": "Criterion v2.3.2",
"id": "Criterion v2.3.3",
"passed": 5,
"failed": 2,
"errored": 0,
Expand Down Expand Up @@ -137,7 +137,7 @@ Testing multiple samples with --json

$ more-suites.c.bin --json
{
"id": "Criterion v2.3.2",
"id": "Criterion v2.3.3",
"passed": 2,
"failed": 0,
"errored": 0,
Expand Down Expand Up @@ -191,7 +191,7 @@ Testing multiple samples with --json

$ long-messages.c.bin --json
{
"id": "Criterion v2.3.2",
"id": "Criterion v2.3.3",
"passed": 0,
"failed": 1,
"errored": 0,
Expand Down Expand Up @@ -222,7 +222,7 @@ Testing multiple samples with --json

$ description.c.bin --json
{
"id": "Criterion v2.3.2",
"id": "Criterion v2.3.3",
"passed": 0,
"failed": 1,
"errored": 0,
Expand Down Expand Up @@ -258,7 +258,7 @@ Testing --output=json

$ simple.c.bin --output=json:-
{
"id": "Criterion v2.3.2",
"id": "Criterion v2.3.3",
"passed": 1,
"failed": 1,
"errored": 0,
Expand Down Expand Up @@ -293,7 +293,7 @@ Testing CRITERION_OUTPUTS

$ CRITERION_OUTPUTS=json:- simple.c.bin
{
"id": "Criterion v2.3.2",
"id": "Criterion v2.3.3",
"passed": 1,
"failed": 1,
"errored": 0,
Expand Down Expand Up @@ -326,7 +326,7 @@ Testing CRITERION_OUTPUTS

$ skip.c.bin --json
{
"id": "Criterion v2.3.2",
"id": "Criterion v2.3.3",
"passed": 0,
"failed": 0,
"errored": 0,
Expand Down
4 changes: 2 additions & 2 deletions test/cram/log.t
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Testing log messages

$ log.c.bin --verbose
[\x1b[0;34m----\x1b[0m] Criterion v2.3.2 (esc)
[\x1b[0;34m----\x1b[0m] Criterion v2.3.3 (esc)
[\x1b[0;34m====\x1b[0m] Running \x1b[0;34m2\x1b[0m tests from \x1b[0;33mlogging\x1b[0m: (esc)
[\x1b[0;34mRUN \x1b[0m] logging::format (esc)
[\x1b[0;34m----\x1b[0m] Log messages are printf-formatted strings. (esc)
Expand All @@ -14,7 +14,7 @@ Testing log messages
[\x1b[0;34m====\x1b[0m] \x1b[0;1mSynthesis: Tested: \x1b[0;34m2\x1b[0;1m | Passing: \x1b[0;32m2\x1b[0;1m | Failing: \x1b[0m0\x1b[0;1m | Crashing: \x1b[0m0\x1b[0;1m \x1b[0m (esc)

$ log.cc.bin --verbose
[\x1b[0;34m----\x1b[0m] Criterion v2.3.2 (esc)
[\x1b[0;34m----\x1b[0m] Criterion v2.3.3 (esc)
[\x1b[0;34m====\x1b[0m] Running \x1b[0;34m1\x1b[0m test from \x1b[0;33mlogging\x1b[0m: (esc)
[\x1b[0;34mRUN \x1b[0m] logging::stream (esc)
[\x1b[0;34m----\x1b[0m] This is an informational message. They are not displayed by default. (esc)
Expand Down
4 changes: 2 additions & 2 deletions test/cram/parameterized.t
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Using parameterized tests
Using parameterized tests (verbose)

$ parameterized.c.bin --verbose
[\x1b[0;34m----\x1b[0m] Criterion v2.3.2 (esc)
[\x1b[0;34m----\x1b[0m] Criterion v2.3.3 (esc)
[\x1b[0;34m====\x1b[0m] Running \x1b[0;34m3\x1b[0m tests from \x1b[0;33mparams\x1b[0m: (esc)
[\x1b[0;34mRUN \x1b[0m] params::cleanup (esc)
[\x1b[0;34m----\x1b[0m] \x1b[0;1mparameterized.c\x1b[0m:\x1b[0;31m78\x1b[0m: Assertion failed: Parameters: (1, 2.000000) (esc)
Expand Down Expand Up @@ -77,7 +77,7 @@ Using parameterized tests (verbose)
[\x1b[0;34m====\x1b[0m] \x1b[0;1mSynthesis: Tested: \x1b[0;34m9\x1b[0;1m | Passing: \x1b[0;32m0\x1b[0;1m | Failing: \x1b[0;31m9\x1b[0;1m | Crashing: \x1b[0m0\x1b[0;1m \x1b[0m (esc)

$ parameterized.cc.bin --verbose
[\x1b[0;34m----\x1b[0m] Criterion v2.3.2 (esc)
[\x1b[0;34m----\x1b[0m] Criterion v2.3.3 (esc)
[\x1b[0;34m====\x1b[0m] Running \x1b[0;34m3\x1b[0m tests from \x1b[0;33mparams\x1b[0m: (esc)
[\x1b[0;34mRUN \x1b[0m] params::cleanup (esc)
[\x1b[0;34m----\x1b[0m] \x1b[0;1mparameterized.cc\x1b[0m:\x1b[0;31m71\x1b[0m: Assertion failed: Parameters: (1, 2.000000) (esc)
Expand Down
Loading

0 comments on commit a64b860

Please sign in to comment.