Merge branch 'master' into bleeding

This merges the changes brought by 2.2.1 into bleeding.
This commit is contained in:
Snaipe 2016-04-13 11:57:37 +02:00
commit 38653a6414
26 changed files with 216 additions and 134 deletions

View file

@ -1,8 +1,8 @@
[bumpversion]
current_version = 2.2.0
current_version = 2.2.1
commit = False
[bumpversion:file:CMakeLists.txt]
[bumpversion:file:.cmake/Modules/Properties.cmake]
[bumpversion:file:doc/conf.py]

View file

@ -110,7 +110,7 @@ if (GIT_FOUND)
# Branch.
execute_process(
COMMAND ${GIT_EXECUTABLE} rev-parse --abbrev-ref HEAD
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
OUTPUT_VARIABLE GIT_BRANCH
OUTPUT_STRIP_TRAILING_WHITESPACE
)
@ -118,7 +118,7 @@ if (GIT_FOUND)
macro (git_log_format FORMAT_CHARS VAR_NAME)
execute_process(
COMMAND ${GIT_EXECUTABLE} log -1 --pretty=format:%${FORMAT_CHARS}
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
OUTPUT_VARIABLE ${VAR_NAME}
OUTPUT_STRIP_TRAILING_WHITESPACE
)

View file

@ -15,9 +15,9 @@ set(CPACK_DEBIAN_PACKAGE_DEPENDS
)
set(CPACK_DEBIAN_CMAKE_OPTIONS)
set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_SOURCE_DIR}/description.txt")
set(CPACK_PACKAGE_DESCRIPTION_FILE "${PROJECT_SOURCE_DIR}/description.txt")
set(CPACK_DEBIAN_PACKAGE_SOURCE_COPY "${CMAKE_SOURCE_DIR}/.cmake/copy-source.sh")
set(CPACK_DEBIAN_PACKAGE_SOURCE_COPY "${PROJECT_SOURCE_DIR}/.cmake/copy-source.sh")
set(CPACK_DEBIAN_DISTRIBUTION_NAME ubuntu)
set(CPACK_DEBIAN_DISTRIBUTION_RELEASES precise trusty vivid wily xenial)

View file

@ -59,14 +59,14 @@ foreach(LINE ${DESC_LINES})
set(DEB_LONG_DESCRIPTION "${DEB_LONG_DESCRIPTION} ${LINE}\n")
endforeach(LINE ${DESC_LINES})
file(REMOVE_RECURSE "${CMAKE_BINARY_DIR}/Debian")
file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/Debian")
set(DEBIAN_SOURCE_ORIG_DIR "${CMAKE_BINARY_DIR}/Debian/${CPACK_DEBIAN_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}")
file(REMOVE_RECURSE "${PROJECT_BINARY_DIR}/Debian")
file(MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/Debian")
set(DEBIAN_SOURCE_ORIG_DIR "${PROJECT_BINARY_DIR}/Debian/${CPACK_DEBIAN_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}")
if( CPACK_DEBIAN_PACKAGE_SOURCE_COPY )
execute_process(COMMAND ${CPACK_DEBIAN_PACKAGE_SOURCE_COPY} "${CMAKE_SOURCE_DIR}" "${DEBIAN_SOURCE_ORIG_DIR}.orig")
execute_process(COMMAND ${CPACK_DEBIAN_PACKAGE_SOURCE_COPY} "${PROJECT_SOURCE_DIR}" "${DEBIAN_SOURCE_ORIG_DIR}.orig")
else()
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR} "${DEBIAN_SOURCE_ORIG_DIR}.orig")
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_directory ${PROJECT_SOURCE_DIR} "${DEBIAN_SOURCE_ORIG_DIR}.orig")
execute_process(COMMAND ${CMAKE_COMMAND} -E remove_directory "${DEBIAN_SOURCE_ORIG_DIR}.orig/.git")
execute_process(COMMAND ${CMAKE_COMMAND} -E remove_directory "${DEBIAN_SOURCE_ORIG_DIR}.orig/.svn")
endif()
@ -77,7 +77,7 @@ foreach(REMOVE_DIR ${CPACK_DEBIAN_PACKAGE_REMOVE_SOURCE_FILES})
endforeach()
# create the original source tar
execute_process(COMMAND ${CMAKE_COMMAND} -E tar czf "${CPACK_DEBIAN_PACKAGE_NAME}_${CPACK_PACKAGE_VERSION}.orig.tar.gz" "${CPACK_DEBIAN_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}.orig" WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/Debian)
execute_process(COMMAND ${CMAKE_COMMAND} -E tar czf "${CPACK_DEBIAN_PACKAGE_NAME}_${CPACK_PACKAGE_VERSION}.orig.tar.gz" "${CPACK_DEBIAN_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}.orig" WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/Debian)
set(DEB_SOURCE_CHANGES)
foreach(RELEASE ${CPACK_DEBIAN_DISTRIBUTION_RELEASES})
@ -344,4 +344,4 @@ endforeach(RELEASE ${CPACK_DEBIAN_DISTRIBUTION_RELEASES})
##############################################################################
# dput ppa:your-lp-id/ppa <source.changes>
add_custom_target(dput ${DPUT_EXECUTABLE} ${DPUT_HOST} ${DEB_SOURCE_CHANGES} DEPENDS ${DEB_SOURCE_CHANGES} WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/Debian)
add_custom_target(dput ${DPUT_EXECUTABLE} ${DPUT_HOST} ${DEB_SOURCE_CHANGES} DEPENDS ${DEB_SOURCE_CHANGES} WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/Debian)

View file

@ -45,7 +45,7 @@ if (WIN32)
endif ()
endif ()
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/debian.copyright")
set(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/debian.copyright")
extract_version(${PROJECT_VERSION}
CPACK_PACKAGE_VERSION_MAJOR
CPACK_PACKAGE_VERSION_MINOR
@ -55,21 +55,21 @@ extract_version(${PROJECT_VERSION}
set(CPACK_PACKAGE_VERSION ${PROJECT_VERSION})
file(GLOB TRASH_FILES "${CMAKE_SOURCE_DIR}/*")
file(GLOB TRASH_FILES "${PROJECT_SOURCE_DIR}/*")
set(KEEP_FILES
"${CMAKE_SOURCE_DIR}/.cmake"
"${CMAKE_SOURCE_DIR}/src"
"${CMAKE_SOURCE_DIR}/include"
"${CMAKE_SOURCE_DIR}/doc"
"${CMAKE_SOURCE_DIR}/dev"
"${CMAKE_SOURCE_DIR}/po"
"${CMAKE_SOURCE_DIR}/dependencies"
"${CMAKE_SOURCE_DIR}/CMakeLists.txt"
"${CMAKE_SOURCE_DIR}/README.md"
"${CMAKE_SOURCE_DIR}/CONTRIBUTING.md"
"${CMAKE_SOURCE_DIR}/LICENSE"
"${CMAKE_SOURCE_DIR}/ChangeLog"
"${CMAKE_SOURCE_DIR}/description.txt"
"${PROJECT_SOURCE_DIR}/.cmake"
"${PROJECT_SOURCE_DIR}/src"
"${PROJECT_SOURCE_DIR}/include"
"${PROJECT_SOURCE_DIR}/doc"
"${PROJECT_SOURCE_DIR}/dev"
"${PROJECT_SOURCE_DIR}/po"
"${PROJECT_SOURCE_DIR}/dependencies"
"${PROJECT_SOURCE_DIR}/CMakeLists.txt"
"${PROJECT_SOURCE_DIR}/README.md"
"${PROJECT_SOURCE_DIR}/CONTRIBUTING.md"
"${PROJECT_SOURCE_DIR}/LICENSE"
"${PROJECT_SOURCE_DIR}/ChangeLog"
"${PROJECT_SOURCE_DIR}/description.txt"
)
list(REMOVE_ITEM TRASH_FILES ${KEEP_FILES})
# Escape any '.' characters

View file

@ -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.2.0")
set (PROJECT_VERSION "2.2.1")
set (PROJECT_SOVERSION 3)
set (LOCALEDIR_REL "share/locale")
set (LOCALEDIR "${CMAKE_INSTALL_PREFIX}/${LOCALEDIR_REL}")

View file

@ -1,3 +1,14 @@
2016-02-06 Franklin "Snaipe" Mathieu <franklinmathieu@gmail.com>
* criterion: version 2.2.1
* Fix: fixed criterion not being embeddable with CMake's `add_directory`
* Fix: fixed resource leaks in the child pump thread
* Fix: fixed redirected standard streams being leaked by cr_(assert|expect)_std(out|err)
* Fix: fixed out of bounds during assert message sending
* Fix: fixed naming convention conflicts for internal variables used by the implementation of cr_assert
* Fix: fixed empty format string warning with GCC 4.8
* Fix: fixed file-to-file comparison assert message being corrupted
2015-12-08 Franklin "Snaipe" Mathieu <franklinmathieu@gmail.com>
* criterion: version 2.2.0

View file

@ -6,7 +6,7 @@
[![Windows Build Status](https://ci.appveyor.com/api/projects/status/github/Snaipe/Criterion?svg=true&branch=bleeding)](https://ci.appveyor.com/project/Snaipe/Criterion/branch/bleeding)
[![Coverage Status](https://img.shields.io/codecov/c/github/Snaipe/Criterion/bleeding.svg)](https://codecov.io/github/Snaipe/Criterion?branch=bleeding)
[![License](https://img.shields.io/badge/license-MIT-blue.svg?style=flat)](https://github.com/Snaipe/Criterion/blob/master/LICENSE)
[![Version](https://img.shields.io/badge/version-v2.2.0-blue.svg?style=flat)](https://github.com/Snaipe/Criterion/releases)
[![Version](https://img.shields.io/badge/version-v2.2.1-blue.svg?style=flat)](https://github.com/Snaipe/Criterion/releases)
A dead-simple, yet extensible, C and C++ unit testing framework.

View file

@ -1,4 +1,4 @@
version: 2.2.0_b{build}-{branch}
version: 2.2.1_b{build}-{branch}
os: Visual Studio 2015

View file

@ -54,7 +54,7 @@ copyright = u'2015-2016, Franklin "Snaipe" Mathieu'
# built documents.
#
# The short X.Y version.
version = '2.2.0'
version = '2.2.1'
# The full version, including alpha/beta/rc tags.
release = version

View file

@ -89,46 +89,42 @@ CR_END_C_API
"" CR_TRANSLATE_DEF_MSG__(CR_VA_HEAD(CR_VA_TAIL(__VA_ARGS__))) \
))
# define CR_INIT_STATS_(MsgVar, ...) CR_EXPAND( \
# define CR_INIT_STATS_(MsgVar, Shifted, ...) CR_EXPAND( \
do { \
char *def_msg = CR_EXPAND(CR_TRANSLATE_DEF_MSG_(__VA_ARGS__)); \
char *formatted_msg = NULL; \
cr_asprintf(&formatted_msg, "" CR_VA_TAIL(CR_VA_TAIL(__VA_ARGS__))); \
if (formatted_msg && *formatted_msg) { \
MsgVar = formatted_msg; \
CR_STDN free(def_msg); \
char *cr_def_msg__ = CR_EXPAND(CR_TRANSLATE_DEF_MSG_(__VA_ARGS__)); \
char *cr_fmt_msg__ = NULL; \
cr_asprintf(&cr_fmt_msg__, "x" CR_VA_TAIL(CR_VA_TAIL(__VA_ARGS__))); \
if (cr_fmt_msg__ && cr_fmt_msg__[1]) { \
MsgVar = cr_fmt_msg__ + 1; \
Shifted = 1; \
CR_STDN free(cr_def_msg__); \
} else { \
MsgVar = def_msg; \
CR_STDN free(formatted_msg); \
MsgVar = cr_def_msg__; \
CR_STDN free(cr_fmt_msg__); \
} \
} while (0))
# define CR_FAIL_ABORT_ criterion_abort_test
# define CR_FAIL_CONTINUES_ criterion_continue_test
# if defined(__GNUC__) || defined(__clang__)
// We disable the format-zero-length warning because we use the validity of
// asprintf(out, "") for empty assertion messages
# pragma GCC diagnostic ignored "-Wformat-zero-length"
# endif
# define cr_assert_impl(Fail, Condition, ...) \
do { \
bool passed = !!(Condition); \
bool cr_passed__ = !!(Condition); \
char *cr_msg__ = NULL; \
int cr_shifted__ = 0; \
\
char *msg = NULL; \
CR_EXPAND(CR_INIT_STATS_(cr_msg__, cr_shifted__, \
CR_VA_TAIL(__VA_ARGS__))); \
struct criterion_assert_stats cr_stat__; \
cr_stat__.passed = cr_passed__; \
cr_stat__.file = __FILE__; \
cr_stat__.line = __LINE__; \
cr_stat__.message = cr_msg__; \
criterion_send_assert(&cr_stat__); \
\
CR_EXPAND(CR_INIT_STATS_(msg, CR_VA_TAIL(__VA_ARGS__))); \
struct criterion_assert_stats stat; \
stat.passed = passed; \
stat.file = __FILE__; \
stat.line = __LINE__; \
stat.message = msg; \
criterion_send_assert(&stat); \
CR_STDN free(cr_msg__ - cr_shifted__); \
\
CR_STDN free(msg); \
\
if (!passed) \
if (!cr_passed__) \
Fail(); \
} while (0)

View file

@ -27,6 +27,15 @@
# include "common.h"
# include "assert.h"
CR_BEGIN_C_API
CR_API int cr_stdout_match_file(CR_STDN FILE* ref);
CR_API int cr_stdout_match_str(const char* ref);
CR_API int cr_stderr_match_file(CR_STDN FILE* ref);
CR_API int cr_stderr_match_str(const char* ref);
CR_END_C_API
# define cr_assert_redir_op_(Fail, Fun, Op, File, Str, ...) \
CR_EXPAND(cr_assert_impl( \
Fail, \
@ -58,7 +67,7 @@
))
# define cr_assert_redir_f_op_va_(Fail, Fun, Op, ...) \
CR_EXPAND(cr_assert_redir_op_( \
CR_EXPAND(cr_assert_redir_f_op_( \
Fail, \
Fun, \
Op, \
@ -83,37 +92,78 @@
# define cr_assert_file_contents_neq(...) CR_EXPAND(cr_assert_redir_f_op_va_(CR_FAIL_ABORT_, cr_file_match_file, !=, __VA_ARGS__))
# undef cr_expect_file_contents_neq
# define cr_expect_file_contents_neq(...) CR_EXPAND(cr_assert_redir_f_op_va_(CR_FAIL_CONTINUES_, cr_file_match_file, !=, __VA_ARGS__))
# undef cr_assert_stdout_eq_str
# define cr_assert_stdout_eq_str(...) CR_EXPAND(cr_assert_redir_op_va_(CR_FAIL_ABORT_, cr_file_match_str, ==, cr_get_redirected_stdout(), __VA_ARGS__))
# define cr_assert_stdout_eq_str(...) CR_EXPAND(cr_assert_redir_unop_va_(CR_FAIL_ABORT_, cr_stdout_match_str, ==, stdout, __VA_ARGS__))
# undef cr_expect_stdout_eq_str
# define cr_expect_stdout_eq_str(...) CR_EXPAND(cr_assert_redir_op_va_(CR_FAIL_CONTINUES_, cr_file_match_str, ==, cr_get_redirected_stdout(), __VA_ARGS__))
# define cr_expect_stdout_eq_str(...) CR_EXPAND(cr_assert_redir_unop_va_(CR_FAIL_CONTINUES_, cr_stdout_match_str, ==, stdout, __VA_ARGS__))
# undef cr_assert_stdout_neq_str
# define cr_assert_stdout_neq_str(...) CR_EXPAND(cr_assert_redir_op_va_(CR_FAIL_ABORT_, cr_file_match_str, !=, cr_get_redirected_stdout(), __VA_ARGS__))
# define cr_assert_stdout_neq_str(...) CR_EXPAND(cr_assert_redir_unop_va_(CR_FAIL_ABORT_, cr_stdout_match_str, !=, stdout, __VA_ARGS__))
# undef cr_expect_stdout_neq_str
# define cr_expect_stdout_neq_str(...) CR_EXPAND(cr_assert_redir_op_va_(CR_FAIL_CONTINUES_, cr_file_match_str, !=, cr_get_redirected_stdout(), __VA_ARGS__))
# define cr_expect_stdout_neq_str(...) CR_EXPAND(cr_assert_redir_unop_va_(CR_FAIL_CONTINUES_, cr_stdout_match_str, !=, stdout, __VA_ARGS__))
# undef cr_assert_stderr_eq_str
# define cr_assert_stderr_eq_str(...) CR_EXPAND(cr_assert_redir_op_va_(CR_FAIL_ABORT_, cr_file_match_str, ==, cr_get_redirected_stderr(), __VA_ARGS__))
# define cr_assert_stderr_eq_str(...) CR_EXPAND(cr_assert_redir_unop_va_(CR_FAIL_ABORT_, cr_stderr_match_str, ==, stderr, __VA_ARGS__))
# undef cr_expect_stderr_eq_str
# define cr_expect_stderr_eq_str(...) CR_EXPAND(cr_assert_redir_op_va_(CR_FAIL_CONTINUES_, cr_file_match_str, ==, cr_get_redirected_stderr(), __VA_ARGS__))
# define cr_expect_stderr_eq_str(...) CR_EXPAND(cr_assert_redir_unop_va_(CR_FAIL_CONTINUES_, cr_stderr_match_str, ==, stderr, __VA_ARGS__))
# undef cr_assert_stderr_neq_str
# define cr_assert_stderr_neq_str(...) CR_EXPAND(cr_assert_redir_op_va_(CR_FAIL_ABORT_, cr_file_match_str, !=, cr_get_redirected_stderr(), __VA_ARGS__))
# define cr_assert_stderr_neq_str(...) CR_EXPAND(cr_assert_redir_unop_va_(CR_FAIL_ABORT_, cr_stderr_match_str, !=, stderr, __VA_ARGS__))
# undef cr_expect_stderr_neq_str
# define cr_expect_stderr_neq_str(...) CR_EXPAND(cr_assert_redir_op_va_(CR_FAIL_CONTINUES_, cr_file_match_str, !=, cr_get_redirected_stderr(), __VA_ARGS__))
# define cr_expect_stderr_neq_str(...) CR_EXPAND(cr_assert_redir_unop_va_(CR_FAIL_CONTINUES_, cr_stderr_match_str, !=, stderr, __VA_ARGS__))
# undef cr_assert_stdout_eq
# define cr_assert_stdout_eq(...) CR_EXPAND(cr_assert_redir_f_op_va_(CR_FAIL_ABORT_, cr_file_match_file, ==, cr_get_redirected_stdout(), __VA_ARGS__))
# define cr_assert_stdout_eq(...) CR_EXPAND(cr_assert_redir_f_unop_va_(CR_FAIL_ABORT_, cr_stdout_match_file, ==, stdout, __VA_ARGS__))
# undef cr_expect_stdout_eq
# define cr_expect_stdout_eq(...) CR_EXPAND(cr_assert_redir_f_op_va_(CR_FAIL_CONTINUES_, cr_file_match_file, ==, cr_get_redirected_stdout(), __VA_ARGS__))
# define cr_expect_stdout_eq(...) CR_EXPAND(cr_assert_redir_f_unop_va_(CR_FAIL_CONTINUES_, cr_stdout_match_file, ==, stdout, __VA_ARGS__))
# undef cr_assert_stdout_neq
# define cr_assert_stdout_neq(...) CR_EXPAND(cr_assert_redir_f_op_va_(CR_FAIL_ABORT_, cr_file_match_file, !=, cr_get_redirected_stdout(), __VA_ARGS__))
# define cr_assert_stdout_neq(...) CR_EXPAND(cr_assert_redir_f_unop_va_(CR_FAIL_ABORT_, cr_stdout_match_file, !=, stdout, __VA_ARGS__))
# undef cr_expect_stdout_neq
# define cr_expect_stdout_neq(...) CR_EXPAND(cr_assert_redir_f_op_va_(CR_FAIL_CONTINUES_, cr_file_match_file, !=, cr_get_redirected_stdout(), __VA_ARGS__))
# define cr_expect_stdout_neq(...) CR_EXPAND(cr_assert_redir_f_unop_va_(CR_FAIL_CONTINUES_, cr_stdout_match_file, !=, stdout, __VA_ARGS__))
# undef cr_assert_stderr_eq
# define cr_assert_stderr_eq(...) CR_EXPAND(cr_assert_redir_f_op_va_(CR_FAIL_ABORT_, cr_file_match_file, ==, cr_get_redirected_stderr(), __VA_ARGS__))
# define cr_assert_stderr_eq(...) CR_EXPAND(cr_assert_redir_f_unop_va_(CR_FAIL_ABORT_, cr_stderr_match_file, ==, stderr, __VA_ARGS__))
# undef cr_expect_stderr_eq
# define cr_expect_stderr_eq(...) CR_EXPAND(cr_assert_redir_f_op_va_(CR_FAIL_CONTINUES_, cr_file_match_file, ==, cr_get_redirected_stderr(), __VA_ARGS__))
# define cr_expect_stderr_eq(...) CR_EXPAND(cr_assert_redir_f_unop_va_(CR_FAIL_CONTINUES_, cr_stderr_match_file, ==, stderr, __VA_ARGS__))
# undef cr_assert_stderr_neq
# define cr_assert_stderr_neq(...) CR_EXPAND(cr_assert_redir_f_op_va_(CR_FAIL_ABORT_, cr_file_match_file, !=, cr_get_redirected_stderr(), __VA_ARGS__))
# define cr_assert_stderr_neq(...) CR_EXPAND(cr_assert_redir_f_unop_va_(CR_FAIL_ABORT_, cr_stderr_match_file, !=, stderr, __VA_ARGS__))
# undef cr_expect_stderr_neq
# define cr_expect_stderr_neq(...) CR_EXPAND(cr_assert_redir_f_op_va_(CR_FAIL_CONTINUES_, cr_file_match_file, !=, cr_get_redirected_stderr(), __VA_ARGS__))
# define cr_expect_stderr_neq(...) CR_EXPAND(cr_assert_redir_f_unop_va_(CR_FAIL_CONTINUES_, cr_stderr_match_file, !=, stderr, __VA_ARGS__))
# define cr_assert_redir_unop_(Fail, Fun, Op, File, Str, ...) \
CR_EXPAND(cr_assert_impl( \
Fail, \
!(Fun((Str)) Op 0), \
dummy, \
CRITERION_ASSERT_MSG_FILE_STR_MATCH, \
(CR_STR(File), Str), \
__VA_ARGS__ \
))
# define cr_assert_redir_unop_va_(Fail, Fun, Op, ...) \
CR_EXPAND(cr_assert_redir_unop_( \
Fail, \
Fun, \
Op, \
CR_VA_HEAD(__VA_ARGS__), \
CR_VA_HEAD(CR_VA_TAIL(__VA_ARGS__)), \
CR_VA_TAIL(CR_VA_TAIL(__VA_ARGS__)) \
))
# define cr_assert_redir_f_unop_(Fail, Fun, Op, File, Ref, ...) \
CR_EXPAND(cr_assert_impl( \
Fail, \
!(Fun((Ref)) Op 0), \
dummy, \
CRITERION_ASSERT_MSG_FILE_MATCH, \
(CR_STR(File), CR_STR(Ref)), \
__VA_ARGS__ \
))
# define cr_assert_redir_f_unop_va_(Fail, Fun, Op, ...) \
CR_EXPAND(cr_assert_redir_f_unop_( \
Fail, \
Fun, \
Op, \
CR_VA_HEAD(__VA_ARGS__), \
CR_VA_HEAD(CR_VA_TAIL(__VA_ARGS__)), \
CR_VA_TAIL(CR_VA_TAIL(__VA_ARGS__)) \
))
#endif /* !CRITERION_INTERNAL_REDIRECT_H_ */

View file

@ -54,3 +54,31 @@ int cr_file_match_file(FILE* f, FILE* ref) {
return matches;
}
int cr_stdout_match_file(FILE* ref) {
FILE *f = cr_get_redirected_stdout();
int res = cr_file_match_file(f, ref);
fclose(f);
return res;
}
int cr_stdout_match_str(const char* ref) {
FILE *f = cr_get_redirected_stdout();
int res = cr_file_match_str(f, ref);
fclose(f);
return res;
}
int cr_stderr_match_file(FILE* ref) {
FILE *f = cr_get_redirected_stderr();
int res = cr_file_match_file(f, ref);
fclose(f);
return res;
}
int cr_stderr_match_str(const char* ref) {
FILE *f = cr_get_redirected_stderr();
int res = cr_file_match_str(f, ref);
fclose(f);
return res;
}

View file

@ -1,10 +1,10 @@
Checking the version
$ simple.c.bin --version
Tests compiled with Criterion v2.2.0
Tests compiled with Criterion v2.2.1
$ simple.cc.bin --version
Tests compiled with Criterion v2.2.0
Tests compiled with Criterion v2.2.1
Running the simplest test
@ -21,7 +21,7 @@ Running the simplest test
Running with verbose output
$ simple.c.bin --verbose
[\x1b[0;34m----\x1b[0m] Criterion v2.2.0 (esc)
[\x1b[0;34m----\x1b[0m] Criterion v2.2.1 (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)
@ -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[0;31m0\x1b[0;1m \x1b[0m (esc)
$ simple.cc.bin --verbose
[\x1b[0;34m----\x1b[0m] Criterion v2.2.0 (esc)
[\x1b[0;34m----\x1b[0m] Criterion v2.2.1 (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)
@ -67,7 +67,7 @@ Testing the fixtures
Testing descriptions
$ description.c.bin --verbose
[\x1b[0;34m----\x1b[0m] Criterion v2.2.0 (esc)
[\x1b[0;34m----\x1b[0m] Criterion v2.2.1 (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)
@ -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[0;31m0\x1b[0;1m \x1b[0m (esc)
$ description.cc.bin --verbose
[\x1b[0;34m----\x1b[0m] Criterion v2.2.0 (esc)
[\x1b[0;34m----\x1b[0m] Criterion v2.2.1 (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)

View file

@ -15,7 +15,7 @@ Simple crashes & signal testing
Simple crashes & signal testing (verbose)
$ signal.c.bin --verbose
[\x1b[0;34m----\x1b[0m] Criterion v2.2.0 (esc)
[\x1b[0;34m----\x1b[0m] Criterion v2.2.1 (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 (esc)
@ -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.2.0 (esc)
[\x1b[0;34m----\x1b[0m] Criterion v2.2.1 (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 (esc)
@ -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.2.0 (esc)
[\x1b[0;34m----\x1b[0m] Criterion v2.2.1 (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)
@ -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.2.0 (esc)
[\x1b[0;34m----\x1b[0m] Criterion v2.2.1 (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)
@ -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.2.0 (esc)
[\x1b[0;34m----\x1b[0m] Criterion v2.2.1 (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)

View file

@ -1,7 +1,7 @@
Testing tests that call exit()
$ exit.c.bin --verbose
[\x1b[0;34m----\x1b[0m] Criterion v2.2.0 (esc)
[\x1b[0;34m----\x1b[0m] Criterion v2.2.1 (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 (esc)
@ -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;31m2\x1b[0;1m \x1b[0m (esc)
$ exit.cc.bin --verbose
[\x1b[0;34m----\x1b[0m] Criterion v2.2.0 (esc)
[\x1b[0;34m----\x1b[0m] Criterion v2.2.1 (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 (esc)

View file

@ -1,7 +1,7 @@
Testing --fail-fast
$ simple.c.bin --fail-fast --verbose
[\x1b[0;34m----\x1b[0m] Criterion v2.2.0 (esc)
[\x1b[0;34m----\x1b[0m] Criterion v2.2.1 (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)
@ -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.2.0 (esc)
[\x1b[0;34m----\x1b[0m] Criterion v2.2.1 (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)

View file

@ -1,7 +1,7 @@
Display the help message
$ simple.c.bin --help
Tests compiled with Criterion v2.2.0
Tests compiled with Criterion v2.2.1
usage: .*simple\.c\.bin(\.exe)? OPTIONS (re)
options:
@ -22,7 +22,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.2.0
Tests compiled with Criterion v2.2.1
usage: .*simple\.cc\.bin(\.exe)? OPTIONS (re)
options:

View file

@ -2,7 +2,7 @@ Testing multiple samples with --json
$ simple.c.bin --json
{
"id": "Criterion v2.2.0",
"id": "Criterion v2.2.1",
"passed": 1,
"failed": 1,
"errored": 0,
@ -35,7 +35,7 @@ Testing multiple samples with --json
$ signal.c.bin --json
{
"id": "Criterion v2.2.0",
"id": "Criterion v2.2.1",
"passed": 1,
"failed": 2,
"errored": 1,
@ -74,7 +74,7 @@ Testing multiple samples with --json
$ asserts.c.bin --json
{
"id": "Criterion v2.2.0",
"id": "Criterion v2.2.1",
"passed": 4,
"failed": 2,
"errored": 0,
@ -132,7 +132,7 @@ Testing multiple samples with --json
$ more-suites.c.bin --json
{
"id": "Criterion v2.2.0",
"id": "Criterion v2.2.1",
"passed": 2,
"failed": 0,
"errored": 0,
@ -186,7 +186,7 @@ Testing multiple samples with --json
$ long-messages.c.bin --json
{
"id": "Criterion v2.2.0",
"id": "Criterion v2.2.1",
"passed": 0,
"failed": 1,
"errored": 0,
@ -217,7 +217,7 @@ Testing multiple samples with --json
$ description.c.bin --json
{
"id": "Criterion v2.2.0",
"id": "Criterion v2.2.1",
"passed": 0,
"failed": 1,
"errored": 0,
@ -253,7 +253,7 @@ Testing --output=json
$ simple.c.bin --output=json:-
{
"id": "Criterion v2.2.0",
"id": "Criterion v2.2.1",
"passed": 1,
"failed": 1,
"errored": 0,
@ -288,7 +288,7 @@ Testing CRITERION_OUTPUTS
$ CRITERION_OUTPUTS=json:- simple.c.bin
{
"id": "Criterion v2.2.0",
"id": "Criterion v2.2.1",
"passed": 1,
"failed": 1,
"errored": 0,

View file

@ -1,7 +1,7 @@
Testing log messages
$ log.c.bin --verbose
[\x1b[0;34m----\x1b[0m] Criterion v2.2.0 (esc)
[\x1b[0;34m----\x1b[0m] Criterion v2.2.1 (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)
@ -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[0;31m0\x1b[0;1m | Crashing: \x1b[0;31m0\x1b[0;1m \x1b[0m (esc)
$ log.cc.bin --verbose
[\x1b[0;34m----\x1b[0m] Criterion v2.2.0 (esc)
[\x1b[0;34m----\x1b[0m] Criterion v2.2.1 (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)

View file

@ -45,7 +45,7 @@ Using parameterized tests
Using parameterized tests (verbose)
$ parameterized.c.bin --verbose
[\x1b[0;34m----\x1b[0m] Criterion v2.2.0 (esc)
[\x1b[0;34m----\x1b[0m] Criterion v2.2.1 (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;31m76\x1b[0m: Assertion failed: Parameters: (1, 2.000000) (esc)
@ -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[0;31m0\x1b[0;1m \x1b[0m (esc)
$ parameterized.cc.bin --verbose
[\x1b[0;34m----\x1b[0m] Criterion v2.2.0 (esc)
[\x1b[0;34m----\x1b[0m] Criterion v2.2.1 (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;31m74\x1b[0m: Assertion failed: Parameters: (1, 2.000000) (esc)

View file

@ -7,7 +7,7 @@ Only run on linux
Selecting misc::passing
$ simple.c.bin --pattern '*/passing' --verbose
[\x1b[0;34m----\x1b[0m] Criterion v2.2.0 (esc)
[\x1b[0;34m----\x1b[0m] Criterion v2.2.1 (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::passing (esc)
[\x1b[0;32mPASS\x1b[0m] misc::passing (esc)
@ -17,7 +17,7 @@ Selecting misc::passing
Selecting misc::failing
$ simple.c.bin --pattern '!(*/passing)' --verbose
[\x1b[0;34m----\x1b[0m] Criterion v2.2.0 (esc)
[\x1b[0;34m----\x1b[0m] Criterion v2.2.1 (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)
@ -28,7 +28,7 @@ Selecting misc::failing
Selecting both misc::passing and misc::failing
$ simple.c.bin --pattern 'misc/[pf]a@(ss|il)ing' --verbose
[\x1b[0;34m----\x1b[0m] Criterion v2.2.0 (esc)
[\x1b[0;34m----\x1b[0m] Criterion v2.2.1 (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)
@ -40,7 +40,7 @@ Selecting both misc::passing and misc::failing
Testing nested extglob patterns
$ simple.c.bin --pattern '@(+(nest)ed))' --verbose
[\x1b[0;34m----\x1b[0m] Criterion v2.2.0 (esc)
[\x1b[0;34m----\x1b[0m] Criterion v2.2.1 (esc)
[\x1b[0;34m====\x1b[0m] Running \x1b[0;34m2\x1b[0m tests from \x1b[0;33mmisc\x1b[0m: (esc)
[\x1b[0;33mSKIP\x1b[0m] misc::passing: Test is disabled (esc)
[\x1b[0;33mSKIP\x1b[0m] misc::failing: Test is disabled (esc)
@ -49,7 +49,7 @@ Testing nested extglob patterns
Testing one or more
$ simple.c.bin --pattern '?(*(a|b))' --verbose
[\x1b[0;34m----\x1b[0m] Criterion v2.2.0 (esc)
[\x1b[0;34m----\x1b[0m] Criterion v2.2.1 (esc)
[\x1b[0;34m====\x1b[0m] Running \x1b[0;34m2\x1b[0m tests from \x1b[0;33mmisc\x1b[0m: (esc)
[\x1b[0;33mSKIP\x1b[0m] misc::passing: Test is disabled (esc)
[\x1b[0;33mSKIP\x1b[0m] misc::failing: Test is disabled (esc)
@ -64,7 +64,7 @@ Testing malformed pattern
Testing range negation
$ simple.c.bin --pattern 'misc/[!azerty]assing' --verbose
[\x1b[0;34m----\x1b[0m] Criterion v2.2.0 (esc)
[\x1b[0;34m----\x1b[0m] Criterion v2.2.1 (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::passing (esc)
[\x1b[0;32mPASS\x1b[0m] misc::passing (esc)
@ -74,7 +74,7 @@ Testing range negation
Testing unparenthesized pipe
$ simple.c.bin --pattern '|pipe' --verbose
[\x1b[0;34m----\x1b[0m] Criterion v2.2.0 (esc)
[\x1b[0;34m----\x1b[0m] Criterion v2.2.1 (esc)
[\x1b[0;34m====\x1b[0m] Running \x1b[0;34m2\x1b[0m tests from \x1b[0;33mmisc\x1b[0m: (esc)
[\x1b[0;33mSKIP\x1b[0m] misc::passing: Test is disabled (esc)
[\x1b[0;33mSKIP\x1b[0m] misc::failing: Test is disabled (esc)
@ -83,7 +83,7 @@ Testing unparenthesized pipe
Testing special char escaping
$ simple.c.bin --pattern '\!(escaped' --verbose
[\x1b[0;34m----\x1b[0m] Criterion v2.2.0 (esc)
[\x1b[0;34m----\x1b[0m] Criterion v2.2.1 (esc)
[\x1b[0;34m====\x1b[0m] Running \x1b[0;34m2\x1b[0m tests from \x1b[0;33mmisc\x1b[0m: (esc)
[\x1b[0;33mSKIP\x1b[0m] misc::passing: Test is disabled (esc)
[\x1b[0;33mSKIP\x1b[0m] misc::failing: Test is disabled (esc)

View file

@ -23,7 +23,7 @@ Listing tests in multiple suites
Running the tests with verbose output
$ suites.c.bin --verbose
[\x1b[0;34m----\x1b[0m] Criterion v2.2.0 (esc)
[\x1b[0;34m----\x1b[0m] Criterion v2.2.1 (esc)
[\x1b[0;34m====\x1b[0m] Running \x1b[0;34m1\x1b[0m test from \x1b[0;33mfirst_suite\x1b[0m: (esc)
[\x1b[0;34mRUN \x1b[0m] first_suite::test (esc)
[\x1b[0;32mPASS\x1b[0m] first_suite::test (esc)
@ -33,7 +33,7 @@ Running the tests with verbose output
[\x1b[0;34m====\x1b[0m] \x1b[0;1mSynthesis: Tested: \x1b[0;34m2\x1b[0;1m | Passing: \x1b[0;32m2\x1b[0;1m | Failing: \x1b[0;31m0\x1b[0;1m | Crashing: \x1b[0;31m0\x1b[0;1m \x1b[0m (esc)
$ more-suites.c.bin --verbose
[\x1b[0;34m----\x1b[0m] Criterion v2.2.0 (esc)
[\x1b[0;34m----\x1b[0m] Criterion v2.2.1 (esc)
[\x1b[0;34m====\x1b[0m] Running \x1b[0;34m1\x1b[0m test from \x1b[0;33mdisabled\x1b[0m: (esc)
[\x1b[0;33mSKIP\x1b[0m] disabled::test: Suite is disabled (esc)
[\x1b[0;34m====\x1b[0m] Running \x1b[0;34m1\x1b[0m test from \x1b[0;33msuite1\x1b[0m: (esc)

View file

@ -3,7 +3,7 @@ Testing multiple samples with --tap
$ simple.c.bin --tap
TAP version 13
1..2
# Criterion v2.2.0
# Criterion v2.2.1
# Running 2 tests from misc
ok - misc::passing
@ -13,7 +13,7 @@ Testing multiple samples with --tap
$ signal.c.bin --tap
TAP version 13
1..3
# Criterion v2.2.0
# Criterion v2.2.1
# Running 3 tests from simple
not ok - simple::wrong_signal
@ -23,7 +23,7 @@ Testing multiple samples with --tap
$ asserts.c.bin --tap
TAP version 13
1..6
# Criterion v2.2.0
# Criterion v2.2.1
# Running 6 tests from asserts
ok - asserts::string
@ -40,7 +40,7 @@ Testing multiple samples with --tap
$ more-suites.c.bin --tap
TAP version 13
1..3
# Criterion v2.2.0
# Criterion v2.2.1
# Running 1 tests from suite2
ok - suite2::test
@ -54,7 +54,7 @@ Testing multiple samples with --tap
$ long-messages.c.bin --tap
TAP version 13
1..1
# Criterion v2.2.0
# Criterion v2.2.1
# Running 1 tests from sample
not ok - sample::long_msg
@ -66,7 +66,7 @@ Testing multiple samples with --tap
$ description.c.bin --tap
TAP version 13
1..2
# Criterion v2.2.0
# Criterion v2.2.1
# Running 2 tests from misc
ok - misc::skipped This one is skipped # SKIP test is disabled
@ -78,7 +78,7 @@ Testing --output=tap
$ simple.c.bin --output=tap:-
TAP version 13
1..2
# Criterion v2.2.0
# Criterion v2.2.1
# Running 2 tests from misc
ok - misc::passing
@ -90,7 +90,7 @@ Testing CRITERION_OUTPUTS
$ CRITERION_OUTPUTS=tap:- simple.c.bin
TAP version 13
1..2
# Criterion v2.2.0
# Criterion v2.2.1
# Running 2 tests from misc
ok - misc::passing

View file

@ -2,7 +2,7 @@ Testing multiple samples with --xml
$ simple.c.bin --xml
<?xml version="1.0" encoding="UTF-8"?>
<!-- Tests compiled with Criterion v2.2.0 -->
<!-- Tests compiled with Criterion v2.2.1 -->
<testsuites name="Criterion Tests" tests="2" failures="1" errors="0" disabled="0">
<testsuite name="misc" tests="2" failures="1" errors="0" disabled="0" skipped="0">
<testcase name="passing" assertions="1" status="PASSED">
@ -15,7 +15,7 @@ Testing multiple samples with --xml
$ signal.c.bin --xml
<?xml version="1.0" encoding="UTF-8"?>
<!-- Tests compiled with Criterion v2.2.0 -->
<!-- Tests compiled with Criterion v2.2.1 -->
<testsuites name="Criterion Tests" tests="3" failures="2" errors="1" disabled="0">
<testsuite name="simple" tests="3" failures="2" errors="1" disabled="0" skipped="0">
<testcase name="wrong_signal" assertions="0" status="FAILED">
@ -30,7 +30,7 @@ Testing multiple samples with --xml
$ asserts.c.bin --xml
<?xml version="1.0" encoding="UTF-8"?>
<!-- Tests compiled with Criterion v2.2.0 -->
<!-- Tests compiled with Criterion v2.2.1 -->
<testsuites name="Criterion Tests" tests="6" failures="2" errors="0" disabled="0">
<testsuite name="asserts" tests="6" failures="2" errors="0" disabled="0" skipped="0">
<testcase name="string" assertions="10" status="PASSED">
@ -52,7 +52,7 @@ Testing multiple samples with --xml
$ more-suites.c.bin --xml
<?xml version="1.0" encoding="UTF-8"?>
<!-- Tests compiled with Criterion v2.2.0 -->
<!-- Tests compiled with Criterion v2.2.1 -->
<testsuites name="Criterion Tests" tests="3" failures="0" errors="0" disabled="1">
<testsuite name="suite2" tests="1" failures="0" errors="0" disabled="0" skipped="0">
<testcase name="test" assertions="1" status="PASSED">
@ -71,7 +71,7 @@ Testing multiple samples with --xml
$ long-messages.c.bin --xml
<?xml version="1.0" encoding="UTF-8"?>
<!-- Tests compiled with Criterion v2.2.0 -->
<!-- Tests compiled with Criterion v2.2.1 -->
<testsuites name="Criterion Tests" tests="1" failures="1" errors="0" disabled="0">
<testsuite name="sample" tests="1" failures="1" errors="0" disabled="0" skipped="0">
<testcase name="long_msg" assertions="1" status="FAILED">
@ -82,7 +82,7 @@ Testing multiple samples with --xml
$ description.c.bin --xml
<?xml version="1.0" encoding="UTF-8"?>
<!-- Tests compiled with Criterion v2.2.0 -->
<!-- Tests compiled with Criterion v2.2.1 -->
<testsuites name="Criterion Tests" tests="2" failures="1" errors="0" disabled="1">
<testsuite name="misc" tests="2" failures="1" errors="0" disabled="1" skipped="1">
<testcase name="skipped" assertions="0" status="SKIPPED">
@ -98,7 +98,7 @@ Testing --output=xml
$ simple.c.bin --output=xml:-
<?xml version="1.0" encoding="UTF-8"?>
<!-- Tests compiled with Criterion v2.2.0 -->
<!-- Tests compiled with Criterion v2.2.1 -->
<testsuites name="Criterion Tests" tests="2" failures="1" errors="0" disabled="0">
<testsuite name="misc" tests="2" failures="1" errors="0" disabled="0" skipped="0">
<testcase name="passing" assertions="1" status="PASSED">
@ -113,7 +113,7 @@ Testing CRITERION_OUTPUTS
$ CRITERION_OUTPUTS=xml:- simple.c.bin
<?xml version="1.0" encoding="UTF-8"?>
<!-- Tests compiled with Criterion v2.2.0 -->
<!-- Tests compiled with Criterion v2.2.1 -->
<testsuites name="Criterion Tests" tests="2" failures="1" errors="0" disabled="0">
<testsuite name="misc" tests="2" failures="1" errors="0" disabled="0" skipped="0">
<testcase name="passing" assertions="1" status="PASSED">

View file

@ -65,7 +65,6 @@ Test(redirect, stdout_) {
std::cout << "Foo" << std::flush;
cr_expect_stdout_eq_str("Foo");
cr_expect_stdout_neq_str("Bar");
}
Test(redirect, stderr_) {
@ -74,7 +73,6 @@ Test(redirect, stderr_) {
std::cerr << "Foo" << std::flush;
cr_expect_stderr_eq_str("Foo");
cr_expect_stderr_neq_str("Bar");
}
Test(redirect, stdin_) {
@ -86,5 +84,4 @@ Test(redirect, stdin_) {
std::cin >> read;
cr_expect_eq(read, "Foo");
cr_expect_neq(read, "Bar");
}