Skip to content

Commit

Permalink
[MERGE #3107 @obastemur] xplat: fix script location
Browse files Browse the repository at this point in the history
Merge pull request #3107 from obastemur:symlink

`dirname $0` may return relative path, while some part of the script require it to be absolute.
  • Loading branch information
obastemur committed Jun 6, 2017
2 parents d0ab9bd + 51325f9 commit a96455e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
6 changes: 4 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ PRINT_USAGE() {
echo " --sanitize=CHECKS Build with clang -fsanitize checks,"
echo " e.g. undefined,signed-integer-overflow."
echo " -t, --test-build Test build. Enables test flags on a release build."
echo " --target-os[=S] Target OS"
echo " --target[=S] Target OS"
echo " --target-path[=S] Output path for compiled binaries. Default: out/"
echo " --trace Enables experimental built-in trace."
echo " --xcode Generate XCode project."
Expand All @@ -79,7 +79,9 @@ script (at your own risk)"
echo ""
}

CHAKRACORE_DIR=`dirname $0`
pushd `dirname $0` > /dev/null
CHAKRACORE_DIR=`pwd -P`
popd > /dev/null
_CXX=""
_CC=""
_VERBOSE=""
Expand Down
10 changes: 5 additions & 5 deletions test/runtests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@
# This script is mainly for CI only. In case you have ChakraCore is compiled for multiple
# targets, this script may fail to test all of them. Use runtests.py instead.

test_path=`dirname "$0"`

pushd `dirname $0` > /dev/null
test_path=`pwd -P`
popd > /dev/null
build_type=
binary_path=
release_build=0
Expand Down Expand Up @@ -52,9 +53,8 @@ else
fi
fi

RES=$(pwd)
CH_ABSOLUTE_PATH="$RES/${test_path}/../out/${binary_path}/ch"
RES=$(cd $RES/$test_path/native-tests; ./test_native.sh ${CH_ABSOLUTE_PATH} ${binary_path} 2>&1)
CH_ABSOLUTE_PATH="${test_path}/../out/${binary_path}/ch"
RES=$(cd $test_path/native-tests; ./test_native.sh ${CH_ABSOLUTE_PATH} ${binary_path} 2>&1)
if [[ $? != 0 ]]; then
echo "Error: Native tests failed"
echo -e "$RES"
Expand Down
6 changes: 4 additions & 2 deletions tools/RecyclerChecker/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ echo " --llvm-config=PATH llvm-config executable"
echo ""
}

SCRIPT_DIR=`dirname $0`
pushd `dirname $0` > /dev/null
SCRIPT_DIR=`pwd -P`
popd > /dev/null
CLANG_INC=
CXX_COMPILER=
LLVM_CONFIG=
Expand Down Expand Up @@ -80,4 +82,4 @@ cmake \
_RET=$?

popd > /dev/null
exit $_RET
exit $_RET

0 comments on commit a96455e

Please sign in to comment.