Skip to content

Commit 4c9dcc8

Browse files
committed
[update] the test runner script to copy examples into the binary folder.
1 parent 3adfc92 commit 4c9dcc8

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

scripts/run_all_tests.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,20 @@ if [ ! -d "$ROOT_DIR/build/$LAMBDA_build" ]; then
2020
"Please run './scripts/compile_and_run.sh --build $LAMBDA_build"
2121
fi
2222

23-
2423
LAMBDA_INFO "Running tests on a $LAMBDA_build build of lamscript."
2524

2625
if [ $LAMBDA_os = "Linux" ] || [ $LAMBDA_os = "Macos" ]; then
27-
pushd $ROOT_DIR/build/$LAMBDA_build/bin > /dev/null
26+
pushd "$ROOT_DIR/build/$LAMBDA_build/bin" > /dev/null
27+
cp -r "$ROOT_DIR/examples" examples
2828
./lamscript_tests
29-
elif [ $LAMBDA_os = "Windows" ]; then
30-
pushd $ROOT_DIR/build/$LAMBDA_build/bin/$LAMBDA_build > /dev/null
29+
elif [ "$LAMBDA_os" = "Windows" ]; then
30+
pushd "$ROOT_DIR/build/$LAMBDA_build/bin/$LAMBDA_build" > /dev/null
31+
cp -r "$ROOT_DIR/examples/" examples
3132
./lamscript_tests.exe
3233
else
3334
LAMBDA_FATAL "--os needs to be Linux, Macos, or Windows."
3435
fi
3536

36-
3737
LAMBDA_INFO "Finished executing $LAMBDA_example"
3838

3939
popd > /dev/null # $ROOT_DIR/build/$LAMBDA_build/bin

scripts/setup.sh

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
1+
# setup.sh
2+
#
3+
# Setup the Lamscript workspace for development & building.
14
ROOT_DIR="$(git rev-parse --show-toplevel)"
25
pushd $ROOT_DIR > /dev/null
36

7+
# ------------------------------ UPDATE SUBMODULES -----------------------------
48

5-
# Fetch submodules.
69
git submodule update --init --recursive
710

8-
# Source lambda-sh for our bash scripts.
11+
# ------------------------------- LAMBDA-SH SETUP ------------------------------
12+
913
source lambda-sh/lambda.sh
1014

1115
LAMBDA_INFO "Successfully installed submodules and setup lambda.sh"
@@ -18,6 +22,8 @@ if [ "$LAMBDA_within_ci" = true ]; then
1822
exit
1923
fi
2024

25+
# ------------------------------ PRE-COMMIT SETUP ------------------------------
26+
2127
if command -v pre-commit > /dev/null; then
2228
pre-commit install > /dev/null
2329
LAMBDA_INFO "Installed pre-commit hooks."

0 commit comments

Comments
 (0)