<html lang='en'>
<head>
<meta content='text/html; charset=utf-8' http-equiv='Content-Type'>
<title>
GitLab
</title>
</meta>
</head>
<style>
img {
max-width: 100%;
height: auto;
}
p.details {
font-style:italic;
color:#777
}
.footer p {
font-size:small;
color:#777
}
pre.commit-message {
white-space: pre-wrap;
}
.file-stats a {
text-decoration: none;
}
.file-stats .new-file {
color: #090;
}
.file-stats .deleted-file {
color: #B00;
}
</style>
<body>
<div class='content'>
<h3>Amar Takhar pushed to branch master at <a href="https://gitlab.com/NTPsec/ntpsec">NTPsec / ntpsec</a></h3>
<h4>
Commits:
</h4>
<ul>
<li>
<strong><a href="https://gitlab.com/NTPsec/ntpsec/commit/d0936a3942e3a1abd0f1f0977fe37ac8c859cd55">d0936a39</a></strong>
<div>
<span>by Amar Takhar</span>
<i>at 2015-11-30T09:56:51Z</i>
</div>
<pre class='commit-message'>Write test logs to $out/test.log
This fixes #23</pre>
</li>
<li>
<strong><a href="https://gitlab.com/NTPsec/ntpsec/commit/38cb66c7edcdbe6ef8024a4b971f957cd91646a7">38cb66c7</a></strong>
<div>
<span>by Amar Takhar</span>
<i>at 2015-11-30T10:01:12Z</i>
</div>
<pre class='commit-message'>Move test code to pylib/test.py</pre>
</li>
</ul>
<h4>2 changed files:</h4>
<ul>
<li class='file-stats'>
<a href='#diff-0'>
<span class='new-file'>
+
pylib/test.py
</span>
</a>
</li>
<li class='file-stats'>
<a href='#diff-1'>
wscript
</a>
</li>
</ul>
<h4>Changes:</h4>
<li id='diff-0'>
<a href='https://gitlab.com/NTPsec/ntpsec/compare/d96344411cc91969dcc1e742f64f8aba7802804d...38cb66c7edcdbe6ef8024a4b971f957cd91646a7#diff-0'>
<strong>
pylib/test.py
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- /dev/null
</span><span style="color: #000000;background-color: #ddffdd">+++ b/pylib/test.py
</span><span style="color: #aaaaaa">@@ -0,0 +1,38 @@
</span><span style="color: #000000;background-color: #ddffdd">+from waflib.Logs import pprint
+
+def test_write_log(ctx):
+ file_out = "%s/test.log" % ctx.bldnode.abspath()
+
+ log = lst = getattr(ctx, 'utest_results', [])
+
+ if not log:
+ return
+
+ with open(file_out, "w") as fp:
+ for binary, retval, lines, error in ctx.utest_results:
+ fp.write("BINARY : %s\n" % binary)
+ fp.write("RETURN VALUE: %s\n" % retval)
+ fp.write("\n*** stdout ***\n")
+ fp.write(lines)
+ fp.write("\n*** stderr ***\n")
+ fp.write(error)
+ fp.write("\n\n\n")
+
+ pprint("BLUE", "Wrote test log to: ", file_out)
+
+
+def test_print_log(ctx):
+ for binary, retval, lines, error in ctx.utest_results:
+ pprint("YELLOW", "BINARY :", binary)
+ pprint("YELLOW", "RETURN VALUE:", retval)
+ print("")
+
+ if retval or error:
+ pprint("RED", "****** ERROR ******\n")
+
+ print error or lines
+
+ if (not retval) and (not error):
+ pprint("GREEN", "****** LOG ******\n", lines)
+
+ print
</span></code></pre>
<br>
</li>
<li id='diff-1'>
<a href='https://gitlab.com/NTPsec/ntpsec/compare/d96344411cc91969dcc1e742f64f8aba7802804d...38cb66c7edcdbe6ef8024a4b971f957cd91646a7#diff-1'>
<strong>
wscript
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/wscript
</span><span style="color: #000000;background-color: #ddffdd">+++ b/wscript
</span><span style="color: #aaaaaa">@@ -4,6 +4,7 @@ out="build"
</span>
from pylib.configure import cmd_configure
from waflib.Tools import waf_unit_test
<span style="color: #000000;background-color: #ddffdd">+from pylib.test import test_write_log, test_print_log
</span>
OPT_STORE = {} # Storage for options to pass into configure
<span style="color: #aaaaaa">@@ -97,27 +98,8 @@ class check(BuildContext):
</span> cmd = 'check'
<span style="color: #000000;background-color: #ffdddd">-
-def test_print_log(ctx):
- from waflib.Logs import pprint
- for binary, retval, lines, error in ctx.utest_results:
-
- pprint("YELLOW", "BINARY :", binary)
- pprint("YELLOW", "RETURN VALUE:", retval)
- print("")
-
- if retval or error:
- pprint("RED", "****** ERROR ******\n")
-
- print error or lines
-
- if (not retval) and (not error):
- pprint("GREEN", "****** LOG ******\n", lines)
-
- print
-
-
</span> def build(ctx):
<span style="color: #000000;background-color: #ddffdd">+
</span> ctx.load('waf', tooldir='pylib/')
ctx.load('bison')
ctx.load('asciidoc', tooldir='pylib/')
<span style="color: #aaaaaa">@@ -169,6 +151,9 @@ def build(ctx):
</span> if ctx.options.verbose:
ctx.add_post_fun(test_print_log)
<span style="color: #000000;background-color: #ddffdd">+ # Write test log to a file
+ ctx.add_post_fun(test_write_log)
+
</span> # Print a summary at the end
ctx.add_post_fun(waf_unit_test.summary)
</code></pre>
<br>
</li>
</div>
<div class='footer' style='margin-top: 10px;'>
<p>
—
<br>
<a href="https://gitlab.com/NTPsec/ntpsec/compare/d96344411cc91969dcc1e742f64f8aba7802804d...38cb66c7edcdbe6ef8024a4b971f957cd91646a7">View it on GitLab</a>.
<br>
You're receiving this email because of your account on gitlab.com.
If you'd like to receive fewer emails, you can adjust your notification settings.
<script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","action":{"@type":"ViewAction","name":["merge_requests","issues","commit"],"url":"https://gitlab.com/NTPsec/ntpsec/compare/d96344411cc91969dcc1e742f64f8aba7802804d...38cb66c7edcdbe6ef8024a4b971f957cd91646a7"}}</script>
</p>
</div>
</body>
</html>