[Git][NTPsec/ntpsec][testutil-fix] 3 commits: waf: improve test for unsupported CC flags.

Eric S. Raymond gitlab at mg.gitlab.com
Mon May 8 20:28:24 UTC 2017


Eric S. Raymond pushed to branch testutil-fix at NTPsec / ntpsec


Commits:
ee3bcbf3 by Gary E. Miller at 2017-05-08T13:04:59-07:00
waf: improve test for unsupported CC flags.

- - - - -
eeda59af by Gary E. Miller at 2017-05-08T13:08:08-07:00
waf: Add conditional -Wimplicit-fallthrough to --enable-debug-warnings.

- - - - -
f108c7da by Ian Bruene at 2017-05-08T20:27:59+00:00
Fixed unicode errors in tests.

Tests still used the old \u unicode escapes, instead of the literal strings.

- - - - -


2 changed files:

- tests/pylib/test_util.py
- wscript


Changes:

=====================================
tests/pylib/test_util.py
=====================================
--- a/tests/pylib/test_util.py
+++ b/tests/pylib/test_util.py
@@ -177,7 +177,7 @@ class TestPylibUtilMethods(unittest.TestCase):
         nu = ntp.util
 
         # Zero
-        self.assertEqual(f("0.000", nu.UNIT_MS), u"     0\u03bcs")
+        self.assertEqual(f("0.000", nu.UNIT_MS), u"     0µs")
         # Standard, width=8
         self.assertEqual(f("1.234", nu.UNIT_MS), " 1.234ms")
         # ditto, negative
@@ -187,9 +187,9 @@ class TestPylibUtilMethods(unittest.TestCase):
         # ditto, negative
         self.assertEqual(f("-1234.5", nu.UNIT_MS), "-1.2345s")
         # Scale to smaller unit, width=8
-        self.assertEqual(f("0.01234", nu.UNIT_MS), u" 12.34\u03bcs")
+        self.assertEqual(f("0.01234", nu.UNIT_MS), u" 12.34µs")
         # ditto, negative
-        self.assertEqual(f("-0.01234", nu.UNIT_MS), u"-12.34\u03bcs")
+        self.assertEqual(f("-0.01234", nu.UNIT_MS), u"-12.34µs")
         # At baseunit
         self.assertEqual(f("12.0", nu.UNIT_NS), "    12ns")
         # Scale to baseunit
@@ -226,7 +226,7 @@ class TestPylibUtilMethods(unittest.TestCase):
         self.assertEqual(ntp.util.stringfiltcooker(
             "0.470 0.420 0.430 0.500 0.460 0.4200 0.490 0.480"),
             u"    470     420     430     500     460   420.0     490     "
-            "480 \u03bcs")
+            u"480 µs")
         # Can't scale
         self.assertEqual(ntp.util.stringfiltcooker(
             "0.47 0.42 0.43 0.50 0.46 0.42 0.49 0.48"),


=====================================
wscript
=====================================
--- a/wscript
+++ b/wscript
@@ -61,7 +61,8 @@ def configure(ctx):
                 self.logger.debug('WafError')
                 return e.returncode
             if (len(out) and any(word in out for word
-                                 in ['err', 'ignored', 'illegal', 'unknown',
+                                 in ['err', 'err:', 'error', 'error:',
+                                     'ignored', 'illegal', 'unknown',
                                      'unrecognized', 'warning'])):
                 self.logger.debug('noooo %r' % out)
                 return 1
@@ -364,6 +365,7 @@ def configure(ctx):
             "-Wswitch-default",       # warns on Bison bug
         ] + ctx.env.CFLAGS
         cc_test_flags += [
+            ('w_implicit_fallthru', "-Wimplicit-fallthrough=3"),
             # fails on Solaris and OpenBSD 6
             # complains about a Bison bug
             ('w_sign_conversion', "-Wsign-conversion"),
@@ -435,6 +437,8 @@ int main(int argc, char **argv) {
         ctx.env.CFLAGS = ["-flto"] + ctx.env.CFLAGS
 
     # debug warnings that are not available with all compilers
+    if ctx.env.HAS_w_implicit_fallthru:
+        ctx.env.CFLAGS = ['-Wimplicit-fallthrough=3'] + ctx.env.CFLAGS
     if ctx.env.HAS_w_suggest_attribute_const:
         ctx.env.CFLAGS = ['-Wsuggest-attribute=const'] + ctx.env.CFLAGS
     if ctx.env.HAS_w_suggest_attribute_noreturn:



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/compare/90420215838756b1ff495ec4e3507591ae6af689...f108c7da832f70afa52182e25f21df234022d165

---
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/compare/90420215838756b1ff495ec4e3507591ae6af689...f108c7da832f70afa52182e25f21df234022d165
You're receiving this email because of your account on gitlab.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20170508/aad7b6cc/attachment.html>


More information about the vc mailing list