summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAdrian Johnson <ajohnson@redneon.com>2022-05-17 14:55:39 +0930
committerAdrian Johnson <ajohnson@redneon.com>2022-05-17 16:49:02 +0930
commit6fec25a51f2e94c64c02a8598dac4d6c3436b105 (patch)
tree96b7a49db2b36ef374b4d023adb71bff7fd2a098 /test
parente32b2c34f1ac719f3ca53137da7f732b3cd7978f (diff)
downloadcairo-6fec25a51f2e94c64c02a8598dac4d6c3436b105.tar.gz
python script to view tests results
testtables.js no longer works in modern browsers as local file access has been disabled. This script runs a python http server that serves the contents of the current directory then opens the test results in the webbrowser
Diffstat (limited to 'test')
-rw-r--r--test/meson.build5
-rwxr-xr-xtest/view-test-results.py16
2 files changed, 21 insertions, 0 deletions
diff --git a/test/meson.build b/test/meson.build
index 21a0588e7..be05d30ec 100644
--- a/test/meson.build
+++ b/test/meson.build
@@ -629,6 +629,11 @@ exe = executable('cairo-test-suite', [cairo_test_suite_sources, test_sources, ca
libpdiff_dep],
)
+html_files = ['index.html', 'testtable.js', 'view-test-results.py']
+foreach file : html_files
+ configure_file(input: file, output : file, copy: true)
+endforeach
+
env = environment()
env.set('srcdir', meson.current_source_dir())
diff --git a/test/view-test-results.py b/test/view-test-results.py
new file mode 100755
index 000000000..16241fec0
--- /dev/null
+++ b/test/view-test-results.py
@@ -0,0 +1,16 @@
+#!/usr/bin/env python3
+
+import http.server
+import os
+import threading
+import webbrowser
+
+port = 8000
+
+server = http.server.ThreadingHTTPServer(("localhost", port), http.server.SimpleHTTPRequestHandler)
+thread = threading.Thread(target = server.serve_forever)
+thread.daemon = True
+thread.start()
+
+webbrowser.open_new("http://localhost:" + str(port) + "/index.html")
+input("\nPress Enter to exit\n\n")