summaryrefslogtreecommitdiff
path: root/test/crossrunner
diff options
context:
space:
mode:
authorNobuaki Sukegawa <nsukeg@gmail.com>2015-03-29 14:48:48 +0900
committerRoger Meier <roger@apache.org>2015-03-29 14:39:32 +0200
commitf5b795d3be6acc0da30afc4b4aa77e531125eec6 (patch)
treeac808f8ea26ea5481f0811f4daa4b273f0b0bde5 /test/crossrunner
parent58ed1cdf3cd4da9d013e4cd4b92b3f4e440d145d (diff)
downloadthrift-f5b795d3be6acc0da30afc4b4aa77e531125eec6.tar.gz
THRIFT-2578 Moving 'make cross' from test.sh to test.py
Diffstat (limited to 'test/crossrunner')
-rw-r--r--test/crossrunner/collect.py8
-rw-r--r--test/crossrunner/report.py12
2 files changed, 18 insertions, 2 deletions
diff --git a/test/crossrunner/collect.py b/test/crossrunner/collect.py
index 80a82e71a..6c771b3ba 100644
--- a/test/crossrunner/collect.py
+++ b/test/crossrunner/collect.py
@@ -31,6 +31,13 @@ from crossrunner.util import merge_dict
# protocols: list of supported protocols
# transports: list of supported transports
# sockets: list of supported sockets
+#
+# protocols and transports entries can be colon separated "spec:impl" pair
+# (e.g. binary:accel) where test is run for any matching "spec" while actual
+# argument passed to test executable is "impl".
+# Otherwise "spec" is equivalent to "spec:spec" pair.
+# (e.g. "binary" is equivalent to "binary:bianry" in tests.json)
+#
VALID_JSON_KEYS = [
'name', # name of the library, typically a language name
'workdir', # work directory where command is executed
@@ -78,7 +85,6 @@ def do_collect_tests(servers, clients):
return v
return cached_set(o1, key) & cached_set(o2, key)
- # each entry can be spec:impl (e.g. binary:accel)
def intersect_with_spec(key, o1, o2):
# store as set of (spec, impl) tuple
def cached_set(o):
diff --git a/test/crossrunner/report.py b/test/crossrunner/report.py
index da478fa4b..85e3c26d3 100644
--- a/test/crossrunner/report.py
+++ b/test/crossrunner/report.py
@@ -53,7 +53,7 @@ def generate_known_failures(testdir, overwrite, save, out):
known = load_known_failures(testdir)
known.extend(fails)
fails = known
- fails_json = json.dumps(sorted(set(fails)), indent=2)
+ fails_json = json.dumps(sorted(set(fails)), indent=2, separators=(',', ': '))
if save:
with open(os.path.join(testdir, FAIL_JSON % platform.system()), 'w+') as fp:
fp.write(fails_json)
@@ -284,6 +284,12 @@ class SummaryReporter(TestReporter):
self.out.write(self._format_test(self._tests[i]))
self._print_bar()
+ def _http_server_command(self, port):
+ if sys.version_info[0] < 3:
+ return 'python -m SimpleHTTPServer %d' % port
+ else:
+ return 'python -m http.server %d' % port
+
def _print_footer(self):
fail_count = len(self._expected_failure) + len(self._unexpected_failure)
self._print_bar()
@@ -295,6 +301,10 @@ class SummaryReporter(TestReporter):
self.out.writelines([
'You can browse results at:\n',
'\tfile://%s/%s\n' % (self.testdir, RESULT_HTML),
+ '# If you use Chrome, run:\n',
+ '# \tcd %s\n#\t%s\n' % (self.testdir, self._http_server_command(8001)),
+ '# then browse:\n',
+ '# \thttp://localhost:%d/%s\n' % (8001, RESULT_HTML),
'Full log for each test is here:\n',
'\ttest/log/client_server_protocol_transport_client.log\n',
'\ttest/log/client_server_protocol_transport_server.log\n',