Commit Graph

3129 Commits

Author SHA1 Message Date
Martin Hořeňovský 918aa327fa
Rename contrib/ to extras/ 2019-12-05 16:24:57 +01:00
Martin Hořeňovský 0fea081ad1
Move tests from projects/ to tests/ 2019-12-05 16:00:20 +01:00
Martin Hořeňovský 90e2549cec
Rewrite includes in tests to use library's include paths 2019-12-02 12:23:10 +01:00
Martin Hořeňovský 82cc5bc034
Rewrite includes inside the library to use <catch2/> form 2019-12-02 12:04:55 +01:00
Martin Hořeňovský fef4f217b1
Unit tests build and run (todo: projects, includes, extras) 2019-11-30 20:45:34 +01:00
Martin Hořeňovský e341b11467
WIP: CMake changes to build static lib + tests separately 2019-11-30 17:41:41 +01:00
Martin Hořeňovský 443fa0fc88
Fixing paths in SelfTest 2019-11-30 17:41:17 +01:00
Martin Hořeňovský 4385951a55
Move files into catch2/ subdir 2019-11-30 17:30:32 +01:00
Martin Hořeňovský 7c6de33977
Fixed up include paths 2019-11-30 17:13:22 +01:00
Martin Hořeňovský e1a43b5b0f Move files from internal/ up a level 2019-11-30 12:23:37 +01:00
Martin Hořeňovský 8e56b8b0ec Rename include/ to src/ 2019-11-30 12:17:16 +01:00
Martin Hořeňovský 6923a168a1
Remove unused header 2019-11-28 13:23:48 +01:00
Martin Hořeňovský c9067b2253
Refactor SectionInfo constructors 2019-11-16 21:53:32 +01:00
Martin Hořeňovský d36c15c3ca
Store tags in one big pre-allocated string and only work with refs
This should decrease the number of allocations before main is entered
significantly, but complicates the code somewhat in return.

Assuming I used `massif` right, doing just `SelfTest --list-tests`
went from 929 allocations at "Remove gcc-4.9 from the travis builds"
(2 commits up), to 614 allocations with this commit.
2019-11-14 10:53:12 +01:00
Martin Hořeňovský 302e2c0b06
Do not copy around TestCaseInfo
Now a `TEST_CASE` macro should create a single TestCaseInfo and then
it should never be copied around. This, together with latter changes,
should significantly decrease the number of allocations made before
`main` is even entered.
2019-11-14 10:52:34 +01:00
Martin Hořeňovský 019b0a0fe0
Use Python3.5 (well, PIP) on AppVeyor to solve deprecation warnings 2019-11-13 20:59:19 +01:00
Martin Hořeňovský 9ff2b81164
Remove gcc-4.9 from the travis builds
According to CMake, it does not support templated variables. Strictly
speaking, we added that to the target so that the project defaults
to C++14, but I am planning to use them inside Catch2 anyway.
2019-11-07 15:58:37 +01:00
Martin Hořeňovský d6f7f1fbed
Set CMakeLists to default to C++14 for our internal projects 2019-11-07 13:02:43 +01:00
Martin Hořeňovský 6ddd84a67a
Re-inline NameAndTags constructor 2019-11-07 12:45:16 +01:00
Martin Hořeňovský 09b66ccfde
Remove unused method on TestCase 2019-11-05 10:45:59 +01:00
Martin Hořeňovský d1cb727e85
Remove workaround for GCC 4.8, as it is no longer supported
Closes #1442
2019-11-05 10:45:57 +01:00
Martin Hořeňovský e6b9b854b5
Change how and when anonymous test cases are named 2019-11-04 13:45:39 +01:00
Martin Hořeňovský 478c324534
Redo AppVeyor build matrix
Added VS 2019 builds, C++17/C++20 builds and performed some general
cleanup.
2019-11-04 13:12:59 +01:00
Martin Hořeňovský eabb8a6af7
Cleanup tests for C++20 2019-11-04 13:08:10 +01:00
Martin Hořeňovský ae10e4ef72
Sections no longer save their description
Users can still write a description for their sections, but it will
no longer be saved as part of the `SectionInfo` struct. This ability
has also been added to the documentation.

Closes #1319
2019-11-03 23:13:25 +01:00
Martin Hořeňovský 2c6ace04a7
Redo build matrix on .travis for C++14 and up
* Use Xenial as the base distribution
* Remove C++11 builds
* Add a lot more C++14 builds
* Add some C++17 builds
* Include newer versions of Clang and GCC
2019-10-31 16:19:56 +01:00
Martin Hořeňovský 7c48ea6016
Do not introduce VTable when using the NonCopyable helper 2019-10-30 18:51:14 +01:00
Martin Hořeňovský ca4c6218d4
Remove SourceLineInfo::empty() 2019-10-30 18:01:38 +01:00
Martin Hořeňovský ac4958395c
Rejigger OSX images on Travis 2019-10-29 23:32:24 +01:00
Martin Hořeňovský 316a5c0572
Remove type erasure in predicate matcher
Now the type of the predicate is part of the type of the
PredicateMatcher.
2019-10-29 23:28:08 +01:00
Martin Hořeňovský c781301cd4
Stop support for gcc 4.8, XCode 7.3 and VS 2015 2019-10-29 14:07:18 +01:00
Martin Hořeňovský c46deee024
Untemplatize reporter bases 2019-10-29 14:07:18 +01:00
Martin Hořeňovský 4f47d1c6c1
Hidden tests now require positive filter match to be selected
This also required some refactoring of how the pattern matching
works. This means that the concepts of include and exclude patterns
are no longer unified, with exclusion patterns working as just
negation of an inclusion patterns (which led to including hidden
tags by default, as they did not match the exclusion), but rather
both include and exclude patterns are handled separately.

The new logic is that given a filter and a test case, the test
case must match _all_ include patterns and _no_ exclude patterns
to be included by the filter. Furthermore, if the test case is
hidden, then the filter must have at least one include pattern
for the test case to be used.

Closes #1184
2019-10-29 14:07:18 +01:00
Martin Hořeňovský 2bcf1b3db6
Remove support for test case descriptions
Closes #1189
2019-10-29 14:07:18 +01:00
Martin Hořeňovský be44cfa63b
Specialize XML reporter's --list output 2019-10-29 14:07:18 +01:00
Martin Hořeňovský 85b129c741
Pipe --list* through reporters
This allows us to provide machine-readable listings through the
XMLReporter and it will also allow users to define their own listing
format that does whatever their own tools need.
2019-10-29 14:07:18 +01:00
Martin Hořeňovský 0f39438aae
Stop checking verbosities up-front 2019-10-29 14:07:18 +01:00
Martin Hořeňovský c582e351ce
Remove --list-test-names-only
People should use verbosity modifiers with `--list-tests` instead.

Closes #1190
2019-10-29 14:07:18 +01:00
Martin Hořeňovský d2cddfc9c5
Make --list-* exit code be 0
Previously it returned the sum of listed things because ???. This
was completely useless and in many ways actively counterproductive
because of the success/failure conventions around exit codes.

Closes #1410
2019-10-29 14:07:18 +01:00
Martin Hořeňovský 557b336125
Remove superfluous semicolon in the INFO macro
Closes #1456
2019-10-29 14:07:18 +01:00
Martin Hořeňovský 141761745a
Remove ANON_TEST_CASE
It can be fully replaced with `TEST_CASE` without any arguments,
so there is no need to keep it around.

Closes #1220
2019-10-29 14:07:18 +01:00
Martin Hořeňovský 3136c4fb6a
Refactored XMLWriter to provide finer-grained control over formatting 2019-10-29 13:59:18 +01:00
Martin Hořeňovský 74e0e737a6
Remove useless test 2019-10-29 11:44:24 +01:00
Martin Hořeňovský 0685216175
Mark type erasure in PredicateFunction as deprecated 2019-10-28 15:15:13 +01:00
Martin Hořeňovský fc320f6b8f
Extract FunctionReturnType to catch_meta.hpp 2019-10-28 15:15:13 +01:00
Martin Hořeňovský 5290d4bedc
Merge pull request #1791 from catchorg/dev-reorganize-warning-suppression
Rework how warning suppression in macros is done
2019-10-28 13:13:23 +01:00
Martin Hořeňovský 7ada02e21e
Avoid technically UB type punning when determining endianness 2019-10-27 22:07:10 +01:00
Martin Hořeňovský 849f2848bd
Rework how warning suppression in macros is done
Previously, each warning suppression was self-contained, with its
own pair of `SUPPRESS_X_WARNING` and `UNSUPPRESS_X_WARNING` macros.
This had the obvious advantage of being self-containing, but it
also meant that if we needed to suppress more than one warning
in a single place, then we would manipulate the compiler's warning
state multiple times, even though logically we would only need one
layer.

The new way of suppressing warnings in macros is to push compiler's
warning state with `CATCH_INTERNAL_START_WARNINGS_SUPPRESSION` macro,
then disable whatever macros we need with the
`CATCH_INTERNAL_SUPPRESS_X_WARNINGS` macro, and then return to the
previous state using `CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION`.
2019-10-27 21:07:21 +01:00
Alexander Stein 2fbd66c51c Improve JUnit failure report
The JUnit report is improved in that:
* The message shows the testing condition, not the result
* The actual message has similar output than the console one
2019-10-27 18:02:14 +01:00
sp-dani-garcia 51b29ced1a Add SonarQube Generic Test Data reporter
It outputs reports in the `Generic Execution Test Data` format, see
https://docs.sonarqube.org/latest/analysis/generic-test/, specifically
https://docs.sonarqube.org/latest/analysis/generic-test/#header-2

Close #1738 (this is a cherry-pick and fixup of that PR)
2019-10-27 10:02:41 +01:00