-
-
Notifications
You must be signed in to change notification settings - Fork 145
/
ble.sh
executable file
·51 lines (39 loc) · 850 Bytes
/
ble.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
43
44
45
46
47
48
49
50
51
#!/usr/bin/env bash
#
# Run ble.sh unit tests in Travis.
#
# Usage:
# test/ble.sh <function name>
set -o nounset
set -o pipefail
set -o errexit
readonly BASE_DIR=_clone/ble.sh
clone() {
local out=$BASE_DIR
mkdir -p $out
git clone --recursive --depth=50 --branch=osh \
https://github.com/akinomyoga/ble.sh $out
}
# TODO: What version of osh
build() {
make # make osh
# make _bin/osh
devtools/bin.sh make-ovm-links
# make ble.sh
cd $BASE_DIR
make
}
# https://superuser.com/questions/380772/removing-ansi-color-codes-from-text-stream
filter-ansi() {
sed 's/\x1b\[[0-9;]*m//g'
}
run-tests() {
cd $BASE_DIR
#wc -l oshrc.test-util
#wc -l out/ble.osh
#wc -l lib/test-util.sh
# Force interactive shell on Travis, but remove color.
../../_bin/osh -i --rcfile oshrc.test-util | filter-ansi
echo DONE
}
"$@"