[Git][NTPsec/ntpsec][buildtest] Updated waf to 1.9.14, added python tests to build script

Ian Bruene gitlab at mg.gitlab.com
Sat Dec 2 17:30:26 UTC 2017


Ian Bruene pushed to branch buildtest at NTPsec / ntpsec


Commits:
16ea62ce by Ian Bruene at 2017-12-02T11:29:35-06:00
Updated waf to 1.9.14, added python tests to build script

- - - - -


3 changed files:

- tests/wscript
- waf
- wscript


Changes:

=====================================
tests/wscript
=====================================
--- a/tests/wscript
+++ b/tests/wscript
@@ -1,8 +1,10 @@
+import os
 from waflib import Utils  # pylint: disable=import-error
 
 def build(ctx):
     srcnode = ctx.srcnode.abspath()
     testsrc = ctx.srcnode.make_node('tests')
+    pylib = ctx.srcnode.make_node('pylib')
     testpylib = testsrc.make_node('pylib')
     testpysrc = testpylib.ant_glob('*.py')
 
@@ -114,12 +116,43 @@ def build(ctx):
 
     testpylib.get_bld().mkdir()
 
+    pypath = pylib.get_bld()
+    linkpath = ctx.bldnode.make_node("tests/pylib/ntp")
+    if (not linkpath.exists()) or os.readlink(linkpath.abspath()):
+        try:
+            os.remove(linkpath.abspath())
+        except OSError:
+            pass
+        os.symlink(pypath.abspath(), linkpath.abspath())
+
+    ctx(
+        features="pytest",
+        pytest_source="pylib/test_util.py",
+        pytest_paths=pypath,
+		ut_str="${PYTHON} ${SRC}"
+    )
+    ctx(
+        features="pytest",
+        pytest_source="pylib/test_agentx.py",
+        pytest_paths=pypath,
+		ut_str="${PYTHON} ${SRC}"
+    )
+    ctx(
+        features="pytest",
+        pytest_source="pylib/test_packet.py",
+        pytest_paths=pypath,
+		ut_str="${PYTHON} ${SRC}"
+    )
+    ctx(
+        features="pytest",
+        pytest_source="pylib/test_statfiles.py",
+        pytest_paths=pypath,
+		ut_str="${PYTHON} ${SRC}"
+    )
+
     ctx(
         features="subst",
         source=testpysrc,
         target=[x.get_bld() for x in testpysrc],
         chmod=Utils.O755,
     )
-
-    # ctx.exec_command("%s/tests/pylib/test_statfiles.py" % srcnode)
-    # ctx.exec_command("%s/tests/pylib/test_util.py" % srcnode)


=====================================
waf
=====================================
The diff for this file was not included because it is too large.

=====================================
wscript
=====================================
--- a/wscript
+++ b/wscript
@@ -16,6 +16,7 @@ from waflib.Context import BOTH
 from waflib.Errors import WafError
 from waflib.Logs import pprint
 from waflib.Tools import waf_unit_test
+from waflib.extras import pytest
 
 # Avoid writing .pyc files in wafhelpers/
 sys.dont_write_bytecode = True
@@ -91,6 +92,7 @@ def configure(ctx):
     ctx.run_build_cls = 'check'
     ctx.load('waf', tooldir='wafhelpers/')
     ctx.load('waf_unit_test')
+    ctx.load('pytest')
     ctx.load('gnu_dirs')
 
     with open("VERSION", "r") as f:



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/16ea62cece62580c36e45c1434ff488030817084

---
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/16ea62cece62580c36e45c1434ff488030817084
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/20171202/c6cccaad/attachment.html>


More information about the vc mailing list