1 | #!/usr/bin/env bash
|
2 | #
|
3 | # Usage:
|
4 | # build/dev-shell-test.sh <function name>
|
5 |
|
6 | set -o nounset
|
7 | set -o pipefail
|
8 | set -o errexit
|
9 |
|
10 | source build/dev-shell.sh
|
11 |
|
12 | log() {
|
13 | echo "$@" >& 2
|
14 | }
|
15 |
|
16 | banner() {
|
17 | echo ' |'
|
18 | echo " | $@"
|
19 | echo ' |'
|
20 | echo
|
21 | }
|
22 |
|
23 | show-path() {
|
24 | local var_name=$1
|
25 | echo "$var_name ="
|
26 | eval "echo \$$var_name" | sed 's/:/\n/g'
|
27 | echo
|
28 | }
|
29 |
|
30 | test-cli() {
|
31 | banner "Testing command line"
|
32 | show-path PATH
|
33 |
|
34 | echo
|
35 |
|
36 | log "Testing re2c"
|
37 | re2c --help | head -n 2
|
38 | echo
|
39 |
|
40 | log "Testing cmark"
|
41 | echo '*bold*' | doctools/cmark.py
|
42 | echo
|
43 |
|
44 | log "Testing python3"
|
45 | which python3
|
46 | python3 -V
|
47 | echo
|
48 | }
|
49 |
|
50 | test-python2() {
|
51 | banner "Testing python2"
|
52 |
|
53 | # Can't do this because of vendor/typing.py issue.
|
54 | # log "Testing oils_for_unix.py"
|
55 | # bin/oils_for_unix.py --help | head -n 2
|
56 |
|
57 | bin/osh --help | head -n 2
|
58 | bin/ysh --help | head -n 2
|
59 |
|
60 | echo
|
61 | }
|
62 |
|
63 | test-python3() {
|
64 | banner "Testing python3"
|
65 | show-path PYTHONPATH
|
66 |
|
67 | log "Checking mycpp"
|
68 | mycpp/mycpp_main.py --help | head -n 2
|
69 | echo
|
70 |
|
71 | log "Checking pexpect"
|
72 | spec/stateful/interactive.py --help | head -n 2
|
73 | echo
|
74 | }
|
75 |
|
76 | test-R() {
|
77 | banner "Testing R"
|
78 | show-path R_LIBS_USER
|
79 |
|
80 | which R
|
81 | R --version
|
82 | echo
|
83 |
|
84 | devtools/R-test.sh test-r-packages
|
85 | echo
|
86 | }
|
87 |
|
88 | soil-run() {
|
89 | test-cli
|
90 | test-python2
|
91 | test-python3
|
92 | test-R
|
93 | }
|
94 |
|
95 | "$@"
|