1 | #!/usr/bin/env bash
|
2 | #
|
3 | # What happens if various build features aren't detected?
|
4 | # In Python and C++
|
5 | #
|
6 | # Usage:
|
7 | # test/configure-effects.sh <function name>
|
8 |
|
9 | set -o nounset
|
10 | set -o pipefail
|
11 | set -o errexit
|
12 |
|
13 | # bugs:
|
14 | # echo | tr
|
15 | # echo | cat
|
16 | # history | less
|
17 |
|
18 | prepare-cpp() {
|
19 | ./NINJA-config.sh
|
20 |
|
21 | # This overwrites the config
|
22 | ./configure --without-readline --without-libc-features --without-systemtap-sdt
|
23 |
|
24 | ninja
|
25 | }
|
26 |
|
27 | prepare-py() {
|
28 | make
|
29 | }
|
30 |
|
31 | test-osh() {
|
32 | local osh=$1
|
33 |
|
34 | $osh -x -c 'set -o vi'
|
35 | $osh -x -c 'set -o emacs'
|
36 |
|
37 | # GLOB_PERIOD
|
38 | $osh -x -c 'shopt -s dotglob'
|
39 |
|
40 | set +o errexit
|
41 | # HAVE_PWENT
|
42 | $osh -x -c 'compgen -A user'
|
43 |
|
44 | # FNM_EXTMATCH in glob()
|
45 | # Hm this will works
|
46 | $osh -x -c 'echo */*/t@(*.asdl|*.sh)'
|
47 | echo status=$?
|
48 |
|
49 | # FNM_EXTMATCH in fnmatch()
|
50 | $osh -x -c 'case foo.py in @(*.asdl|*.py)) echo py ;; esac'
|
51 | echo status=$?
|
52 | }
|
53 |
|
54 | cpp() {
|
55 | #prepare
|
56 |
|
57 | test-osh _bin/cxx-asan/osh
|
58 | }
|
59 |
|
60 | py() {
|
61 | #prepare-py
|
62 |
|
63 | ln -s -f -v oil.ovm _bin/osh
|
64 |
|
65 | #test-osh bin/osh
|
66 |
|
67 | test-osh _bin/osh
|
68 | }
|
69 |
|
70 | "$@"
|