summaryrefslogtreecommitdiffstats
path: root/tests/manual/wasm/shared/run.sh
blob: d8ae18919c49dbb0ce3b06ba14484f6d397bf8c8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#! /bin/bash

# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only

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 -m http.server 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