From cf3a7e4efe60ec5c398a221e65e349dbd419bed3 Mon Sep 17 00:00:00 2001 From: jahorton Date: Mon, 20 Apr 2020 13:37:09 +0700 Subject: [PATCH] fix(web/engine): headless tests may trigger KMW test script fail --- web/unit_tests/test.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/web/unit_tests/test.sh b/web/unit_tests/test.sh index b04686cdf0..b54c04cae2 100755 --- a/web/unit_tests/test.sh +++ b/web/unit_tests/test.sh @@ -1,6 +1,13 @@ #! /bin/bash WORKING_DIRECTORY=`pwd` + +# Include useful testing resource functions +THIS_SCRIPT="$(greadlink -f "${BASH_SOURCE[0]}" 2>/dev/null || readlink -f "${BASH_SOURCE[0]}")" +KEYMAN_ROOT="$(dirname "$THIS_SCRIPT")/../.." +. "$KEYMAN_ROOT/resources/build/build-utils.sh" +. "$KEYMAN_ROOT/resources/shellHelperFunctions.sh" + # A simple utility script to facilitate our different modes for unit-testing KMW. # It's rigged to be callable by NPM to facilitate testing during development when in other folders. @@ -119,8 +126,7 @@ cd $BASE_PATH/../source # First: Keyboard Processor tests. echo "${TERM_HEADING}Running Keyboard Processor test suite${NORMAL}" cd $WORKING_DIRECTORY/node_modules/keyman-keyboard-processor -./test.sh $HEADLESS_FLAGS - +./test.sh $HEADLESS_FLAGS || fail "Tests failed by dependencies; aborting integration tests." # Once done, now we run the integrated (KeymanWeb) tests. cd $WORKING_DIRECTORY