cairo/test/view-test-results.py
Adrian Johnson 6fec25a51f 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
2022-05-17 16:49:02 +09:30

16 lines
400 B
Python
Executable file

#!/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")