[Git][NTPsec/ntpsec][master] bin_test: use universal_newlines instead of futzing w/ polystr -r2 ...
Matt Selsky
gitlab at mg.gitlab.com
Tue Aug 25 00:53:21 UTC 2020
Matt Selsky pushed to branch master at NTPsec / ntpsec
Commits:
3f7f795b by James Browning at 2020-08-24T17:17:05-07:00
bin_test: use universal_newlines instead of futzing w/ polystr -r2 ...
now with fewer brain farts
- - - - -
1 changed file:
- wafhelpers/bin_test.py
Changes:
=====================================
wafhelpers/bin_test.py
=====================================
@@ -7,7 +7,6 @@ import waflib.Context
import waflib.Logs
import waflib.Utils
sys.path.insert(0, "%s/main/tests/pylib" % waflib.Context.out_dir)
-import ntp.poly
import ntp.util
verStr = ntp.util.stdversion()
@@ -54,8 +53,6 @@ def run(cmd, reg, pythonic):
"""Run an individual non-python test."""
check = False
- breg = ntp.poly.polybytes(reg)
-
prefix = "running: " + " ".join(cmd)
if not os.path.exists("%s/%s" % (waflib.Context.out_dir, cmd[0])):
@@ -66,24 +63,25 @@ def run(cmd, reg, pythonic):
cmd = [sys.executable] + list(cmd)
p = waflib.Utils.subprocess.Popen(cmd, env={'PYTHONPATH': '%s/main/tests/pylib' %
waflib.Context.out_dir},
+ universal_newlines=True,
stdin=waflib.Utils.subprocess.PIPE,
stdout=waflib.Utils.subprocess.PIPE,
stderr=waflib.Utils.subprocess.PIPE, cwd=waflib.Context.out_dir)
stdout, stderr = p.communicate()
- if (stdout == breg) or (stderr == breg):
+ if (stdout == reg) or (stderr == reg):
check = True
if check:
addLog("GREEN", prefix + " OK")
return True
addLog("RED", prefix + " FAILED")
- addLog("PINK", "Expected: " + breg)
+ addLog("PINK", "Expected: " + reg)
if stdout:
- addLog("PINK", "Got (stdout): " + ntp.poly.polystr(stdout))
+ addLog("PINK", "Got (stdout): " + stdout)
if stderr:
- addLog("PINK", "Got (stderr): " + ntp.poly.polystr(stderr))
+ addLog("PINK", "Got (stderr): " + stderr)
return False
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/-/commit/3f7f795b9dae35bf11cf93a58eb487fb5ba77b49
--
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/-/commit/3f7f795b9dae35bf11cf93a58eb487fb5ba77b49
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/20200825/1c00a94b/attachment-0001.htm>
More information about the vc
mailing list