summaryrefslogtreecommitdiffstats
path: root/tests/manual/wasm/shared/run.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tests/manual/wasm/shared/run.sh')
-rwxr-xr-xtests/manual/wasm/shared/run.sh30
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/manual/wasm/shared/run.sh b/tests/manual/wasm/shared/run.sh
new file mode 100755
index 0000000000..f04e45278c
--- /dev/null
+++ b/tests/manual/wasm/shared/run.sh
@@ -0,0 +1,30 @@
+#! /bin/bash
+
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+
+set -m
+
+function removeServer()
+{
+ kill $cleanupPid
+}
+
+if [ -z "$1"]
+then
+ echo "Usage: $0 testname, where testname is a test in the tests/manual/wasm directory" >&2
+ exit 1
+fi
+
+trap removeServer EXIT
+
+script_dir=`dirname ${BASH_SOURCE[0]}`
+cd "$script_dir/../../../../"
+python3 util/wasm/qtwasmserver/qtwasmserver.py -p 8001 &
+cleanupPid=$!
+cd -
+
+python3 -m webbrowser "http://localhost:8001/tests/manual/wasm/$1/tst_$1.html"
+
+echo 'Press any key to continue...' >&2
+read -n 1