Gitweb links:
...log
http://git.netsurf-browser.org/buildsystem.git/shortlog/777093d441ab01e8a15df0cc478cd05c4377c475
...commit
http://git.netsurf-browser.org/buildsystem.git/commit/777093d441ab01e8a15df0cc478cd05c4377c475
...tree
http://git.netsurf-browser.org/buildsystem.git/tree/777093d441ab01e8a15df0cc478cd05c4377c475
The branch, tlsa/python-testrunner has been updated
discards db14e3fc674ca715fbde762c743c31ebf82129cb (commit)
discards ffc010bc1b8c2c38315b05b63e5bb0f8a72e67bc (commit)
discards c0152aae2d6741799a60782c56d4988b935275d1 (commit)
discards 0b023edcdea4f34822828e8a7fbed503101fcc49 (commit)
via 777093d441ab01e8a15df0cc478cd05c4377c475 (commit)
via 8589835723af7d1bf11924b13e38cf4f818c81ab (commit)
via f7f02cb2f1ba51a1b99c3883b90732ad6f6da365 (commit)
This update added new revisions after undoing existing revisions. That is
to say, the old revision is not a strict subset of the new revision. This
situation occurs when you --force push a change and generate a repository
containing something like this:
* -- * -- B -- O -- O -- O (db14e3fc674ca715fbde762c743c31ebf82129cb)
\
N -- N -- N (777093d441ab01e8a15df0cc478cd05c4377c475)
When this happens we assume that you've already had alert emails for all
of the O revisions, and so we here report only the revisions in the N
branch from the common base, B.
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff
http://git.netsurf-browser.org/buildsystem.git/commit/?id=777093d441ab01e8a15df0cc478cd05c4377c475
commit 777093d441ab01e8a15df0cc478cd05c4377c475
Author: Michael Drake <[email protected]>
Commit: Michael Drake <[email protected]>
Python test runner: Convert from Python 2 to Python 3.
diff --git a/makefiles/Makefile.tools b/makefiles/Makefile.tools
index 2dde372..e6bb7d5 100644
--- a/makefiles/Makefile.tools
+++ b/makefiles/Makefile.tools
@@ -282,6 +282,7 @@ MV ?= mv
PERL ?= perl
PYTHON ?= python
+PYTHON3 ?= python3
PKGCONFIG ?= PKG_CONFIG_PATH="$(PREFIX)/lib/pkgconfig:$(PKG_CONFIG_PATH)"
pkg-config
diff --git a/testtools/testrunner.py b/testtools/testrunner.py
index 9d3aee8..6648372 100644
--- a/testtools/testrunner.py
+++ b/testtools/testrunner.py
@@ -1,4 +1,4 @@
-#!/bin/python
+#!/usr/bin/python3
#
# Testcase runner for NetSurf projects
#
@@ -13,7 +13,7 @@
import os
import sys
-import Queue
+import queue
import threading
import subprocess
@@ -41,11 +41,11 @@ LOG = open(os.path.join(builddir, "testlog"), "w")
def run_test(test_exe, test_data):
- io_q = Queue.Queue()
+ io_q = queue.Queue()
def output_collector(identifier, stream):
for line in stream:
- io_q.put((identifier, line.rstrip()))
+ io_q.put((identifier, line.decode("utf-8").rstrip()))
if not stream.closed:
stream.close()
@@ -109,7 +109,7 @@ with open(os.path.join(directory, "INDEX"), "r") as TINDEX:
continue
# Found one; decompose
- decomposed = filter(None, line.split('\t'))
+ decomposed = list(filter(None, line.split('\t')))
# Strip whitespace
test = decomposed[0].strip()
@@ -136,7 +136,7 @@ with open(os.path.join(directory, "INDEX"), "r") as TINDEX:
continue
# Found one; decompose
- ddecomposed = filter(None, dline.split('\t'))
+ ddecomposed = list(filter(None, dline.split('\t')))
# Strip whitespace
dtest = ddecomposed[0].strip()
commitdiff
http://git.netsurf-browser.org/buildsystem.git/commit/?id=8589835723af7d1bf11924b13e38cf4f818c81ab
commit 8589835723af7d1bf11924b13e38cf4f818c81ab
Author: Michael Drake <[email protected]>
Commit: Michael Drake <[email protected]>
Buildsystem: Install the Python test tool implementation too.
diff --git a/Makefile b/Makefile
index d1fd44b..10aac57 100644
--- a/Makefile
+++ b/Makefile
@@ -28,7 +28,7 @@ MAKEFILES := $(patsubst %,Makefile.%, \
clang gcc norcroft open64 \
)
-TESTTOOLS := testrunner.pl
+TESTTOOLS := testrunner.pl testrunner.py
CITOOLS := jenkins-build.sh
diff --git a/makefiles/Makefile.tools b/makefiles/Makefile.tools
index 86fac4c..2dde372 100644
--- a/makefiles/Makefile.tools
+++ b/makefiles/Makefile.tools
@@ -281,6 +281,7 @@ MKDIRFLAGS ?= -p
MV ?= mv
PERL ?= perl
+PYTHON ?= python
PKGCONFIG ?= PKG_CONFIG_PATH="$(PREFIX)/lib/pkgconfig:$(PKG_CONFIG_PATH)"
pkg-config
commitdiff
http://git.netsurf-browser.org/buildsystem.git/commit/?id=f7f02cb2f1ba51a1b99c3883b90732ad6f6da365
commit f7f02cb2f1ba51a1b99c3883b90732ad6f6da365
Author: Michael Drake <[email protected]>
Commit: Michael Drake <[email protected]>
Testrunner: Add Python implementation of testrunner.pl
diff --git a/testtools/testrunner.py b/testtools/testrunner.py
new file mode 100644
index 0000000..9d3aee8
--- /dev/null
+++ b/testtools/testrunner.py
@@ -0,0 +1,171 @@
+#!/bin/python
+#
+# Testcase runner for NetSurf projects
+#
+# Usage: testrunner <builddir> <testdir> <prefix> [<executable extension>]
+#
+# Operates upon INDEX files described in the README.
+# Locates and executes testcases, feeding data files to programs
+# as appropriate.
+# Logs testcase output to file.
+# Aborts test sequence on detection of error.
+#
+
+import os
+import sys
+import Queue
+import threading
+import subprocess
+
+global builddir
+global directory
+global prefix
+global exeext
+
+if len(sys.argv) < 4:
+ print("Usage: testrunner.pl <builddir> <testdir> <prefix> [<exeext>]")
+ sys.exit(1)
+
+# Get directories
+builddir = sys.argv[1]
+directory = sys.argv[2]
+prefix = sys.argv[3]
+
+# Get EXE extension (if any)
+exeext = None
+if len(sys.argv) > 4:
+ exeext = sys.argv[4]
+
+# Open log file and /dev/null
+LOG = open(os.path.join(builddir, "testlog"), "w")
+
+
+def run_test(test_exe, test_data):
+ io_q = Queue.Queue()
+
+ def output_collector(identifier, stream):
+ for line in stream:
+ io_q.put((identifier, line.rstrip()))
+
+ if not stream.closed:
+ stream.close()
+
+ # Run the test
+ proc = subprocess.Popen([test_exe, test_data],
+ stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+
+ # Threads for sticking output into queue
+ tout = threading.Thread(target=output_collector, name='stdout-watcher',
+ args=('STDOUT', proc.stdout))
+ terr = threading.Thread(target=output_collector, name='stderr-watcher',
+ args=('STDERR', proc.stderr))
+
+ tout.start()
+ terr.start()
+
+ # Wait for test to finish
+ ret = proc.wait()
+
+ # And join the output collector threads
+ tout.join()
+ terr.join()
+
+ # If last line of STDOUT is "PASS", then the test passed
+ last_line = None
+
+ # The STDERR output is just collected up and put at the end of LOG
+ error_lines = []
+
+ while not io_q.empty():
+ identifier, line = io_q.get()
+ if identifier == "STDOUT":
+ LOG.write("%s\n" % line)
+ last_line = line
+ else:
+ error_lines += line
+
+ # Check for test process returning error
+ if ret != 0:
+ LOG.write(" FAIL: Exit status %i\n" % ret)
+ last_line = "FAIL"
+
+ # Dump stderr to log
+ for error_line in error_lines:
+ LOG.write("%s\n" % line)
+
+ if not last_line == "PASS":
+ last_line = "FAIL"
+
+ # Print rest result
+ print(last_line)
+ return
+
+# Open testcase index
+with open(os.path.join(directory, "INDEX"), "r") as TINDEX:
+ # Parse testcase index, looking for testcases
+ for line in TINDEX:
+ # Skip comments
+ if line[0] == '#' or line.isspace():
+ continue
+
+ # Found one; decompose
+ decomposed = filter(None, line.split('\t'))
+
+ # Strip whitespace
+ test = decomposed[0].strip()
+ desc = decomposed[1].strip()
+ data = None
+ if len(decomposed) > 2:
+ data = decomposed[2].strip()
+
+ # Append prefix & EXE extension to binary name
+ test = prefix + test
+ if exeext:
+ test += exeext
+
+ print("Test: " + desc)
+
+ if data:
+ # Testcase has external data files
+
+ # Open datafile index
+ with open(os.path.join(directory, "data/" + data + "/INDEX"), "r")
as DINDEX:
+ # Parse datafile index, looking for datafiles
+ for dline in DINDEX:
+ if dline[0] == '#' or dline.isspace():
+ continue
+
+ # Found one; decompose
+ ddecomposed = filter(None, dline.split('\t'))
+
+ # Strip whitespace
+ dtest = ddecomposed[0].strip()
+ ddesc = ddecomposed[1].strip()
+
+ LOG.write("Running %s %s\n" % (
+ os.path.join(builddir, test),
+ os.path.join(directory, "data/" + data + "/" +
dtest)))
+
+ # Make message fit on an 80 column terminal
+ msg = " ==> " + test + " [" + data + "/" + dtest + "]"
+ msg += "." * (80 - len(msg) - 8)
+
+ sys.stdout.write(msg)
+
+ # Run testcase
+ run_test(os.path.join(builddir, test),
+ os.path.join(directory, "data/" + data + "/" +
dtest))
+ else:
+ # Testcase has no external data files
+ LOG.write("Running %s\n" % (os.path.join(builddir, test)))
+
+ # Make message fit on an 80 column terminal
+ msg = " ==> " + test
+ msg += "." * (80 - len(msg) - 8)
+
+ sys.stdout.write(msg)
+
+ # Run testcase
+ run_test(os.path.join(builddir, test))
+
+ print("")
-----------------------------------------------------------------------
Summary of changes:
Makefile | 2 +-
makefiles/Makefile.tools | 3 ++-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile
index e221973..10aac57 100644
--- a/Makefile
+++ b/Makefile
@@ -28,7 +28,7 @@ MAKEFILES := $(patsubst %,Makefile.%, \
clang gcc norcroft open64 \
)
-TESTTOOLS := testrunner.py
+TESTTOOLS := testrunner.pl testrunner.py
CITOOLS := jenkins-build.sh
diff --git a/makefiles/Makefile.tools b/makefiles/Makefile.tools
index 732a962..e6bb7d5 100644
--- a/makefiles/Makefile.tools
+++ b/makefiles/Makefile.tools
@@ -281,7 +281,8 @@ MKDIRFLAGS ?= -p
MV ?= mv
PERL ?= perl
-PYTHON ?= python3
+PYTHON ?= python
+PYTHON3 ?= python3
PKGCONFIG ?= PKG_CONFIG_PATH="$(PREFIX)/lib/pkgconfig:$(PKG_CONFIG_PATH)"
pkg-config
--
NetSurf Project build system
_______________________________________________
netsurf-commits mailing list
[email protected]
http://listmaster.pepperfish.net/cgi-bin/mailman/listinfo/netsurf-commits-netsurf-browser.org