OILS / test / configure-effects.sh View on Github | oils.pub

65 lines, 27 significant
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
9set -o nounset
10set -o pipefail
11set -o errexit
12
13# bugs:
14# echo | tr
15# echo | cat
16# history | less
17
18prepare-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
27prepare-py() {
28 make
29}
30
31test-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 # FNM_EXTMATCH in glob()
41 # Hm this will works
42 $osh -x -c 'echo */*/t@(*.asdl|*.sh)'
43
44 # FNM_EXTMATCH in fnmatch()
45 $osh -x -c 'case foo.py in @(*.asdl|*.py)) echo py ;; esac'
46
47 # HAVE_PWENT
48 $osh -x -c 'compgen -A user'
49}
50
51cpp() {
52 #prepare
53
54 test-osh _bin/cxx-asan/osh
55}
56
57py() {
58 #prepare-py
59
60 ln -s -f -v oil.ovm _bin/osh
61
62 test-osh _bin/osh
63}
64
65"$@"