[Git][NTPsec/ntpsec][20k-Nov22-install-test-fix] 2 commits: bin_test: remove check variable
James Browning
gitlab at mg.gitlab.com
Fri Nov 27 13:07:23 UTC 2020
James Browning pushed to branch 20k-Nov22-install-test-fix at NTPsec / ntpsec
Commits:
de009ceb by James Browning at 2020-11-27T04:57:01-08:00
bin_test: remove check variable
- - - - -
a20708bf by James Browning at 2020-11-27T05:05:07-08:00
bint_test: way too late reworking
- - - - -
1 changed file:
- wafhelpers/bin_test.py
Changes:
=====================================
wafhelpers/bin_test.py
=====================================
@@ -56,10 +56,9 @@ def bin_test_summary(_):
def run(cmd, expected, pythonic, apath=None, environ=None):
"""Run an individual test."""
- check = False
odir = apath if apath else waflib.Context.out_dir
- environ = {} if environ is None else environ
+ environ = environ is isinstance(environ, dict) else {}
if apath:
cmd = [os.sep.join(['.'] + cmd[0].split(os.sep)[-1:])] + list(cmd[1:])
prefix = "running: " + " ".join(cmd)
@@ -80,11 +79,9 @@ def run(cmd, expected, pythonic, apath=None, environ=None):
stdout, stderr = p.communicate()
if expected in (stdout, stderr):
- check = True
-
- if check:
addLog("GREEN", prefix + " OK")
return True
+
addLog("RED", prefix + " FAILED")
addLog("PINK", "Expected: " + expected)
if stdout:
@@ -105,15 +102,17 @@ def cmd_bin_test(ctx):
path = spath = None
if ctx.cmd == 'install':
+ path, spath, env = None, None, None
pypath = destdir + ctx.env.PYTHONARCHDIR
libpath = destdir + ctx.env.LIBDIR
- env = {'PYTHONPATH': pypath,
- 'CTYPESDIR': libpath } if destdir != '/' else None
- path = destdir + os.sep if destdir != '/' else '/'
- spath = path + ctx.env.SBINDIR[1:] + os.sep
- path = path + ctx.env.BINDIR[1:] + os.sep
python_wrap = False
- addLog('BLUE', 'Following relative to: %s' % spath)
+ if destdir != '/':
+ path = destdir + os.sep if destdir != '/'
+ spath = path + ctx.env.SBINDIR[1:] + os.sep
+ path = path + ctx.env.BINDIR[1:] + os.sep
+ env = {'PYTHONPATH': pypath,
+ 'CTYPESDIR': libpath }
+ addLog('BLUE', 'Following relative to: %s' % spath)
if ctx.env['PYTHON_ARGPARSE']:
cmd_map_python.update(cmd_map_python_argparse)
@@ -126,7 +125,7 @@ def cmd_bin_test(ctx):
fails = fails + 1 if status is False else fails
skips = skips + 1 if status is None else skips
- if ctx.cmd == 'install':
+ if ctx.cmd == 'install' and destdir != '/':
addLog('BLUE', 'Following relative to: %s' % path)
for cmd in sorted(cmd_map):
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/-/compare/1cb50125b5c32b19c673285a0daa8c83d6cea59b...a20708bf53554d241ee07aafba4d5b2e67fc673a
--
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/-/compare/1cb50125b5c32b19c673285a0daa8c83d6cea59b...a20708bf53554d241ee07aafba4d5b2e67fc673a
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/20201127/e3c04aa8/attachment-0001.htm>
More information about the vc
mailing list