summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMathis Rosenhauer <rosenhauer@dkrz.de>2016-04-14 11:56:04 +0200
committerMathis Rosenhauer <rosenhauer@dkrz.de>2016-04-14 11:56:04 +0200
commite0ebe0cfc179a99e2db18046cd0b9382134aece1 (patch)
treeb5a15890d23bd6ea685212f6e0c324470267fe76
parent7bdee4655b3ecdae65429b0cbc6df4a6c4a4e1c1 (diff)
downloadlibaec-e0ebe0cfc179a99e2db18046cd0b9382134aece1.tar.gz
libaec-e0ebe0cfc179a99e2db18046cd0b9382134aece1.tar.bz2
libaec-e0ebe0cfc179a99e2db18046cd0b9382134aece1.zip
Error check remote file download for tests
-rw-r--r--.gitignore1
-rwxr-xr-xtests/benc.sh11
-rwxr-xr-xtests/sampledata.sh11
3 files changed, 18 insertions, 5 deletions
diff --git a/.gitignore b/.gitignore
index 5076717..ff4e7ca 100644
--- a/.gitignore
+++ b/.gitignore
@@ -15,5 +15,4 @@ configure
libtool
autom4te.cache
.DS_Store
-data
build*
diff --git a/tests/benc.sh b/tests/benc.sh
index 9c11cce..0d20aa3 100755
--- a/tests/benc.sh
+++ b/tests/benc.sh
@@ -1,10 +1,17 @@
#!/bin/sh
set -e
AEC=../src/aec
-
+test_data=https://gitlab.dkrz.de/k202009/libaec/raw/master/data/typical.rz
if [ ! -f typical.dat ]; then
rm -f typical.rz
- wget https://www.dkrz.de/redmine/attachments/download/442/typical.rz
+ type wget >/dev/null 2>&1 || {
+ echo >&2 "wget not found. Please download $test_data by other means and place it in tests. Aborting."
+ exit 1
+ }
+ wget $test_data || {
+ echo >&2 "Could not download $test_data. Please download it by other means and place it in tests. Aborting."
+ exit 1
+ }
$AEC -d -n16 -j64 -r256 -m typical.rz typical.dat
rm -f bench.dat
fi
diff --git a/tests/sampledata.sh b/tests/sampledata.sh
index d66f970..4cacde7 100755
--- a/tests/sampledata.sh
+++ b/tests/sampledata.sh
@@ -6,9 +6,16 @@ ALLO=${CCSDS_DATA}/AllOptions
EXTP=${CCSDS_DATA}/ExtendedParameters
LOWE=${CCSDS_DATA}/LowEntropyOptions
archive=121B2TestData.zip
-
+archive_url=http://cwe.ccsds.org/sls/docs/SLS-DC/BB121B2TestData/$archive
if [ ! -f $archive ]; then
- wget http://cwe.ccsds.org/sls/docs/SLS-DC/BB121B2TestData/$archive
+ type wget >/dev/null 2>&1 || {
+ echo >&2 "wget not found. Please download $archive_url by other means and place it in tests. Aborting."
+ exit 1
+ }
+ wget $archive_url || {
+ echo >&2 "Could not download $archive_url. Please download $archive by other means and place it in tests. Aborting."
+ exit 1
+ }
fi
unzip -oq $archive