2
0
mirror of https://github.com/boostorg/test.git synced 2026-02-02 09:12:10 +00:00
Commit Graph

1227 Commits

Author SHA1 Message Date
Raffi Enficiaud
d5cb100b1e C++17 string_view support
- subclassing cstring in order to be able to create an instance of cstring
  without changing its signature: the code remains C++03/C++17 compatibile
  even if boost.test is compiled with other options than the test module
- added casting and usage checks
- deduce_cstring rationale change
2019-10-30 08:15:57 +01:00
Raffi Enficiaud
a1bafb22eb Merge branch 'topic/GH-229-random-shuffle-deprecation-warning' into next-internal
* topic/GH-229-random-shuffle-deprecation-warning:
  Change log
  Removing calls to std::random_shuffle in favour of the drop-in replacement
2019-10-20 18:40:05 +02:00
Raffi Enficiaud
a3a07d08ee Avoiding any proxying of the boolean values
std::vector<bool>::const_iterator returns a temporary of a proxy class
while the value is needed for constructing the test case with parameters.

- added test reproducing the issue
2019-10-08 07:43:37 +02:00
Raffi Enficiaud
15c17c25c1 Removing calls to std::random_shuffle in favour of the drop-in replacement
The conditional call makes the code more complicated and fires a warning
on C++11 compilers about deprecation.
2019-10-08 00:32:34 +02:00
Raffi Enficiaud
5262170050 Merge branch 'topic/PR-231-defines-missing-openbsd' into next-internal
* topic/PR-231-defines-missing-openbsd:
  Change log
  OpenBSD is missing SI_ASYNCIO and SI_MESGQ
2019-10-05 15:09:47 +02:00
Edward Catmur
0aeb445fa4 Add printf format checking attribute to report_error
On gcc and clang, add __attribute__((__format__)) checking to the report_error function.

Cast faulting addresses to uintptr_t for formatting as 0x%08lx - this won't work on LLP64, but Win64 uses SEH anyway.
Fix swapped si_code/si_addr (& si_band) format arguments.
Add missing %s to format diagnostic information.

- Check __GNUC__ major : format attribute was introduced sometime during gcc 2.8, so 3 definitely has it.
  Same should apply for any compiler claiming GNUC compatibility
- Check that diagnostic information is not passed to format unescaped: If it is passed unescaped, the '%%' will be
  condensed to a single '%' and the test will fail.
2019-10-05 12:26:37 +02:00
George Koehler
684f067dde OpenBSD is missing SI_ASYNCIO and SI_MESGQ
Check if SI_ASYNCIO and SI_MESGQ are defined as macros.  This allows
to run tests on OpenBSD 6.5, where the macros are missing.

This is identical to patch-boost_test_impl_execution_monitor_ipp in
OpenBSD Ports, except that I added a comment.
2019-10-05 12:20:15 +02:00
Raffi Enficiaud
e112b88bbc Merge branch 'topic/GH-218-outstream-default-filename' into next-internal
* topic/GH-218-outstream-default-filename:
  Change log
  Master test suite name setup prior to all other setup

# Conflicts:
#	doc/closing_chapters/change_log.qbk
2019-07-27 13:47:19 +02:00
Raffi Enficiaud
2920098453 Master test suite name setup prior to all other setup
This is a simple call to a global setting that can be performed

- in an idempotent manner
- prior to any other setup

Since some loggers rely on the master test suite (generation of the
output files), this setting should precede any other. In particular,
it should not be delayed until the user `init_unit_test` is called. A global object fits this purpose.
2019-07-27 11:40:02 +02:00
Raffi Enficiaud
a029ff4b0f Merge branch 'topic/deprecation-better-wording' into next-internal
* topic/deprecation-better-wording:
  Guiding the user for changing the include
2019-07-27 11:20:58 +02:00
Raffi Enficiaud
711addd805 Guiding the user for changing the include 2019-07-23 14:15:30 +02:00
Raffi Enficiaud
a7afa8413a Helper for restricting the use of numeric_limits to complete types
Fixes GH-209.
A new helper meta-function has been added to check if the type under
test is complete or not. Incomplete types cannot be used with
std::numeric_limits.

The newly added test cannot be run on pre C++11 because of the limited
BOOST_TEST support (unrelated to the std::numeric_limits issue).
2019-07-21 21:14:38 +02:00
Raffi Enficiaud
7fbc8e8579 Merge branch 'topic/PR-224-BOOST_HEADER_DEPRECATED' into next-internal
* topic/PR-224-BOOST_HEADER_DEPRECATED:
  Change log
  Removing references to deprecated headers
  Add BOOST_HEADER_DEPRECATED to deprecated headers
2019-07-21 15:42:34 +02:00
Raffi Enficiaud
bee1a4076b Removing references to deprecated headers
- doc changes
- unit test changes
2019-07-21 13:49:25 +02:00
Luke Peterson
1a607b6867 Add BOOST_HEADER_DEPRECATED to deprecated headers 2019-07-21 11:31:27 +02:00
Kedar R. Bhat
8dbdeced84 Commented out unused argument name (stack_decorator::apply)
Both GCC and Clang complain about the argument to `stack_decorator::apply` being unused; commenting out the variable name quiets the warning
2019-07-20 19:29:53 +02:00
Raffi Enficiaud
364b153de3 Timer should not be named on Windows
The name makes the visibility of the timer global. This fails builds
when they are run concurrently on the same machine.
2019-07-16 21:45:30 +02:00
Raffi Enficiaud
04006ad5bd Fix visibility warnings
Forward declarations for templates should also have the visibility right
Local static variables cannot have their visibility set and need to get out of the function scope.
2019-03-28 08:52:16 +01:00
Juan Alday
377695da54 Fixes issue with sun_cc lacking the __global attribute for enums
Fixes https://github.com/boostorg/test/issues/213
https://docs.oracle.com/cd/E19205-01/819-5267/bkaed/index.html
2019-03-28 07:26:44 +01:00
Raffi Enficiaud
6a8773f626 Merge branch 'doc/small-additions' into next-internal
* doc/small-additions:
  More about datasets and delayed ones
  Updates on what is a sequence.
  Test tree constrains and doc refactoring
2019-03-24 17:43:25 +01:00
Raffi Enficiaud
4f3806d802 Win32 waitable timer: better casting 2019-03-24 17:42:31 +01:00
Raffi Enficiaud
17ce78b0fe More about datasets and delayed ones 2019-03-24 17:41:37 +01:00
Raffi Enficiaud
b9d74d1f55 Merge branch 'topic/PR-212-ar-parameter-assertion_result-warning' into next-internal
* topic/PR-212-ar-parameter-assertion_result-warning:
  Change log
  Comment 'ar' parameter of assertion_result to avoid warning

# Conflicts:
#	doc/closing_chapters/change_log.qbk
2019-03-20 20:29:39 +01:00
Mateusz Łoskot
fa037a059e Comment 'ar' parameter of assertion_result to avoid warning 2019-03-20 20:28:34 +01:00
Rainer Deyke
5feed945fc Change Windows.h to lower case. 2019-03-20 08:25:52 +01:00
Raffi Enficiaud
fcd24729df New documentation section about runtime configuration
- adding tests for custom command line argument passing
- using command line argument in global fixtures and raising strong errors
- using command line argument in init function and describing the errors
- using command line argument dataset test cases and describing the errors
- removing sample totally from all the examples
2019-03-19 01:43:29 +01:00
Raffi Enficiaud
37dfcf2117 Merge branch 'topic/fix-win32-timed-test' into next-internal
* topic/fix-win32-timed-test:
  Change log
  Fixup _WIN32_WINNT definition
2019-03-05 21:56:34 +01:00
Raffi Enficiaud
0ed5a9a71f Merge branch 'topic/GH-198-support-boost-cmake-in-b2' into next-internal
* topic/GH-198-support-boost-cmake-in-b2:
  Change log
  Making the dynamic link aware of the b2/cmake defines
2019-03-05 21:54:25 +01:00
Raffi Enficiaud
7d71da7a7f Template test cases: handling the references and volatile in the test-case names 2019-03-04 21:02:13 +01:00
Raffi Enficiaud
9b3be27a9f Template test cases with arbitrary parameter pack
Using arbitrary parameter pack of a template
class/struct to infer the list of types, instead
of restricting to `std::tuples`.

Filtering the mpl::sequences from this logic because
the parameter pack is filled with `mpl::na` on non-entries.
2019-03-04 15:23:08 +01:00
Raffi Enficiaud
625bafd2cd Making the dynamic link aware of the b2/cmake defines 2019-03-03 20:42:28 +01:00
Raffi Enficiaud
504723babe Fixup _WIN32_WINNT definition 2019-03-03 16:15:56 +01:00
Raffi Enficiaud
7e20f966dc Junit counting fixups: failed and errored differences
Failed and errored are exclusive in the JUnit sense.
Counting the number of total tests slightly differently.

Changing slightly the signature of unit_test_log_formatter::log_build_info to avoid a sticky
state when the function was called only once (happens for instance in JUNIT).
2019-03-01 08:47:50 +01:00
Raffi Enficiaud
76d1bdfef8 Merge branch 'topic/GH-202-boost-timer-deprecation' into next-internal
* topic/GH-202-boost-timer-deprecation:
  Change log
  Documentation updates
  Adding the support for skipped test units/suites in the reporter and formatters
  <boost/timer.hpp> removal and time-out for suites and major refactoring
2019-02-27 21:11:12 +01:00
Raffi Enficiaud
83d505a61d Adding the support for skipped test units/suites in the reporter and formatters 2019-02-27 14:58:57 +01:00
Raffi Enficiaud
42e9a15317 <boost/timer.hpp> removal and time-out for suites and major refactoring
As boost/timer.hpp is being deprecated, and the needed functionality
is very little, reimplemeted naively a timing class for the purpose
of measuring the test-unit time.

- specific timer class that is cross-platform and agnostic to changes made
  to the OS while measuring time (mac, posix and windows). Wall-clock and system/user
  time available
- changed framework to work fully with microseconds. Only ::alarm needs seconds
  and ceiling is used for signaling time-out
- Windows now signals also time-outs the same way as for other platforms (exception
  raised in the test and reported). However, Windows platform do not raise a signal
  that terminates the current test
- timeout is not used for failing a test-suite as well. Remaining time calculation is
  now made in microseconds. Adding an observer interface for signaling time out and
  adding the time outs in the test results
- cleaned up interfaces, clarify the code about the dimension of the different scalar values.
2019-02-27 14:55:00 +01:00
Tien Do
9103a0e027 Correct library name in test runner help screen 2019-02-15 13:40:49 +01:00
Raffi Enficiaud
5771ddb4f8 Merge branch 'topic/GH-138-decorator-dataset-testcase' into next-internal
* topic/GH-138-decorator-dataset-testcase:
  Change log
  Fixing propagation of decorators to underlying test-case generator

# Conflicts:
#	doc/closing_chapters/change_log.qbk
2019-02-14 08:33:24 +01:00
Raffi Enficiaud
475a399d97 Merge branch 'topic/PR-205-Fix-MinGW-vsnprintf-compile-errors-warnings' into next-internal
* topic/PR-205-Fix-MinGW-vsnprintf-compile-errors-warnings:
  Change log
  Added unused variable markup to silence gcc warnings.
  Use legacy _vsnprintf on MinGW.

# Conflicts:
#	doc/closing_chapters/change_log.qbk
2019-02-14 08:27:44 +01:00
Raffi Enficiaud
52c7da62d8 Fixing propagation of decorators to underlying test-case generator
The BOOST_DATA_TEST_CASE creates an implicit test suite. that consumes
all the decorators that have been declared prior to the BOOST_DATA_TEST_CASE
macro. In order to properly propagate the decorators to the underlying
test-case generator (the data test case), a new "stacked" decorator collector
has been implemented. The new decorator decorator::stack_decorator
allows the user to push the currently stacked decorator to a higher level of the
hierarchy.
2019-02-14 08:25:32 +01:00
Raffi Enficiaud
a2816aeb75 Merge branch 'topic/GH-197-plural-context-in-single-scope' into next-internal
* topic/GH-197-plural-context-in-single-scope:
  Change log
  Making BOOST_TEST_CONTEXT variadic and adding sticky context

# Conflicts:
#	doc/closing_chapters/change_log.qbk
2019-02-13 07:15:12 +01:00
Andrey Semashev
40ddfdd0b1 Added unused variable markup to silence gcc warnings.
The singleton reference variables and a few other globals may not be actually
used in the user's code, which makes gcc emit warnings. This commit marks these
variables as potentially unused, which silences the warnings.
2019-02-13 07:11:59 +01:00
Andrey Semashev
c5ef935641 Use legacy _vsnprintf on MinGW.
Apparently, some versions of legacy MinGW headers don't provide
the standard vsnprintf function, as Appveyor CI fails for this target.
Thus we use the non-standard MSVC-specific _vsnprintf instead.
2019-02-12 01:12:04 +01:00
Raffi Enficiaud
1cf1503b23 Making BOOST_TEST_CONTEXT variadic and adding sticky context
To ease the creation of contexts, variadic let us declare several
values in one call (no extra brace) while ticky context let us
add new information while they arrive.

The example shows a random trial making a test fail. We force the failure
for the unit tests, which does not remove the documentation value of the
example.
2019-02-12 01:04:00 +01:00
Raffi Enficiaud
60eec92e0e Merge branch 'topic/GH-203-dataset-new-fixtures' into next-internal
* topic/GH-203-dataset-new-fixtures:
  Change log
  Extended fixture messages for template test cases
  Dataset test case: allowing fixtures w. setup/teardown

# Conflicts:
#	doc/closing_chapters/change_log.qbk
2019-02-10 23:25:10 +01:00
Raffi Enficiaud
638f7c1e0a Extended fixture messages for template test cases
Unifying the messages as for the other test-cases
2019-02-10 20:24:01 +01:00
Raffi Enficiaud
0b4eeb22c6 Dataset test case: allowing fixtures w. setup/teardown
Also the context is now spread to the fixture as well.
2019-02-10 20:23:52 +01:00
Raffi Enficiaud
ae1a6c608b Merge branch 'topic/floating-point-comparison-issues' into next-internal
* topic/floating-point-comparison-issues:
  Change log
  Relaxed tolerance based comparisons
2019-02-08 03:26:52 +01:00
Raffi Enficiaud
80d342a806 Relaxed tolerance based comparisons
It is now possible to compare a type that is tolerance based together
with a type that is not necessarily tolerance based but still
arithmetic.

Doc update and tests.
2019-02-08 01:32:54 +01:00
Raffi Enficiaud
a84a5564f5 Default visibility for enums and rtti objects facility
Making the RTTI objects globally visible.
Some old versions of clang are apparently not honoring
the enum visibility.
2019-02-08 00:00:01 +01:00