14
14
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15
15
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17
COMMAND="../scripts/checkbashisms.pl"
17
if test "$1" = --installed; then
21
COMMAND="../scripts/checkbashisms.pl"
18
24
WORKDIR="$(readlink -f "${0%/*}")"
20
26
. "${0%/*}/shunit2-helper-functions.sh"
30
runCommand "$1" "" "" 0
24
35
runCommand "$1" "" "$2" 1
28
local result="possible bashism in bashisms/source line 2 (should be '.', not 'source'):
30
found "bashisms/source" "$result"
39
clean "bashisms/531327.sh"
43
clean "-f bashisms/535368.mk"
47
found "bashisms/arith.sh" "$(cat bashisms/arith.sh.out)"
50
test_array_expansion() {
51
found "bashisms/array-expansion.sh" "$(cat bashisms/array-expansion.sh.out)"
55
found "bashisms/ash-setvar.sh" "$(cat bashisms/ash-setvar.sh.out)"
59
found "-f bashisms/basic.mk" "$(cat bashisms/basic.mk.out)"
63
clean "-f bashisms/basic-bash.mk"
66
test_brace_expansion() {
67
found "-f bashisms/brace-expansion.sh" "$(cat bashisms/brace-expansion.sh.out)"
70
test_basic_bash_override() {
71
clean "-f bashisms/basic-bash-override.mk"
74
test_case_modification() {
75
found "-f bashisms/case-modification.sh" "$(cat bashisms/case-modification.sh.out)"
78
test_comments_in_quoted_strings1() {
79
clean "bashisms/comments-in-quoted-strings1.sh"
82
test_comments_in_quoted_strings2() {
83
clean "bashisms/comments-in-quoted-strings2.sh"
87
found "bashisms/command.sh" "$(cat bashisms/command.sh.out)"
90
test_comments_parsing_fns() {
91
found "bashisms/comments-parsing-fns.sh" "$(cat bashisms/comments-parsing-fns.sh.out)"
95
found "bashisms/coproc.sh" "$(cat bashisms/coproc.sh.out)"
98
test_dynamic_length() {
99
found "bashisms/dynamic-length.sh" "$(cat bashisms/dynamic-length.sh.out)"
103
found "bashisms/exit-code.sh" "$(cat bashisms/exit-code.sh.out)"
107
clean "bashisms/fail2ban.sh"
111
found "bashisms/fps.sh" "$(cat bashisms/fps.sh.out)"
115
found "bashisms/functions.sh" "$(cat bashisms/functions.sh.out)"
119
found "bashisms/gettext.sh" "$(cat bashisms/gettext.sh.out)"
123
found "bashisms/glob-ignore.sh" "$(cat bashisms/glob-ignore.sh.out)"
127
found "bashisms/hash.sh" "$(cat bashisms/hash.sh.out)"
131
found "bashisms/heredocs.sh" "$(cat bashisms/heredocs.sh.out)"
134
test_heredoc_with_dash() {
135
clean "bashisms/heredoc-with-dash.sh"
138
test_heredoc_with_others() {
139
clean "bashisms/heredoc-with-others.sh"
143
found "bashisms/jobs.sh" "$(cat bashisms/jobs.sh.out)"
146
test_line_continuation() {
147
found "bashisms/line-continuation.sh" "$(cat bashisms/line-continuation.sh.out)"
151
found "bashisms/negations.sh" "$(cat bashisms/negations.sh.out)"
155
found "bashisms/other-vars.sh" "$(cat bashisms/other-vars.sh.out)"
159
found "bashisms/printf.sh" "$(cat bashisms/printf.sh.out)"
162
test_quoted_strings() {
163
found "bashisms/quoted-strings.sh" "$(cat bashisms/quoted-strings.sh.out)"
167
found "bashisms/return.sh" "$(cat bashisms/return.sh.out)"
171
clean "-f bashisms/shell-vars.mk"
175
found "bashisms/sleep.sh" "$(cat bashisms/sleep.sh.out)"
179
found "bashisms/source" "$(cat bashisms/source.out)"
182
test_special_case() {
183
found "bashisms/special-case.sh" "$(cat bashisms/special-case.sh.out)"
186
test_special_expansions() {
187
found "bashisms/special-expansions.sh" "$(cat bashisms/special-expansions.sh.out)"
190
test_subshell_no_arith() {
191
clean "bashisms/subshell-no-arith.sh"
194
test_tilde_expansion() {
195
found "bashisms/tilde-expansion.sh" "$(cat bashisms/tilde-expansion.sh.out)"
199
found "bashisms/traps.sh" "$(cat bashisms/traps.sh.out)"
202
test_underscore_var() {
203
found "bashisms/underscore-var.sh" "$(cat bashisms/underscore-var.sh.out)"
207
found "bashisms/unknown-fns.sh" "$(cat bashisms/unknown-fns.sh.out)"
210
test_unterminated_string() {
211
clean "bashisms/unterminated-string.sh"
214
test_unterminated_string2() {
215
clean "bashisms/unterminated-string2.sh"