Skip to content

Commit

Permalink
Fix e2e tests (#162)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonnyz32 authored Oct 8, 2024
1 parent 656abb1 commit 70e508a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
6 changes: 3 additions & 3 deletions test/e2e/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ TESTS:=$(shell find * -mindepth 1 -type d)
TESTLIB:=MZNTEST

# run before every test case
pretest:
system "crtlib ${TESTLIB}" || system "clrlib ${TESTLIB}"
beforeAll:
for dir in msg/*/; do printf "[install]\nlibrary=%s\n" "${TESTLIB}" > "$$dir/app.ini"; done

# Run after every test case
posttest:
afterAll:
system "clrlib ${TESTLIB}"

runtests:
Expand Down
10 changes: 6 additions & 4 deletions test/e2e/runTests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,14 @@ run_command_with_output() {
return "$exit_code"
}

echo -e "\tRunning pre-test setup..."
gmake beforeAll 2>&1 | sed 's/^/\t\t/'

for test in "${TESTS[@]}"
do
echo "Test: $test"

# General and test specific setup
echo -e "\tRunning pre-test setup..."
gmake pretest 2>&1 | sed 's/^/\t\t/'
echo -e "\tRunning test-specific setup..."
gmake -C $test setup 2>&1 | sed 's/^/\t\t/' || exit 1

Expand Down Expand Up @@ -78,9 +79,10 @@ do
# Cleanup
echo -e "\tRunning test-specific cleanup..."
gmake -C $test cleanup 2>&1 | sed 's/^/\t\t/' || echo -e "\t\tNo test-specific cleanup needed"
echo -e "\tRunning post-test cleanup"
gmake posttest 2>&1 | sed 's/^/\t\t/'
done
echo -e "\tRunning post-test cleanup"
gmake afterAll 2>&1 | sed 's/^/\t\t/'


# Output results
echo "=================================="
Expand Down

0 comments on commit 70e508a

Please sign in to comment.