1 |
jcallen 15/07/31 22:46:23 |
2 |
|
3 |
Added: |
4 |
schroot-1.6.10-cmake-add-additional-regex-tests.patch |
5 |
Log: |
6 |
Add upstream patch to work with GCC 4.9 and GCC 5. Fixes bug 555648. Remove old. |
7 |
|
8 |
(Portage version: 2.2.20/cvs/Linux x86_64, signed Manifest commit with key 229E5838) |
9 |
|
10 |
Revision Changes Path |
11 |
1.1 dev-util/schroot/files/schroot-1.6.10-cmake-add-additional-regex-tests.patch |
12 |
|
13 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-util/schroot/files/schroot-1.6.10-cmake-add-additional-regex-tests.patch?rev=1.1&view=markup |
14 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-util/schroot/files/schroot-1.6.10-cmake-add-additional-regex-tests.patch?rev=1.1&content-type=text/plain |
15 |
|
16 |
Index: schroot-1.6.10-cmake-add-additional-regex-tests.patch |
17 |
=================================================================== |
18 |
From 8c9139249689570ff2f4d058ed1031f0cbb6c084 Mon Sep 17 00:00:00 2001 |
19 |
From: Roger Leigh <rleigh@×××××××××.net> |
20 |
Date: Sun, 26 Jul 2015 14:00:13 +0100 |
21 |
Subject: [PATCH] cmake: Add additional regex tests and corresponding unit |
22 |
tests |
23 |
|
24 |
--- |
25 |
cmake/regex-checks.cmake | 10 ++++++++++ |
26 |
test/sbuild-regex.cc | 20 ++++++++++++++++++++ |
27 |
2 files changed, 30 insertions(+) |
28 |
|
29 |
diff --git a/cmake/regex-checks.cmake b/cmake/regex-checks.cmake |
30 |
index d0bb211..60507ec 100644 |
31 |
--- a/cmake/regex-checks.cmake |
32 |
+++ b/cmake/regex-checks.cmake |
33 |
@@ -30,6 +30,16 @@ int main() { |
34 |
if (${namespace}_match(fail, bar)) return 11; |
35 |
if (${namespace}_match(fail, chk)) return 12; |
36 |
|
37 |
+ // Checks for broken support in GCC 4.9 and 5.1 |
38 |
+ ${namespace} range1(\"^[a-z0-9][a-z0-9-]*\$\", ${namespace}::extended); |
39 |
+ ${namespace} range2(\"^[a-z0-9][-a-z0-9]*\$\", ${namespace}::extended); |
40 |
+ if (!${namespace}_match(test, range1)) return 13; |
41 |
+ if (!${namespace}_match(test, range2)) return 14; |
42 |
+ if (!${namespace}_match(\"a-\", range1)) return 15; |
43 |
+ if (!${namespace}_match(\"a-\", range2)) return 16; |
44 |
+ if (${namespace}_match(\"-a\", range1)) return 17; |
45 |
+ if (${namespace}_match(\"-a\", range2)) return 18; |
46 |
+ |
47 |
return 0; |
48 |
}" |
49 |
${outvar}) |
50 |
diff --git a/test/sbuild-regex.cc b/test/sbuild-regex.cc |
51 |
index 915e915..a8520c5 100644 |
52 |
--- a/test/sbuild-regex.cc |
53 |
+++ b/test/sbuild-regex.cc |
54 |
@@ -33,6 +33,8 @@ class test_regex : public TestCase |
55 |
CPPUNIT_TEST(test_output); |
56 |
CPPUNIT_TEST(test_input); |
57 |
CPPUNIT_TEST(test_match); |
58 |
+ CPPUNIT_TEST(test_match_bracket1); |
59 |
+ CPPUNIT_TEST(test_match_bracket2); |
60 |
CPPUNIT_TEST_EXCEPTION(test_input_fail, std::regex_error); |
61 |
CPPUNIT_TEST_SUITE_END(); |
62 |
|
63 |
@@ -88,6 +90,24 @@ class test_regex : public TestCase |
64 |
} |
65 |
|
66 |
void |
67 |
+ test_match_bracket1() |
68 |
+ { |
69 |
+ sbuild::regex r("^[a-z0-9][a-z0-9-]*$"); |
70 |
+ CPPUNIT_ASSERT(sbuild::regex_search("foobar", r)); |
71 |
+ CPPUNIT_ASSERT(sbuild::regex_search("a-", r)); |
72 |
+ CPPUNIT_ASSERT(!sbuild::regex_search("-a", r)); |
73 |
+ } |
74 |
+ |
75 |
+ void |
76 |
+ test_match_bracket2() |
77 |
+ { |
78 |
+ sbuild::regex r("^[a-z0-9][-a-z0-9]*$"); |
79 |
+ CPPUNIT_ASSERT(sbuild::regex_search("foobar", r)); |
80 |
+ CPPUNIT_ASSERT(sbuild::regex_search("a-", r)); |
81 |
+ CPPUNIT_ASSERT(!sbuild::regex_search("-a", r)); |
82 |
+ } |
83 |
+ |
84 |
+ void |
85 |
test_input_fail() |
86 |
{ |
87 |
sbuild::regex r; |