From fdfbadc940c2e6514dce828ea9cf56bfdcad75a0 Mon Sep 17 00:00:00 2001 From: Richard Brooksby Date: Sat, 14 Jan 2023 09:15:42 +0000 Subject: [PATCH] Inserting tests and conditionals in resonse to shellcheck warnings. --- mps/tool/testcoverage | 6 +++--- mps/tool/testemscripten | 15 ++++++++------- mps/tool/testopendylan | 7 ++++--- 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/mps/tool/testcoverage b/mps/tool/testcoverage index 61dce14bfd7..46674cac61c 100755 --- a/mps/tool/testcoverage +++ b/mps/tool/testcoverage @@ -26,14 +26,14 @@ case "$ARCH-$OS" in *-Darwin) CONFIGURATION=Debug ( - cd -- "$CODE" - xcrun xcodebuild -config "$CONFIGURATION" clean + cd -- "$CODE" && + xcrun xcodebuild -config "$CONFIGURATION" clean && xcrun xcodebuild -config "$CONFIGURATION" -target testrun \ GCC_GENERATE_TEST_COVERAGE_FILES=YES \ GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=YES ) ( - cd -- "$CODE/xc/$PROJECT.build/$CONFIGURATION/$PROJECT.build/Objects-normal/$ARCH" + cd -- "$CODE/xc/$PROJECT.build/$CONFIGURATION/$PROJECT.build/Objects-normal/$ARCH" && xcrun gcov mps.c 2> /dev/null ) | "$TOOL/gcovfmt" ;; diff --git a/mps/tool/testemscripten b/mps/tool/testemscripten index 51b5065c3a1..97c5c095055 100755 --- a/mps/tool/testemscripten +++ b/mps/tool/testemscripten @@ -43,8 +43,9 @@ CLANG_REMOTE=https://github.com/kripken/emscripten-fastcomp-clang # Directory to put everything in TESTDIR="$PWD/.test" -mkdir -p -- "$TESTDIR" -cd -- "$TESTDIR" +mkdir -p -- "$TESTDIR" && + cd -- "$TESTDIR" || + exit 1 # 3. UTILITIES @@ -61,7 +62,7 @@ checkout () { git clone --recursive -- "$REMOTE" "$REPO" fi ( - cd -- "$REPO" + cd -- "$REPO" && git pull ) } @@ -76,15 +77,15 @@ checkout emscripten "$EMSCRIPTEN_REMOTE" checkout emscripten-fastcomp "$FASTCOMP_REMOTE" ( - cd emscripten-fastcomp + cd emscripten-fastcomp && ( - cd tools + cd tools && checkout clang "$CLANG_REMOTE"; ) mkdir -p build ( - cd build - ../configure --enable-optimized --disable-assertions --enable-targets=host,js + cd build && + ../configure --enable-optimized --disable-assertions --enable-targets=host,js && make; ) ) diff --git a/mps/tool/testopendylan b/mps/tool/testopendylan index 503863931f7..94d4e1fd7a1 100755 --- a/mps/tool/testopendylan +++ b/mps/tool/testopendylan @@ -43,8 +43,9 @@ REMOTE=https://github.com/dylan-lang/opendylan.git # Directory to put everything in TESTDIR="$PWD/.test/$GC" -mkdir -p -- "$TESTDIR" -cd -- "$TESTDIR" +mkdir -p -- "$TESTDIR" && + cd -- "$TESTDIR" || + exit 1 # 3. PROCEDURE @@ -116,7 +117,7 @@ if [ -f "$REPO/Makefile" ]; then else ( cd -- "$REPO" && ./autogen.sh && - ./configure --with-gc="$GC" --prefix="$PREFIX" $CONFIGURE + ./configure --with-gc="$GC" --prefix="$PREFIX" "$CONFIGURE" ) fi ( cd -- "$REPO" &&