Commit graph

52 commits

Author SHA1 Message Date
Tim Bochenek
07d4872076 fix clang warnings
fix clang warning warning: no previous extern declaration for non-static variable 'X' [-Wmissing-variable-declarations]
2017-02-03 08:19:17 -05:00
Tim Bochenek
0a6857e388 fix clang warning
fix clang warning 'extra ';' outside function is c++11 extension
2017-02-02 18:03:59 -05:00
timdave13
d7bd757862 fix clang warning
fix clang warning: 'X' has no out-of-line virtual method definitions; its vtable will be emitted in every translation unit [-Wweak-vtables]
2017-02-02 17:14:27 -05:00
Patrick Johnmeyer
d8e27e1825 Merge pull request #127 from pjohnmeyer/up_gcc_clang_warning_levels
Up non-MSVC warning levels
2016-08-30 20:45:40 -05:00
Patrick Johnmeyer
1d0e157c5a Merge pull request #126 from pjohnmeyer/up_msvc_warning_levels
Up MSVC warning levels
2016-08-30 20:45:20 -05:00
Gabriel Schlozer
eca039304b Used size_t for CHECK macros 2016-08-29 22:36:31 +02:00
Patrick Johnmeyer
2e2475fa54 Fix unused variable warnings 2016-08-27 09:55:37 -05:00
Patrick Johnmeyer
7e4fff3bb4 Fix "assignment operator could not be generated" warning
This shows up with /W4 on MSVC. Fixes #107.
2016-08-27 08:27:15 -05:00
Patrick Johnmeyer
097c71e6b8 Merge pull request #114 from unittest-cpp/long_and_short_macros
Long and short macros
2016-08-16 22:41:13 -05:00
Patrick Johnmeyer
21589e5612 Take UnitTest::Check parameter by const reference
Fixes #119 and #7
2016-07-15 23:23:45 -05:00
Patrick Johnmeyer
510903c880 Merge pull request #117 from korli/master
Add support for Haiku.
2016-07-15 22:58:31 -05:00
Jerome Duval
053bcfc9c7 Add support for Haiku. 2016-06-03 13:13:33 +02:00
JonChesterfield
27317ec077 Prefix local variable message in CHECK macros with UnitTest_ to reduce the risk of name collisions with application code 2016-05-16 11:13:51 +01:00
Patrick Johnmeyer
910381fadc Change UNITTEST_ENABLE_SHORT_MACROS to DISABLE
Also add a test file.
2016-05-07 01:02:20 -05:00
Patrick Johnmeyer
df386f189f Add UNITTEST_ prefixes to remaining macros
TEST, SUITE, and REQUIRE macros now have UNITTEST_ and UNITTEST_IMPL_
prefixes like the others, completing the set.
2016-05-07 00:12:09 -05:00
Patrick Johnmeyer
c96bf52613 Replace UT_ macro prefix with UNITTEST_IMPL_
The UT_ prefix was primarily for "internal" macros. This commit seeks
to more consistently "namespace" UnitTest++ macros with the UNITTEST_
prefix, while also marking these particular macros as "private"
implementation details with the IMPL_ wart.
2016-05-06 23:57:59 -05:00
Patrick Johnmeyer
185b3d5086 Add UNITTEST_ versions of all CHECK macros
UNITTEST_ now prefixes the implementation of all CHECK macros.
Additionally, the build option UNITTEST_ENABLE_SHORT_MACROS can be
shut off, disabling the creation of the existing short forms. This is
helpful for users who may have conflicts with their projects or other
libs.
2016-05-06 23:44:02 -05:00
Saul Beniquez
8544b5b6be Fix for #105 - Automake improvements: fixing pkgincludedir. 2016-04-07 14:55:53 -04:00
Patrick Johnmeyer
962387ce5d Update autotools for new source files. 2016-02-23 23:10:29 -06:00
Austin Gilbert
2e53a17d7e With code proposed in Pull Request #95, when UNITTEST_NO_EXCEPTIONS is defined, the definition for REQUIRE macro is empty.
This commit adds functionality for stopping unit tests early when UNITTEST_NO_EXCEPTIONS is defined via std::longjmp.
2016-02-08 21:38:56 -06:00
Austin Gilbert
4b0ac3f34a UT_RETHROW needed to take an argument when UNITTEST_NO_EXCEPTIONS=1. 2016-02-08 21:36:05 -06:00
Patrick Johnmeyer
6bb9541ae2 Fix warnings, errors, 2x error reporting in MSVC
Visual Studio 2015 complained about calling UT_THROW with zero arguments.
Visual Studio 6 complained about calling UT_CATCH with an empty second
argument. For these cases, I added UT_RETHROW(ExceptionName).

I also added a catch of RequiredCheckException to ExecuteTest to avoid
two error messages on each failed REQUIRE check.
2016-02-06 22:04:52 -06:00
Patrick Johnmeyer
3f5095ba13 Eliminate some single-line if statements. 2016-02-06 09:30:15 -06:00
Patrick Johnmeyer
5eec0a255f Simplify required check reporter interactions
Was able to remove ThrowingTestReporter::SetDecorated and
::GetDecorated by changing RequiredCheckTestReporter to accept
its TestResults by reference. This simple change removed
several if-checks and some functions.
2016-02-06 09:30:15 -06:00
Patrick Johnmeyer
57fc32c114 Change camelCase methods to PascalCase 2016-02-06 09:30:15 -06:00
Patrick Johnmeyer
40b8f0b17b Use new RequiredCheckException for REQUIRE
Rather than re-using AssertException, it felt more correct to
create a new special-purpose exception.
2016-02-06 09:30:15 -06:00
Patrick Johnmeyer
74ca0c301f Merge and uncrustify. 2016-02-06 09:30:06 -06:00
Austin Gilbert
89ff2596ee Eliminating 'unused exception variable' warnings. 2016-02-06 09:30:05 -06:00
Austin Gilbert
a9161c1ba6 This commit addresses two issues:
(1) unreachable code in for loop shenanigans is eliminated.
(2) code after a failing REQUIRE check no longer executes. Used a
    decorating TestReporter to achive this.
2016-02-06 09:29:38 -06:00
Patrick Johnmeyer
06308ee802 Use for loop to achieve REQUIRE with no parens
I changed the definition of the REQUIRE macro to use for loops and
some comma operator shenanigans to allow things like:

    REQUIRE
    {
      CHECK(...);
      CHECK_EQUAL(..., ...);
    }

or

    REQUIRE CHECK(...);

I updated the tests and they all passed on my machine. My only
concern is that some compilers might complain about the unreachable
code in the (throw UnitTest::AssertException(), true) expression.
2016-02-06 09:28:48 -06:00
Austin Gilbert
e7b56d4e3c Introducing additional functionality to allow client code to stop a unit
test when an assert fails.

The following macro has been added:

	REQUIRE

An example of when these type of checks are useful:

    std::vector<int> v = foo();

    REQUIRE(CHECK_EQUAL(3, v.size())); // test stops here on a fail
                                       // so we don't segfault looking at
                                       // v[0] below.
    CHECK_EQUAL(1, v[0]);
    CHECK_EQUAL(2, v[1]);
    CHECK_EQUAL(3, v[2]);

Multiple checks are supported as follows:

    REQUIRE({
        CHECK_EQUAL(1, 2);
        CHECK(true);
    };

In the multiple check scenario, all the checks in the REQUIRE block will
be run. After which, if any failures were reported, the TEST case will
be stopped.

When UNITTEST_NO_EXCEPTIONS is defined, REQUIRE is a noop.
2016-02-06 09:28:48 -06:00
Patrick Johnmeyer
353d3989d3 Delete straggling .vcproj files. 2016-01-29 23:10:38 -06:00
Patrick Johnmeyer
bb7555c718 Tweak preprocessor blocks. 2016-01-29 22:48:36 -06:00
Patrick Johnmeyer
f82c403768 Change preprocessor indent rules. 2016-01-29 22:22:37 -06:00
Patrick Johnmeyer
b47b4f7e85 Add uncrustify config and run first pass. 2016-01-29 22:15:10 -06:00
Richard Powell
014d6e48f8 adding an explicit cast for the conversion from int to useconds_t in TimeHelpers::SleepMS. 2015-12-16 06:53:06 -08:00
Patrick Johnmeyer
dc6b908380 Merge pull request #78 from Microsoft/vs2015Support
Vs2015 support
2015-10-15 22:20:22 -05:00
Anna Gringauze
0a14abb0a5 Added support for VS2015 2015-09-22 07:36:28 -07:00
Saul Beniquez
c0e97bf082 [UnitTest++] Removing a spurrious UnitTest___libUnitTest___la_CPPFLAGS assignment 2015-04-07 12:48:47 -04:00
Saul Beniquez
9257dc7feb Removing duplicated UNITTEST_POSIX #define from cmdline -D flags 2015-04-07 09:34:52 -04:00
Saul Beniquez
7549615b31 Adding conditional automake directives to allow Win32 compilation on win32-mingw/cygwin-mingw systems. 2015-04-07 08:46:20 -04:00
Patrick Johnmeyer
d310c03eea Add missing headers to Makefile.
Closes #42.
2015-04-03 23:27:32 -05:00
warmist
1fdc44246d Fix crash bug in msvc
fprintf had incorrect number of arguments.
2014-01-06 14:02:59 +02:00
Patrick Johnmeyer
04a6094d63 Merge pull request #48 from magicant/autotools
Fix autotools configuration
2013-07-22 07:13:26 -07:00
Patrick Johnmeyer
4661f377da Merge pull request #46 from lijoantony/master
Integrating test failures into QTCreator IDE build errors
2013-07-22 07:12:57 -07:00
WATANABE Yuki
cda955dee4 Fix autotools configuration
* Add some headers to the list of installed files.
* Specify the "foreign" strictness so that automake does not complain
  about missing files.
* Specify a directory for m4 macros as suggested by libtoolize.
* Add autotools-generated files to gitignore.
2013-07-20 13:27:19 +09:00
Lijo Antony
bd1239bff7 Integrating test failure in to QtCreator IDE build errors 2013-06-09 23:48:16 +04:00
Martin Moene
65d2e03ec9 Adapt MemoryOutStream for VC6 __int64 type 2013-05-10 11:32:15 +02:00
Martin Moene
23127fe5b9 Add changes required to compile with MS VC6
Add macro UNITTEST_COMPILER_IS_MSVC6
Add macro UNIITEST_NS_QUAL_STD(fun)
Avoid __pragma()
Skip tests with long long
2013-05-09 11:12:29 +02:00
Victor Lavaud (qdii)
e90b9e5a63 Fixed autotools 2013-03-29 20:59:47 +01:00