-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathtest.sh
More file actions
executable file
·60 lines (45 loc) · 846 Bytes
/
test.sh
File metadata and controls
executable file
·60 lines (45 loc) · 846 Bytes
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/usr/bin/env bash
set -e
if [ ! -e jvm/target/pack/bin/echo ]; then
sbtn jvm/pack
fi
if [ ! -e props/target/pack/bin/props ]; then
sbtn props/pack
fi
runEcho() {
jvm/target/pack/bin/echo "$@"
}
runProps() {
props/target/pack/bin/props "$@"
}
RED='\033[0;31m'
GREEN='\033[0;32m'
RESET='\033[0m'
passed() {
echo -e "$GREEN$@ passed$RESET"
}
failed() {
echo -e "$RED$@ failed$RESET"
}
echoTest1() {
local MSG="foo"
local OUTPUT="$(runEcho "$MSG")"
if [ "$OUTPUT" = "$MSG" ]; then
passed echoTest1
else
echo "Expected $MSG, got $OUTPUT"
failed echoTest1
fi
}
propsTest1() {
local EXPECTED="$(pwd)"
local OUTPUT="$(runProps user.dir)"
if [ "$OUTPUT" = "$EXPECTED" ]; then
passed propsTest1
else
echo "Expected $EXPECTED, got $OUTPUT"
failed propsTest1
fi
}
echoTest1
propsTest1