From 1faccd601d904a951142d8fba82914a8325b764e Mon Sep 17 00:00:00 2001 From: MaciejPatro Date: Fri, 19 Oct 2018 12:46:06 +0200 Subject: [PATCH] Improve path normalization for approvalTests.py This fixes 3 problems: * Relative paths on Windows are now supported * Out-of-tree (paths starting with ../) builds are now supported * Path separator normalization no longer affects non-path components of input (problem with Compact reporter) Fixes #1379 Fixes #1222 Fixes #1200 Fixes #1194 --- .../Baselines/compact.sw.approved.txt | 128 +++++++++--------- scripts/approvalTests.py | 18 ++- 2 files changed, 79 insertions(+), 67 deletions(-) diff --git a/projects/SelfTest/Baselines/compact.sw.approved.txt b/projects/SelfTest/Baselines/compact.sw.approved.txt index 91674957..767cb567 100644 --- a/projects/SelfTest/Baselines/compact.sw.approved.txt +++ b/projects/SelfTest/Baselines/compact.sw.approved.txt @@ -224,16 +224,16 @@ Tricky.tests.cpp:: passed: y.v == 0 for: 0 == 0 Tricky.tests.cpp:: passed: 0 == y.v for: 0 == 0 ToStringGeneral.tests.cpp:: passed: true with 1 message: 'i := 2' ToStringGeneral.tests.cpp:: passed: true with 1 message: '3' -ToStringGeneral.tests.cpp:: passed: tab == '/t' for: '/t' == '/t' -ToStringGeneral.tests.cpp:: passed: newline == '/n' for: '/n' == '/n' -ToStringGeneral.tests.cpp:: passed: carr_return == '/r' for: '/r' == '/r' -ToStringGeneral.tests.cpp:: passed: form_feed == '/f' for: '/f' == '/f' +ToStringGeneral.tests.cpp:: passed: tab == '\t' for: '\t' == '\t' +ToStringGeneral.tests.cpp:: passed: newline == '\n' for: '\n' == '\n' +ToStringGeneral.tests.cpp:: passed: carr_return == '\r' for: '\r' == '\r' +ToStringGeneral.tests.cpp:: passed: form_feed == '\f' for: '\f' == '\f' ToStringGeneral.tests.cpp:: passed: space == ' ' for: ' ' == ' ' ToStringGeneral.tests.cpp:: passed: c == chars[i] for: 'a' == 'a' ToStringGeneral.tests.cpp:: passed: c == chars[i] for: 'z' == 'z' ToStringGeneral.tests.cpp:: passed: c == chars[i] for: 'A' == 'A' ToStringGeneral.tests.cpp:: passed: c == chars[i] for: 'Z' == 'Z' -ToStringGeneral.tests.cpp:: passed: null_terminator == '/0' for: 0 == 0 +ToStringGeneral.tests.cpp:: passed: null_terminator == '\0' for: 0 == 0 ToStringGeneral.tests.cpp:: passed: c == i for: 2 == 2 ToStringGeneral.tests.cpp:: passed: c == i for: 3 == 3 ToStringGeneral.tests.cpp:: passed: c == i for: 4 == 4 @@ -1067,50 +1067,50 @@ Xml.tests.cpp:: passed: encode( stringWithQuotes ) == stringWithQuo Xml.tests.cpp:: passed: encode( stringWithQuotes, Catch::XmlEncode::ForAttributes ) == "don't "quote" me on that" for: "don't "quote" me on that" == "don't "quote" me on that" -Xml.tests.cpp:: passed: encode( "[/x01]" ) == "[//x01]" for: "[/x01]" == "[/x01]" -Xml.tests.cpp:: passed: encode( "[/x7F]" ) == "[//x7F]" for: "[/x7F]" == "[/x7F]" +Xml.tests.cpp:: passed: encode( "[\x01]" ) == "[\\x01]" for: "[\x01]" == "[\x01]" +Xml.tests.cpp:: passed: encode( "[\x7F]" ) == "[\\x7F]" for: "[\x7F]" == "[\x7F]" Xml.tests.cpp:: passed: encode(u8"Here be 👾") == u8"Here be 👾" for: "Here be 👾" == "Here be 👾" Xml.tests.cpp:: passed: encode(u8"šš") == u8"šš" for: "šš" == "šš" -Xml.tests.cpp:: passed: encode("/xDF/xBF") == "/xDF/xBF" for: "߿" == "߿" -Xml.tests.cpp:: passed: encode("/xE0/xA0/x80") == "/xE0/xA0/x80" for: "ࠀ" == "ࠀ" -Xml.tests.cpp:: passed: encode("/xED/x9F/xBF") == "/xED/x9F/xBF" for: "퟿" == "퟿" -Xml.tests.cpp:: passed: encode("/xEE/x80/x80") == "/xEE/x80/x80" for: "" == "" -Xml.tests.cpp:: passed: encode("/xEF/xBF/xBF") == "/xEF/xBF/xBF" for: "￿" == "￿" -Xml.tests.cpp:: passed: encode("/xF0/x90/x80/x80") == "/xF0/x90/x80/x80" for: "𐀀" == "𐀀" -Xml.tests.cpp:: passed: encode("/xF4/x8F/xBF/xBF") == "/xF4/x8F/xBF/xBF" for: "􏿿" == "􏿿" -Xml.tests.cpp:: passed: encode("Here /xFF be 👾") == u8"Here //xFF be 👾" for: "Here /xFF be 👾" == "Here /xFF be 👾" -Xml.tests.cpp:: passed: encode("/xFF") == "//xFF" for: "/xFF" == "/xFF" -Xml.tests.cpp:: passed: encode("/xC5/xC5/xA0") == u8"//xC5Š" for: "/xC5Š" == "/xC5Š" -Xml.tests.cpp:: passed: encode("/xF4/x90/x80/x80") == u8"//xF4//x90//x80//x80" for: "/xF4/x90/x80/x80" == "/xF4/x90/x80/x80" -Xml.tests.cpp:: passed: encode("/xC0/x80") == u8"//xC0//x80" for: "/xC0/x80" == "/xC0/x80" -Xml.tests.cpp:: passed: encode("/xF0/x80/x80/x80") == u8"//xF0//x80//x80//x80" for: "/xF0/x80/x80/x80" == "/xF0/x80/x80/x80" -Xml.tests.cpp:: passed: encode("/xC1/xBF") == u8"//xC1//xBF" for: "/xC1/xBF" == "/xC1/xBF" -Xml.tests.cpp:: passed: encode("/xE0/x9F/xBF") == u8"//xE0//x9F//xBF" for: "/xE0/x9F/xBF" == "/xE0/x9F/xBF" -Xml.tests.cpp:: passed: encode("/xF0/x8F/xBF/xBF") == u8"//xF0//x8F//xBF//xBF" for: "/xF0/x8F/xBF/xBF" == "/xF0/x8F/xBF/xBF" -Xml.tests.cpp:: passed: encode("/xED/xA0/x80") == "/xED/xA0/x80" for: "" == "" -Xml.tests.cpp:: passed: encode("/xED/xAF/xBF") == "/xED/xAF/xBF" for: "" == "" -Xml.tests.cpp:: passed: encode("/xED/xB0/x80") == "/xED/xB0/x80" for: "" == "" -Xml.tests.cpp:: passed: encode("/xED/xBF/xBF") == "/xED/xBF/xBF" for: "" == "" -Xml.tests.cpp:: passed: encode("/x80") == u8"//x80" for: "/x80" == "/x80" -Xml.tests.cpp:: passed: encode("/x81") == u8"//x81" for: "/x81" == "/x81" -Xml.tests.cpp:: passed: encode("/xBC") == u8"//xBC" for: "/xBC" == "/xBC" -Xml.tests.cpp:: passed: encode("/xBF") == u8"//xBF" for: "/xBF" == "/xBF" -Xml.tests.cpp:: passed: encode("/xF5/x80/x80/x80") == u8"//xF5//x80//x80//x80" for: "/xF5/x80/x80/x80" == "/xF5/x80/x80/x80" -Xml.tests.cpp:: passed: encode("/xF6/x80/x80/x80") == u8"//xF6//x80//x80//x80" for: "/xF6/x80/x80/x80" == "/xF6/x80/x80/x80" -Xml.tests.cpp:: passed: encode("/xF7/x80/x80/x80") == u8"//xF7//x80//x80//x80" for: "/xF7/x80/x80/x80" == "/xF7/x80/x80/x80" -Xml.tests.cpp:: passed: encode("/xDE") == u8"//xDE" for: "/xDE" == "/xDE" -Xml.tests.cpp:: passed: encode("/xDF") == u8"//xDF" for: "/xDF" == "/xDF" -Xml.tests.cpp:: passed: encode("/xE0") == u8"//xE0" for: "/xE0" == "/xE0" -Xml.tests.cpp:: passed: encode("/xEF") == u8"//xEF" for: "/xEF" == "/xEF" -Xml.tests.cpp:: passed: encode("/xF0") == u8"//xF0" for: "/xF0" == "/xF0" -Xml.tests.cpp:: passed: encode("/xF4") == u8"//xF4" for: "/xF4" == "/xF4" -Xml.tests.cpp:: passed: encode("/xE0/x80") == u8"//xE0//x80" for: "/xE0/x80" == "/xE0/x80" -Xml.tests.cpp:: passed: encode("/xE0/xBF") == u8"//xE0//xBF" for: "/xE0/xBF" == "/xE0/xBF" -Xml.tests.cpp:: passed: encode("/xE1/x80") == u8"//xE1//x80" for: "/xE1/x80" == "/xE1/x80" -Xml.tests.cpp:: passed: encode("/xF0/x80") == u8"//xF0//x80" for: "/xF0/x80" == "/xF0/x80" -Xml.tests.cpp:: passed: encode("/xF4/x80") == u8"//xF4//x80" for: "/xF4/x80" == "/xF4/x80" -Xml.tests.cpp:: passed: encode("/xF0/x80/x80") == u8"//xF0//x80//x80" for: "/xF0/x80/x80" == "/xF0/x80/x80" -Xml.tests.cpp:: passed: encode("/xF4/x80/x80") == u8"//xF4//x80//x80" for: "/xF4/x80/x80" == "/xF4/x80/x80" +Xml.tests.cpp:: passed: encode("\xDF\xBF") == "\xDF\xBF" for: "߿" == "߿" +Xml.tests.cpp:: passed: encode("\xE0\xA0\x80") == "\xE0\xA0\x80" for: "ࠀ" == "ࠀ" +Xml.tests.cpp:: passed: encode("\xED\x9F\xBF") == "\xED\x9F\xBF" for: "퟿" == "퟿" +Xml.tests.cpp:: passed: encode("\xEE\x80\x80") == "\xEE\x80\x80" for: "" == "" +Xml.tests.cpp:: passed: encode("\xEF\xBF\xBF") == "\xEF\xBF\xBF" for: "￿" == "￿" +Xml.tests.cpp:: passed: encode("\xF0\x90\x80\x80") == "\xF0\x90\x80\x80" for: "𐀀" == "𐀀" +Xml.tests.cpp:: passed: encode("\xF4\x8F\xBF\xBF") == "\xF4\x8F\xBF\xBF" for: "􏿿" == "􏿿" +Xml.tests.cpp:: passed: encode("Here \xFF be 👾") == u8"Here \\xFF be 👾" for: "Here \xFF be 👾" == "Here \xFF be 👾" +Xml.tests.cpp:: passed: encode("\xFF") == "\\xFF" for: "\xFF" == "\xFF" +Xml.tests.cpp:: passed: encode("\xC5\xC5\xA0") == u8"\\xC5Š" for: "\xC5Š" == "\xC5Š" +Xml.tests.cpp:: passed: encode("\xF4\x90\x80\x80") == u8"\\xF4\\x90\\x80\\x80" for: "\xF4\x90\x80\x80" == "\xF4\x90\x80\x80" +Xml.tests.cpp:: passed: encode("\xC0\x80") == u8"\\xC0\\x80" for: "\xC0\x80" == "\xC0\x80" +Xml.tests.cpp:: passed: encode("\xF0\x80\x80\x80") == u8"\\xF0\\x80\\x80\\x80" for: "\xF0\x80\x80\x80" == "\xF0\x80\x80\x80" +Xml.tests.cpp:: passed: encode("\xC1\xBF") == u8"\\xC1\\xBF" for: "\xC1\xBF" == "\xC1\xBF" +Xml.tests.cpp:: passed: encode("\xE0\x9F\xBF") == u8"\\xE0\\x9F\\xBF" for: "\xE0\x9F\xBF" == "\xE0\x9F\xBF" +Xml.tests.cpp:: passed: encode("\xF0\x8F\xBF\xBF") == u8"\\xF0\\x8F\\xBF\\xBF" for: "\xF0\x8F\xBF\xBF" == "\xF0\x8F\xBF\xBF" +Xml.tests.cpp:: passed: encode("\xED\xA0\x80") == "\xED\xA0\x80" for: "" == "" +Xml.tests.cpp:: passed: encode("\xED\xAF\xBF") == "\xED\xAF\xBF" for: "" == "" +Xml.tests.cpp:: passed: encode("\xED\xB0\x80") == "\xED\xB0\x80" for: "" == "" +Xml.tests.cpp:: passed: encode("\xED\xBF\xBF") == "\xED\xBF\xBF" for: "" == "" +Xml.tests.cpp:: passed: encode("\x80") == u8"\\x80" for: "\x80" == "\x80" +Xml.tests.cpp:: passed: encode("\x81") == u8"\\x81" for: "\x81" == "\x81" +Xml.tests.cpp:: passed: encode("\xBC") == u8"\\xBC" for: "\xBC" == "\xBC" +Xml.tests.cpp:: passed: encode("\xBF") == u8"\\xBF" for: "\xBF" == "\xBF" +Xml.tests.cpp:: passed: encode("\xF5\x80\x80\x80") == u8"\\xF5\\x80\\x80\\x80" for: "\xF5\x80\x80\x80" == "\xF5\x80\x80\x80" +Xml.tests.cpp:: passed: encode("\xF6\x80\x80\x80") == u8"\\xF6\\x80\\x80\\x80" for: "\xF6\x80\x80\x80" == "\xF6\x80\x80\x80" +Xml.tests.cpp:: passed: encode("\xF7\x80\x80\x80") == u8"\\xF7\\x80\\x80\\x80" for: "\xF7\x80\x80\x80" == "\xF7\x80\x80\x80" +Xml.tests.cpp:: passed: encode("\xDE") == u8"\\xDE" for: "\xDE" == "\xDE" +Xml.tests.cpp:: passed: encode("\xDF") == u8"\\xDF" for: "\xDF" == "\xDF" +Xml.tests.cpp:: passed: encode("\xE0") == u8"\\xE0" for: "\xE0" == "\xE0" +Xml.tests.cpp:: passed: encode("\xEF") == u8"\\xEF" for: "\xEF" == "\xEF" +Xml.tests.cpp:: passed: encode("\xF0") == u8"\\xF0" for: "\xF0" == "\xF0" +Xml.tests.cpp:: passed: encode("\xF4") == u8"\\xF4" for: "\xF4" == "\xF4" +Xml.tests.cpp:: passed: encode("\xE0\x80") == u8"\\xE0\\x80" for: "\xE0\x80" == "\xE0\x80" +Xml.tests.cpp:: passed: encode("\xE0\xBF") == u8"\\xE0\\xBF" for: "\xE0\xBF" == "\xE0\xBF" +Xml.tests.cpp:: passed: encode("\xE1\x80") == u8"\\xE1\\x80" for: "\xE1\x80" == "\xE1\x80" +Xml.tests.cpp:: passed: encode("\xF0\x80") == u8"\\xF0\\x80" for: "\xF0\x80" == "\xF0\x80" +Xml.tests.cpp:: passed: encode("\xF4\x80") == u8"\\xF4\\x80" for: "\xF4\x80" == "\xF4\x80" +Xml.tests.cpp:: passed: encode("\xF0\x80\x80") == u8"\\xF0\\x80\\x80" for: "\xF0\x80\x80" == "\xF0\x80\x80" +Xml.tests.cpp:: passed: encode("\xF4\x80\x80") == u8"\\xF4\\x80\\x80" for: "\xF4\x80\x80" == "\xF4\x80\x80" ToStringVector.tests.cpp:: passed: Catch::Detail::stringify( empty ) == "{ }" for: "{ }" == "{ }" ToStringVector.tests.cpp:: passed: Catch::Detail::stringify( oneValue ) == "{ 42 }" for: "{ 42 }" == "{ 42 }" ToStringVector.tests.cpp:: passed: Catch::Detail::stringify( twoValues ) == "{ 42, 250 }" for: "{ 42, 250 }" == "{ 42, 250 }" @@ -1170,7 +1170,7 @@ Misc.tests.cpp:: passed: Misc.tests.cpp:: passed: makeString( false ) != static_cast(0) for: "valid string" != {null string} Misc.tests.cpp:: passed: makeString( true ) == static_cast(0) for: {null string} == {null string} Tricky.tests.cpp:: passed: ptr.get() == 0 for: 0 == 0 -ToStringPair.tests.cpp:: passed: ::Catch::Detail::stringify( pair ) == "{ { 42, /"Arthur/" }, { /"Ford/", 24 } }" for: "{ { 42, "Arthur" }, { "Ford", 24 } }" +ToStringPair.tests.cpp:: passed: ::Catch::Detail::stringify( pair ) == "{ { 42, \"Arthur\" }, { \"Ford\", 24 } }" for: "{ { 42, "Arthur" }, { "Ford", 24 } }" == "{ { 42, "Arthur" }, { "Ford", 24 } }" Tricky.tests.cpp:: passed: p == 0 for: 0 == 0 @@ -1194,18 +1194,18 @@ String.tests.cpp:: passed: s == "didn|'t" for: "didn|'t" == "didn|' Misc.tests.cpp:: failed: false with 1 message: '3' Message.tests.cpp:: failed: false with 2 messages: 'hi' and 'i := 7' ToStringGeneral.tests.cpp:: passed: Catch::Detail::stringify( emptyMap ) == "{ }" for: "{ }" == "{ }" -ToStringGeneral.tests.cpp:: passed: Catch::Detail::stringify( map ) == "{ { /"one/", 1 } }" for: "{ { "one", 1 } }" == "{ { "one", 1 } }" -ToStringGeneral.tests.cpp:: passed: Catch::Detail::stringify( map ) == "{ { /"abc/", 1 }, { /"def/", 2 }, { /"ghi/", 3 } }" for: "{ { "abc", 1 }, { "def", 2 }, { "ghi", 3 } }" +ToStringGeneral.tests.cpp:: passed: Catch::Detail::stringify( map ) == "{ { \"one\", 1 } }" for: "{ { "one", 1 } }" == "{ { "one", 1 } }" +ToStringGeneral.tests.cpp:: passed: Catch::Detail::stringify( map ) == "{ { \"abc\", 1 }, { \"def\", 2 }, { \"ghi\", 3 } }" for: "{ { "abc", 1 }, { "def", 2 }, { "ghi", 3 } }" == "{ { "abc", 1 }, { "def", 2 }, { "ghi", 3 } }" -ToStringPair.tests.cpp:: passed: ::Catch::Detail::stringify(value) == "{ 34, /"xyzzy/" }" for: "{ 34, "xyzzy" }" == "{ 34, "xyzzy" }" -ToStringPair.tests.cpp:: passed: ::Catch::Detail::stringify( value ) == "{ 34, /"xyzzy/" }" for: "{ 34, "xyzzy" }" == "{ 34, "xyzzy" }" +ToStringPair.tests.cpp:: passed: ::Catch::Detail::stringify(value) == "{ 34, \"xyzzy\" }" for: "{ 34, "xyzzy" }" == "{ 34, "xyzzy" }" +ToStringPair.tests.cpp:: passed: ::Catch::Detail::stringify( value ) == "{ 34, \"xyzzy\" }" for: "{ 34, "xyzzy" }" == "{ 34, "xyzzy" }" ToStringGeneral.tests.cpp:: passed: Catch::Detail::stringify( emptySet ) == "{ }" for: "{ }" == "{ }" -ToStringGeneral.tests.cpp:: passed: Catch::Detail::stringify( set ) == "{ /"one/" }" for: "{ "one" }" == "{ "one" }" -ToStringGeneral.tests.cpp:: passed: Catch::Detail::stringify( set ) == "{ /"abc/", /"def/", /"ghi/" }" for: "{ "abc", "def", "ghi" }" +ToStringGeneral.tests.cpp:: passed: Catch::Detail::stringify( set ) == "{ \"one\" }" for: "{ "one" }" == "{ "one" }" +ToStringGeneral.tests.cpp:: passed: Catch::Detail::stringify( set ) == "{ \"abc\", \"def\", \"ghi\" }" for: "{ "abc", "def", "ghi" }" == "{ "abc", "def", "ghi" }" -ToStringPair.tests.cpp:: passed: ::Catch::Detail::stringify( pr ) == "{ { /"green/", 55 } }" for: "{ { "green", 55 } }" +ToStringPair.tests.cpp:: passed: ::Catch::Detail::stringify( pr ) == "{ { \"green\", 55 } }" for: "{ { "green", 55 } }" == "{ { "green", 55 } }" Tricky.tests.cpp:: failed: std::string( "first" ) == "second" for: "first" == "second" @@ -1244,10 +1244,10 @@ Generators.tests.cpp:: passed: data.str.size() == data.len for: 3 = Generators.tests.cpp:: passed: data.str.size() == data.len for: 5 == 5 Generators.tests.cpp:: passed: data.str.size() == data.len for: 4 == 4 Exception.tests.cpp:: failed: unexpected exception with message: 'Why would you throw a std::string?' -Misc.tests.cpp:: passed: result == "/"wide load/"" for: ""wide load"" == ""wide load"" -Misc.tests.cpp:: passed: result == "/"wide load/"" for: ""wide load"" == ""wide load"" -Misc.tests.cpp:: passed: result == "/"wide load/"" for: ""wide load"" == ""wide load"" -Misc.tests.cpp:: passed: result == "/"wide load/"" for: ""wide load"" == ""wide load"" +Misc.tests.cpp:: passed: result == "\"wide load\"" for: ""wide load"" == ""wide load"" +Misc.tests.cpp:: passed: result == "\"wide load\"" for: ""wide load"" == ""wide load"" +Misc.tests.cpp:: passed: result == "\"wide load\"" for: ""wide load"" == ""wide load"" +Misc.tests.cpp:: passed: result == "\"wide load\"" for: ""wide load"" == ""wide load"" EnumToString.tests.cpp:: passed: ::Catch::Detail::stringify(e0) == "E2/V0" for: "E2/V0" == "E2/V0" EnumToString.tests.cpp:: passed: ::Catch::Detail::stringify(e1) == "E2/V1" for: "E2/V1" == "E2/V1" EnumToString.tests.cpp:: passed: ::Catch::Detail::stringify(e3) == "Unknown enum value 10" for: "Unknown enum value 10" @@ -1264,17 +1264,17 @@ ToStringTuple.tests.cpp:: passed: "{ }" == ::Catch::Detail::stringi ToStringTuple.tests.cpp:: passed: "1.2f" == ::Catch::Detail::stringify(float(1.2)) for: "1.2f" == "1.2f" ToStringTuple.tests.cpp:: passed: "{ 1.2f, 0 }" == ::Catch::Detail::stringify(type{1.2f,0}) for: "{ 1.2f, 0 }" == "{ 1.2f, 0 }" ToStringTuple.tests.cpp:: passed: "{ 0 }" == ::Catch::Detail::stringify(type{0}) for: "{ 0 }" == "{ 0 }" -ToStringTuple.tests.cpp:: passed: "{ 0, 42, /"Catch me/" }" == ::Catch::Detail::stringify(value) for: "{ 0, 42, "Catch me" }" +ToStringTuple.tests.cpp:: passed: "{ 0, 42, \"Catch me\" }" == ::Catch::Detail::stringify(value) for: "{ 0, 42, "Catch me" }" == "{ 0, 42, "Catch me" }" -ToStringTuple.tests.cpp:: passed: "{ /"hello/", /"world/" }" == ::Catch::Detail::stringify(type{"hello","world"}) for: "{ "hello", "world" }" +ToStringTuple.tests.cpp:: passed: "{ \"hello\", \"world\" }" == ::Catch::Detail::stringify(type{"hello","world"}) for: "{ "hello", "world" }" == "{ "hello", "world" }" ToStringTuple.tests.cpp:: passed: "{ { 42 }, { }, 1.2f }" == ::Catch::Detail::stringify(value) for: "{ { 42 }, { }, 1.2f }" == "{ { 42 }, { }, 1.2f }" ToStringVector.tests.cpp:: passed: ::Catch::Detail::stringify(v) == "{ }" for: "{ }" == "{ }" -ToStringVector.tests.cpp:: passed: ::Catch::Detail::stringify(v) == "{ { /"hello/" }, { /"world/" } }" for: "{ { "hello" }, { "world" } }" +ToStringVector.tests.cpp:: passed: ::Catch::Detail::stringify(v) == "{ { \"hello\" }, { \"world\" } }" for: "{ { "hello" }, { "world" } }" == "{ { "hello" }, { "world" } }" ToStringVector.tests.cpp:: passed: ::Catch::Detail::stringify(bools) == "{ }" for: "{ }" == "{ }" @@ -1287,8 +1287,8 @@ ToStringVector.tests.cpp:: passed: ::Catch::Detail::stringify(vv) = ToStringVector.tests.cpp:: passed: ::Catch::Detail::stringify(vv) == "{ 42 }" for: "{ 42 }" == "{ 42 }" ToStringVector.tests.cpp:: passed: ::Catch::Detail::stringify(vv) == "{ 42, 250 }" for: "{ 42, 250 }" == "{ 42, 250 }" ToStringVector.tests.cpp:: passed: ::Catch::Detail::stringify(vv) == "{ }" for: "{ }" == "{ }" -ToStringVector.tests.cpp:: passed: ::Catch::Detail::stringify(vv) == "{ /"hello/" }" for: "{ "hello" }" == "{ "hello" }" -ToStringVector.tests.cpp:: passed: ::Catch::Detail::stringify(vv) == "{ /"hello/", /"world/" }" for: "{ "hello", "world" }" +ToStringVector.tests.cpp:: passed: ::Catch::Detail::stringify(vv) == "{ \"hello\" }" for: "{ "hello" }" == "{ "hello" }" +ToStringVector.tests.cpp:: passed: ::Catch::Detail::stringify(vv) == "{ \"hello\", \"world\" }" for: "{ "hello", "world" }" == "{ "hello", "world" }" Misc.tests.cpp:: passed: v.size() == 5 for: 5 == 5 diff --git a/scripts/approvalTests.py b/scripts/approvalTests.py index 3167fd76..bb01e6d5 100755 --- a/scripts/approvalTests.py +++ b/scripts/approvalTests.py @@ -18,7 +18,7 @@ if os.name == 'nt': rootPath = os.path.join(catchPath, 'projects/SelfTest/Baselines') - +langFilenameParser = re.compile(r'(.+\.[ch]pp)') filelocParser = re.compile(r''' .*/ (.+\.[ch]pp) # filename @@ -91,12 +91,24 @@ def diffFiles(fileA, fileB): return [line for line in diff if line[0] in ('+', '-')] -def filterLine(line, isCompact): +def normalizeFilepath(line): if catchPath in line: # make paths relative to Catch root line = line.replace(catchPath + os.sep, '') + + m = langFilenameParser.match(line) + if m: + filepath = m.group(0) # go from \ in windows paths to / - line = line.replace('\\', '/') + filepath = filepath.replace('\\', '/') + # remove start of relative path + filepath = filepath.replace('../', '') + line = line[:m.start()] + filepath + line[m.end():] + + return line + +def filterLine(line, isCompact): + line = normalizeFilepath(line) # strip source line numbers m = filelocParser.match(line)