Refactor tests/integration/run.sh (#1016)

This commit is contained in:
Marko Budiselić 2023-06-15 23:10:52 +02:00 committed by GitHub
parent 7fb3f62703
commit cf1a86ed13
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 52 additions and 64 deletions

View File

@ -196,22 +196,7 @@ jobs:
- name: Run integration tests
run: |
cd tests/integration
for name in *; do
if [ ! -d $name ]; then continue; fi
pushd $name >/dev/null
echo "Running: $name"
if [ -x prepare.sh ]; then
./prepare.sh
fi
if [ -x runner.py ]; then
./runner.py
elif [ -x runner.sh ]; then
./runner.sh
fi
echo
popd >/dev/null
done
tests/integration/run.sh
- name: Run cppcheck and clang-format
run: |

View File

@ -146,22 +146,7 @@ jobs:
- name: Run integration tests
run: |
cd tests/integration
for name in *; do
if [ ! -d $name ]; then continue; fi
pushd $name >/dev/null
echo "Running: $name"
if [ -x prepare.sh ]; then
./prepare.sh
fi
if [ -x runner.py ]; then
./runner.py
elif [ -x runner.sh ]; then
./runner.sh
fi
echo
popd >/dev/null
done
tests/integration/run.sh
- name: Run cppcheck and clang-format
run: |

View File

@ -146,22 +146,7 @@ jobs:
- name: Run integration tests
run: |
cd tests/integration
for name in *; do
if [ ! -d $name ]; then continue; fi
pushd $name >/dev/null
echo "Running: $name"
if [ -x prepare.sh ]; then
./prepare.sh
fi
if [ -x runner.py ]; then
./runner.py
elif [ -x runner.sh ]; then
./runner.sh
fi
echo
popd >/dev/null
done
tests/integration/run.sh
- name: Run cppcheck and clang-format
run: |

View File

@ -146,22 +146,7 @@ jobs:
- name: Run integration tests
run: |
cd tests/integration
for name in *; do
if [ ! -d $name ]; then continue; fi
pushd $name >/dev/null
echo "Running: $name"
if [ -x prepare.sh ]; then
./prepare.sh
fi
if [ -x runner.py ]; then
./runner.py
elif [ -x runner.sh ]; then
./runner.sh
fi
echo
popd >/dev/null
done
tests/integration/run.sh
- name: Run cppcheck and clang-format
run: |

1
tests/integration/audit/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
*.log

47
tests/integration/run.sh Executable file
View File

@ -0,0 +1,47 @@
#!/bin/bash -e
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
print_help() {
echo -e "$0 => run all under tests/integration"
echo -e "$0 folder_name => run single test under tests/integration"
exit 1
}
test_one() {
cd "$DIR"
integration_test_folder_name="$1"
pushd "$integration_test_folder_name" >/dev/null
echo "Running: $integration_test_folder_name"
if [ -x prepare.sh ]; then
./prepare.sh
fi
if [ -x runner.py ]; then
./runner.py
elif [ -x runner.sh ]; then
./runner.sh
fi
echo
popd >/dev/null
}
test_all() {
cd "$DIR"
for name in *; do
if [ ! -d "$name" ]; then continue; fi
test_one "$name"
done
}
if [ "$#" -eq 0 ]; then
test_all
else
if [ "$#" -gt 1 ]; then
print_help
else
if [ -d "$DIR/$1" ]; then
test_one "$1"
else
print_help
fi
fi
fi