Add fallback when realpath doesn't exist

Fixed: tint:763
Change-Id: Id5b687faea82d3e77b8e98607913640fffef6af7
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/49620
Auto-Submit: David Neto <dneto@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
This commit is contained in:
David Neto 2021-04-30 19:49:39 +00:00 committed by Commit Bot service account
parent 3068dcb3d7
commit 77a7518c95
1 changed files with 5 additions and 1 deletions

View File

@ -82,7 +82,11 @@ function check() {
for TEST_FILE in ${SCRIPT_DIR}/*.spvasm ${SCRIPT_DIR}/*.wgsl
do
TEST_FILE=$(realpath --relative-to="$SCRIPT_DIR" "$TEST_FILE")
if [ -x realpath ]; then
TEST_FILE=$(realpath --relative-to="$SCRIPT_DIR" "$TEST_FILE")
else
TEST_FILE=$(echo -n "$TEST_FILE"| sed -e "s'${SCRIPT_DIR}/*''")
fi
echo
echo "Testing $TEST_FILE..."
check "${TEST_FILE}" wgsl