UNPKG

1.45 kBapplication/x-shView Raw
1#!/usr/bin/env bash
2
3#
4# Copyright 2019 IBM Corporation
5#
6# Licensed under the Apache License, Version 2.0 (the "License");
7# you may not use this file except in compliance with the License.
8# You may obtain a copy of the License at
9#
10# http://www.apache.org/licenses/LICENSE-2.0
11#
12# Unless required by applicable law or agreed to in writing, software
13# distributed under the License is distributed on an "AS IS" BASIS,
14# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15# See the License for the specific language governing permissions and
16# limitations under the License.
17#
18
19set -e
20set -o pipefail
21
22SCRIPTDIR=$(cd $(dirname "$0") && pwd)
23
24if [ -z "$MONOREPO_MODE" ]; then
25 echo "running as external custom client"
26 ROOT="$SCRIPTDIR"/../..
27 export TEST_SUITE_ROOT="$ROOT"/node_modules/@kui-shell
28 export TEST_ROOT="$TEST_SUITE_ROOT"/test
29 cd "$SCRIPTDIR"
30else
31 ROOT="$SCRIPTDIR"/../../..
32 echo "running in monorepo $ROOT"
33 export TEST_SUITE_ROOT="$ROOT"/node_modules/@kui-shell
34 export TEST_ROOT="$ROOT"/packages/test
35fi
36
37export DISPLAY=":$((PORT_OFFSET+1))"
38
39if [ -z "$WEBPACK_CLIENT_URL" ]; then
40 export WEBPACK_CLIENT_URL=http://localhost:908${PORT_OFFSET-0}/index${PORT_OFFSET}.html
41 echo "Using WEBPACK_CLIENT_URL=$WEBPACK_CLIENT_URL"
42fi
43
44if [ $# = 0 ]; then
45 "$TEST_ROOT"/bin/runTest.sh
46else
47 for i in $@; do
48 export LAYER=$i
49 "$TEST_ROOT"/bin/runTest.sh
50 done
51fi