mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2025-12-24 12:30:10 +01:00
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
16 lines
400 B
Python
Executable file
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")
|