-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtest.sh
executable file
·42 lines (37 loc) · 945 Bytes
/
test.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/bash
#
# Copyright (c) 2017, Vanessa Sochat. All rights reserved.
# Singularity Builder Testing
if [ ! -d "./tests/" ]; then
/bin/echo "ERROR: Could not locate singularity builder test directory"
exit 1
fi
if ! cd tests; then
/bin/echo "ERROR: Could not change into the Singularity builder test directory"
exit 1
fi
if [ -n "$1" ]; then
for i in $@; do
test=`basename "$i"`
if [ -f "$test" ]; then
if ! /bin/sh "$test"; then
/bin/echo "ERROR: Failed running test: $test"
exit 1
fi
else
echo "ERROR: Could not find test: '$test'"
exit 1
fi
done
else
for test in *.sh; do
if [ -f "$test" ]; then
if ! /bin/sh "$test"; then
/bin/echo "ERROR: Failed running test: $test"
exit 1
fi
fi
done
fi
echo
echo "All tests passed"