[Git][NTPsec/ntpsec][master] Updated waf to 1.9.14, added python tests to build script
Ian Bruene
gitlab at mg.gitlab.com
Sat Dec 2 17:46:20 UTC 2017
Ian Bruene pushed to branch master at NTPsec / ntpsec
Commits:
4d54f91a by Ian Bruene at 2017-12-02T17:44:19+00: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/4d54f91a69925012862947786b8f07144018272b
---
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/4d54f91a69925012862947786b8f07144018272b
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/7e06f27a/attachment.html>
More information about the vc
mailing list