[Skiboot] [PATCH 4/5] external/tests: Add a data directory for tests
Cyril Bur
cyril.bur at au1.ibm.com
Fri Mar 17 16:13:08 AEDT 2017
Signed-off-by: Cyril Bur <cyril.bur at au1.ibm.com>
---
external/test/test.sh | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/external/test/test.sh b/external/test/test.sh
index 827cd921..f63cce5f 100755
--- a/external/test/test.sh
+++ b/external/test/test.sh
@@ -26,8 +26,6 @@ run_binary() {
}
fail_test() {
- rm -rf "$STDERR_OUT";
- rm -rf "$STDOUT_OUT";
echo "$0 ($CUR_TEST): test failed";
exit ${1:-1};
}
@@ -60,8 +58,8 @@ diff_with_result() {
}
run_tests() {
- if [ $# -ne 2 ] ; then
- echo "Usage run_tests test_dir result_dir";
+ if [ $# -lt 2 ] ; then
+ echo "Usage run_tests test_dir result_dir [data_dir]";
exit 1;
fi
@@ -75,6 +73,10 @@ run_tests() {
export STDERR_OUT=$(mktemp --tmpdir external-test-stderr.XXXXXX);
export STDOUT_OUT=$(mktemp --tmpdir external-test-stdout.XXXXXX);
+ export DATA_DIR=$(mktemp --tmpdir -d external-test-datadir.XXXXXX);
+ if [ $# -eq 3 ] ; then
+ cp -r $3/* "$DATA_DIR"
+ fi
for the_test in $all_tests; do
@@ -93,6 +95,7 @@ run_tests() {
rm -rf $STDERR_OUT;
rm -rf $STDOUT_OUT;
+ rm -rf $DATA_DIR;
echo "$0 tests passed"
--
2.12.0
More information about the Skiboot
mailing list