From c41a45e79ced6e3aeb7bcc64d986dc58305706bd Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Mon, 12 Jun 2017 23:13:27 +0100 Subject: [PATCH] Rebased following Clara changes --- .../Baselines/console.std.approved.txt | 2 +- .../Baselines/console.sw.approved.txt | 148 ++++++++----- .../SelfTest/Baselines/junit.sw.approved.txt | 3 +- .../SelfTest/Baselines/xml.sw.approved.txt | 208 +++++++++--------- 4 files changed, 202 insertions(+), 159 deletions(-) diff --git a/projects/SelfTest/Baselines/console.std.approved.txt b/projects/SelfTest/Baselines/console.std.approved.txt index c7b1b566..49f184e9 100644 --- a/projects/SelfTest/Baselines/console.std.approved.txt +++ b/projects/SelfTest/Baselines/console.std.approved.txt @@ -1003,5 +1003,5 @@ with expansion: =============================================================================== test cases: 171 | 121 passed | 46 failed | 4 failed as expected -assertions: 843 | 728 passed | 94 failed | 21 failed as expected +assertions: 844 | 729 passed | 94 failed | 21 failed as expected diff --git a/projects/SelfTest/Baselines/console.sw.approved.txt b/projects/SelfTest/Baselines/console.sw.approved.txt index f70bda98..e74a3348 100644 --- a/projects/SelfTest/Baselines/console.sw.approved.txt +++ b/projects/SelfTest/Baselines/console.sw.approved.txt @@ -4773,7 +4773,9 @@ TestMain.cpp: TestMain.cpp:: PASSED: - CHECK_NOTHROW( parser.parseInto( std::vector(), config ) ) + CHECK( result ) +with expansion: + {?} TestMain.cpp:: PASSED: @@ -4790,7 +4792,9 @@ TestMain.cpp: TestMain.cpp:: PASSED: - CHECK_NOTHROW( parseIntoConfig( argv, config ) ) + CHECK( result ) +with expansion: + {?} TestMain.cpp:: PASSED: @@ -4832,17 +4836,19 @@ TestMain.cpp: TestMain.cpp:: PASSED: - CHECK_NOTHROW( parseIntoConfig( argv, config ) ) + CHECK( result ) +with expansion: + {?} TestMain.cpp:: PASSED: - REQUIRE( cfg.testSpec().matches( fakeTestCase( "notIncluded" ) ) == false ) + REQUIRE( cfg.testSpec().matches(fakeTestCase("notIncluded")) == false ) with expansion: false == false TestMain.cpp:: PASSED: - REQUIRE( cfg.testSpec().matches( fakeTestCase( "test1" ) ) ) + REQUIRE( cfg.testSpec().matches(fakeTestCase("test1")) ) with expansion: true @@ -4856,17 +4862,19 @@ TestMain.cpp: TestMain.cpp:: PASSED: - CHECK_NOTHROW( parseIntoConfig( argv, config ) ) + CHECK( result ) +with expansion: + {?} TestMain.cpp:: PASSED: - REQUIRE( cfg.testSpec().matches( fakeTestCase( "test1" ) ) == false ) + REQUIRE( cfg.testSpec().matches(fakeTestCase("test1")) == false ) with expansion: false == false TestMain.cpp:: PASSED: - REQUIRE( cfg.testSpec().matches( fakeTestCase( "alwaysIncluded" ) ) ) + REQUIRE( cfg.testSpec().matches(fakeTestCase("alwaysIncluded")) ) with expansion: true @@ -4880,17 +4888,19 @@ TestMain.cpp: TestMain.cpp:: PASSED: - CHECK_NOTHROW( parseIntoConfig( argv, config ) ) + CHECK( result ) +with expansion: + {?} TestMain.cpp:: PASSED: - REQUIRE( cfg.testSpec().matches( fakeTestCase( "test1" ) ) == false ) + REQUIRE( cfg.testSpec().matches(fakeTestCase("test1")) == false ) with expansion: false == false TestMain.cpp:: PASSED: - REQUIRE( cfg.testSpec().matches( fakeTestCase( "alwaysIncluded" ) ) ) + REQUIRE( cfg.testSpec().matches(fakeTestCase("alwaysIncluded")) ) with expansion: true @@ -4904,7 +4914,9 @@ TestMain.cpp: TestMain.cpp:: PASSED: - CHECK_NOTHROW( parseIntoConfig( argv, config ) ) + CHECK( cli.parse({"test", "-r", "console"}) ) +with expansion: + {?} TestMain.cpp:: PASSED: @@ -4922,7 +4934,9 @@ TestMain.cpp: TestMain.cpp:: PASSED: - CHECK_NOTHROW( parseIntoConfig( argv, config ) ) + CHECK( cli.parse({"test", "-r", "xml"}) ) +with expansion: + {?} TestMain.cpp:: PASSED: @@ -4940,7 +4954,9 @@ TestMain.cpp: TestMain.cpp:: PASSED: - CHECK_NOTHROW( parseIntoConfig( argv, config ) ) + CHECK( cli.parse({"test", "-r", "xml", "-r", "junit"}) ) +with expansion: + {?} TestMain.cpp:: PASSED: @@ -4970,7 +4986,9 @@ TestMain.cpp: TestMain.cpp:: PASSED: - CHECK_NOTHROW( parseIntoConfig( argv, config ) ) + CHECK( cli.parse({"test", "--reporter", "junit"}) ) +with expansion: + {?} TestMain.cpp:: PASSED: @@ -4988,7 +5006,9 @@ TestMain.cpp: TestMain.cpp:: PASSED: - CHECK_NOTHROW( parseIntoConfig( argv, config ) ) + CHECK( cli.parse({"test", "-b"}) ) +with expansion: + {?} TestMain.cpp:: PASSED: @@ -5006,7 +5026,9 @@ TestMain.cpp: TestMain.cpp:: PASSED: - CHECK_NOTHROW( parseIntoConfig( argv, config ) ) + CHECK( cli.parse({"test", "--break"}) ) +with expansion: + {?} TestMain.cpp:: PASSED: @@ -5024,7 +5046,9 @@ TestMain.cpp: TestMain.cpp:: PASSED: - CHECK_NOTHROW( parseIntoConfig( argv, config ) ) + CHECK( cli.parse({"test", "-a"}) ) +with expansion: + {?} TestMain.cpp:: PASSED: @@ -5042,7 +5066,9 @@ TestMain.cpp: TestMain.cpp:: PASSED: - CHECK_NOTHROW( parseIntoConfig( argv, config ) ) + CHECK( cli.parse({"test", "-x", "2"}) ) +with expansion: + {?} TestMain.cpp:: PASSED: @@ -5050,21 +5076,6 @@ PASSED: with expansion: 2 == 2 -------------------------------------------------------------------------------- -Process can be configured on command line - abort - -x must be greater than zero -------------------------------------------------------------------------------- -TestMain.cpp: -............................................................................... - -TestMain.cpp:: -PASSED: - REQUIRE_THAT( parseIntoConfigAndReturnError( argv, config ), Contains( "greater than zero" ) ) -with expansion: - "Value after -x or --abortAfter must be greater than zero - - while parsing: (-x, --abortx )" contains: "greater than zero" - ------------------------------------------------------------------------------- Process can be configured on command line abort @@ -5075,10 +5086,16 @@ TestMain.cpp: TestMain.cpp:: PASSED: - REQUIRE_THAT( parseIntoConfigAndReturnError( argv, config ), Contains( "-x" ) ) + CHECK( !result ) with expansion: - "Unable to convert oops to destination type - - while parsing: (-x, --abortx )" contains: "-x" + true + +TestMain.cpp:: +PASSED: + REQUIRE_THAT( result.errorMessage(), Contains("convert") && Contains("oops") ) +with expansion: + "Unable to convert 'oops' to destination type" ( contains: "convert" and + contains: "oops" ) ------------------------------------------------------------------------------- Process can be configured on command line @@ -5090,13 +5107,15 @@ TestMain.cpp: TestMain.cpp:: PASSED: - CHECK_NOTHROW( parseIntoConfig( argv, config ) ) + CHECK( cli.parse({"test", "-e"}) ) +with expansion: + {?} TestMain.cpp:: PASSED: - REQUIRE( config.noThrow == true ) + REQUIRE( config.noThrow ) with expansion: - true == true + true ------------------------------------------------------------------------------- Process can be configured on command line @@ -5108,13 +5127,15 @@ TestMain.cpp: TestMain.cpp:: PASSED: - CHECK_NOTHROW( parseIntoConfig( argv, config ) ) + CHECK( cli.parse({"test", "--nothrow"}) ) +with expansion: + {?} TestMain.cpp:: PASSED: - REQUIRE( config.noThrow == true ) + REQUIRE( config.noThrow ) with expansion: - true == true + true ------------------------------------------------------------------------------- Process can be configured on command line @@ -5126,7 +5147,9 @@ TestMain.cpp: TestMain.cpp:: PASSED: - CHECK_NOTHROW( parseIntoConfig( argv, config ) ) + CHECK( cli.parse({"test", "-o", "filename.ext"}) ) +with expansion: + {?} TestMain.cpp:: PASSED: @@ -5144,7 +5167,9 @@ TestMain.cpp: TestMain.cpp:: PASSED: - CHECK_NOTHROW( parseIntoConfig( argv, config ) ) + CHECK( cli.parse({"test", "--out", "filename.ext"}) ) +with expansion: + {?} TestMain.cpp:: PASSED: @@ -5162,7 +5187,9 @@ TestMain.cpp: TestMain.cpp:: PASSED: - CHECK_NOTHROW( parseIntoConfig( argv, config ) ) + CHECK( cli.parse({"test", "-abe"}) ) +with expansion: + {?} TestMain.cpp:: PASSED: @@ -5192,7 +5219,9 @@ TestMain.cpp: TestMain.cpp:: PASSED: - CHECK_NOTHROW( parseIntoConfig( argv, config ) ) + CHECK( cli.parse({"test"}) ) +with expansion: + {?} TestMain.cpp:: PASSED: @@ -5210,7 +5239,9 @@ TestMain.cpp: TestMain.cpp:: PASSED: - CHECK_NOTHROW( parseIntoConfig( argv, config ) ) + CHECK( cli.parse({"test", "--use-colour", "auto"}) ) +with expansion: + {?} TestMain.cpp:: PASSED: @@ -5228,7 +5259,9 @@ TestMain.cpp: TestMain.cpp:: PASSED: - CHECK_NOTHROW( parseIntoConfig( argv, config ) ) + CHECK( cli.parse({"test", "--use-colour", "yes"}) ) +with expansion: + {?} TestMain.cpp:: PASSED: @@ -5246,7 +5279,9 @@ TestMain.cpp: TestMain.cpp:: PASSED: - CHECK_NOTHROW( parseIntoConfig( argv, config ) ) + CHECK( cli.parse({"test", "--use-colour", "no"}) ) +with expansion: + {?} TestMain.cpp:: PASSED: @@ -5264,7 +5299,16 @@ TestMain.cpp: TestMain.cpp:: PASSED: - REQUIRE_THROWS_WITH( parseIntoConfig( argv, config ), Contains( "colour mode must be one of" ) ) + CHECK( !result ) +with expansion: + true + +TestMain.cpp:: +PASSED: + CHECK_THAT( result.errorMessage(), Contains( "colour mode must be one of" ) ) +with expansion: + "colour mode must be one of: auto, yes or no. 'wrong' not recognised" + contains: "colour mode must be one of" ------------------------------------------------------------------------------- Reconstruction should be based on stringification: #914 @@ -8309,5 +8353,5 @@ PASSED: =============================================================================== test cases: 171 | 120 passed | 47 failed | 4 failed as expected -assertions: 845 | 728 passed | 96 failed | 21 failed as expected +assertions: 846 | 729 passed | 96 failed | 21 failed as expected diff --git a/projects/SelfTest/Baselines/junit.sw.approved.txt b/projects/SelfTest/Baselines/junit.sw.approved.txt index 8f2cd749..cae1e4bf 100644 --- a/projects/SelfTest/Baselines/junit.sw.approved.txt +++ b/projects/SelfTest/Baselines/junit.sw.approved.txt @@ -1,6 +1,6 @@ - + @@ -458,7 +458,6 @@ MessageTests.cpp: - diff --git a/projects/SelfTest/Baselines/xml.sw.approved.txt b/projects/SelfTest/Baselines/xml.sw.approved.txt index 130cda8a..948cff19 100644 --- a/projects/SelfTest/Baselines/xml.sw.approved.txt +++ b/projects/SelfTest/Baselines/xml.sw.approved.txt @@ -5325,12 +5325,12 @@ re>"
- + - parser.parseInto( std::vector<std::string>(), config ) + result - parser.parseInto( std::vector<std::string>(), config ) + {?} @@ -5344,12 +5344,12 @@ re>"
- + - parseIntoConfig( argv, config ) + result - parseIntoConfig( argv, config ) + {?} @@ -5396,17 +5396,17 @@ re>"
- + - parseIntoConfig( argv, config ) + result - parseIntoConfig( argv, config ) + {?} - cfg.testSpec().matches( fakeTestCase( "notIncluded" ) ) == false + cfg.testSpec().matches(fakeTestCase("notIncluded")) == false false == false @@ -5414,7 +5414,7 @@ re>" - cfg.testSpec().matches( fakeTestCase( "test1" ) ) + cfg.testSpec().matches(fakeTestCase("test1")) true @@ -5426,17 +5426,17 @@ re>"
- + - parseIntoConfig( argv, config ) + result - parseIntoConfig( argv, config ) + {?} - cfg.testSpec().matches( fakeTestCase( "test1" ) ) == false + cfg.testSpec().matches(fakeTestCase("test1")) == false false == false @@ -5444,7 +5444,7 @@ re>" - cfg.testSpec().matches( fakeTestCase( "alwaysIncluded" ) ) + cfg.testSpec().matches(fakeTestCase("alwaysIncluded")) true @@ -5456,17 +5456,17 @@ re>"
- + - parseIntoConfig( argv, config ) + result - parseIntoConfig( argv, config ) + {?} - cfg.testSpec().matches( fakeTestCase( "test1" ) ) == false + cfg.testSpec().matches(fakeTestCase("test1")) == false false == false @@ -5474,7 +5474,7 @@ re>" - cfg.testSpec().matches( fakeTestCase( "alwaysIncluded" ) ) + cfg.testSpec().matches(fakeTestCase("alwaysIncluded")) true @@ -5486,12 +5486,12 @@ re>"
- + - parseIntoConfig( argv, config ) + cli.parse({"test", "-r", "console"}) - parseIntoConfig( argv, config ) + {?} @@ -5508,12 +5508,12 @@ re>"
- + - parseIntoConfig( argv, config ) + cli.parse({"test", "-r", "xml"}) - parseIntoConfig( argv, config ) + {?} @@ -5530,12 +5530,12 @@ re>"
- + - parseIntoConfig( argv, config ) + cli.parse({"test", "-r", "xml", "-r", "junit"}) - parseIntoConfig( argv, config ) + {?} @@ -5568,12 +5568,12 @@ re>"
- + - parseIntoConfig( argv, config ) + cli.parse({"test", "--reporter", "junit"}) - parseIntoConfig( argv, config ) + {?} @@ -5590,12 +5590,12 @@ re>"
- + - parseIntoConfig( argv, config ) + cli.parse({"test", "-b"}) - parseIntoConfig( argv, config ) + {?} @@ -5612,12 +5612,12 @@ re>"
- + - parseIntoConfig( argv, config ) + cli.parse({"test", "--break"}) - parseIntoConfig( argv, config ) + {?} @@ -5634,12 +5634,12 @@ re>"
- + - parseIntoConfig( argv, config ) + cli.parse({"test", "-a"}) - parseIntoConfig( argv, config ) + {?} @@ -5656,12 +5656,12 @@ re>"
- + - parseIntoConfig( argv, config ) + cli.parse({"test", "-x", "2"}) - parseIntoConfig( argv, config ) + {?} @@ -5676,52 +5676,44 @@ re>"
-
-
- - - parseIntoConfigAndReturnError( argv, config ), Contains( "greater than zero" ) - - - "Value after -x or --abortAfter must be greater than zero -- while parsing: (-x, --abortx <no. failures>)" contains: "greater than zero" - - - -
- -
- + - parseIntoConfigAndReturnError( argv, config ), Contains( "-x" ) + !result - "Unable to convert oops to destination type -- while parsing: (-x, --abortx <no. failures>)" contains: "-x" + true - + + + result.errorMessage(), Contains("convert") && Contains("oops") + + + "Unable to convert 'oops' to destination type" ( contains: "convert" and contains: "oops" ) + + +
- +
- + - parseIntoConfig( argv, config ) + cli.parse({"test", "-e"}) - parseIntoConfig( argv, config ) + {?} - config.noThrow == true + config.noThrow - true == true + true @@ -5730,20 +5722,20 @@ re>"
- + - parseIntoConfig( argv, config ) + cli.parse({"test", "--nothrow"}) - parseIntoConfig( argv, config ) + {?} - config.noThrow == true + config.noThrow - true == true + true @@ -5752,12 +5744,12 @@ re>"
- + - parseIntoConfig( argv, config ) + cli.parse({"test", "-o", "filename.ext"}) - parseIntoConfig( argv, config ) + {?} @@ -5774,12 +5766,12 @@ re>"
- + - parseIntoConfig( argv, config ) + cli.parse({"test", "--out", "filename.ext"}) - parseIntoConfig( argv, config ) + {?} @@ -5796,12 +5788,12 @@ re>"
- + - parseIntoConfig( argv, config ) + cli.parse({"test", "-abe"}) - parseIntoConfig( argv, config ) + {?} @@ -5834,12 +5826,12 @@ re>"
- + - parseIntoConfig( argv, config ) + cli.parse({"test"}) - parseIntoConfig( argv, config ) + {?} @@ -5856,12 +5848,12 @@ re>"
- + - parseIntoConfig( argv, config ) + cli.parse({"test", "--use-colour", "auto"}) - parseIntoConfig( argv, config ) + {?} @@ -5878,12 +5870,12 @@ re>"
- + - parseIntoConfig( argv, config ) + cli.parse({"test", "--use-colour", "yes"}) - parseIntoConfig( argv, config ) + {?} @@ -5900,12 +5892,12 @@ re>"
- + - parseIntoConfig( argv, config ) + cli.parse({"test", "--use-colour", "no"}) - parseIntoConfig( argv, config ) + {?} @@ -5922,17 +5914,25 @@ re>"
- + - parseIntoConfig( argv, config ), Contains( "colour mode must be one of" ) + !result - parseIntoConfig( argv, config ), Contains( "colour mode must be one of" ) + true - + + + result.errorMessage(), Contains( "colour mode must be one of" ) + + + "colour mode must be one of: auto, yes or no. 'wrong' not recognised" contains: "colour mode must be one of" + + +
- +
@@ -9166,7 +9166,7 @@ spanner
- + - +