Skip to content

Commit 40d73e8

Browse files
author
Hatim Chahout
committed
Amended relative paths of several files. #66.
1 parent 5d6a21e commit 40d73e8

File tree

3 files changed

+14
-12
lines changed

3 files changed

+14
-12
lines changed

tests/run_test_setup.bash

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,12 @@ function setup_test_env() {
1717
export TMP_DIR=$(mktemp -d)
1818
export PARAMS="../param.bash"
1919

20-
cp ./run_proc.bash run_proc_orig.bash
21-
sed '/moo_wait() {/,/^}/d; /slurm_wait() {/,/^}/d; /retrieve_data() {/,/^}/d; /run_tool() {/,/^}/d' "run_proc_orig.bash" > "run_proc.bash"
22-
# echo "Contents of run_proc.bash:"
23-
# cat run_proc.bash
20+
if [ ! -f ../run_proc_orig.bash ]; then
21+
mv ../run_proc.bash ../run_proc_orig.bash
22+
fi
23+
sed '/moo_wait() {/,/^}/d; /slurm_wait() {/,/^}/d; /retrieve_data() {/,/^}/d; /run_tool() {/,/^}/d' "../run_proc_orig.bash" > "../run_proc.bash"
24+
echo "Contents of run_proc.bash:"
25+
cat ../run_proc.bash
2426

2527
# Create an empty param.bash and add the mock paths to it
2628
> "$PARAMS"

tests/run_tests.bash

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,39 +3,39 @@
33
set -ex
44

55
# Source the common setup script
6-
source ./tests/run_test_setup.bash
6+
source ./run_test_setup.bash
77

88
echo "Running all integration tests..."
99

1010
# Test 1: A valid, simple run
1111
echo ""
1212
echo "-------------------------------------"
1313
echo "Running test_valid_run.bash"
14-
./tests/test_valid_run.bash
14+
./test_valid_run.bash
1515

1616
# Test 2: Test with missing dependencies
1717
echo ""
1818
echo "-------------------------------------"
1919
echo "Running test_missing_deps.bash"
20-
./tests/test_missing_deps.bash
20+
./test_missing_deps.bash
2121

2222
# Test 3: Test with user choices for Southern Ocean
2323
echo ""
2424
echo "-------------------------------------"
2525
echo "Running test_user_choices.bash"
26-
./tests/test_user_choices.bash
26+
./test_user_choices.bash
2727

2828
# Test 4: Test with missing arguments
2929
echo ""
3030
echo "-------------------------------------"
3131
echo "Running test_missing_args.bash"
32-
./tests/test_missing_args.bash
32+
./test_missing_args.bash
3333

3434
# Test 5: Test with missing or invalid file paths
3535
echo ""
3636
echo "-------------------------------------"
3737
echo "Running test_invalid_paths.bash"
38-
./tests/test_invalid_paths.bash
38+
./test_invalid_paths.bash
3939

4040
echo ""
4141
echo "-------------------------------------"

tests/test_valid_run.bash

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ set -ex
44
echo "--- Test 1: A valid run ---"
55

66
echo "Sourcing setup script..."
7-
source ./tests/run_test_setup.bash
7+
source ./run_test_setup.bash
88

99
echo "Setting up test environment..."
1010
setup_test_env
@@ -15,7 +15,7 @@ setup_test_env
1515
JOBOUT="$TMP_DIR/test_valid_run_out.txt"
1616

1717
echo "Running the process with valid parameters..."
18-
source ./run_proc.bash -B bathy.nc -C 1 mesh_mask.nc 2020 2020 1m RUNID_TEST > "$JOBOUT" 2>&1
18+
source ../run_proc.bash -B bathy.nc -C 1 mesh_mask.nc 2020 2020 1m RUNID_TEST > "$JOBOUT" 2>&1
1919

2020
# { source ./run_proc.bash -B bathy.nc -C 1 mesh_mask.nc 2020 2020 1m RUNID_TEST; } > "$JOBOUT" 2>&1
2121

0 commit comments

Comments
 (0)