tests: add "shellcheck" tests for "ksh" scripts
This commit is contained in:
parent
f08727035f
commit
6c0e154e07
|
@ -2,7 +2,7 @@
|
||||||
dist: trusty
|
dist: trusty
|
||||||
install:
|
install:
|
||||||
- sudo apt-get update
|
- sudo apt-get update
|
||||||
- sudo apt-get --no-install-recommends install devscripts python python3 ruby php5-cli gawk ksh zsh pylint
|
- sudo apt-get --no-install-recommends install devscripts python python3 ruby php5-cli gawk ksh zsh pylint shellcheck
|
||||||
- sudo apt-get --no-install-recommends install pkg-config libdb-dev libvirt-dev libexpat-dev
|
- sudo apt-get --no-install-recommends install pkg-config libdb-dev libvirt-dev libexpat-dev
|
||||||
# - Munin/Plugin.pm is in "munin-node" on precise
|
# - Munin/Plugin.pm is in "munin-node" on precise
|
||||||
- sudo apt-get --no-install-recommends install munin-node
|
- sudo apt-get --no-install-recommends install munin-node
|
||||||
|
|
20
t/test.t
20
t/test.t
|
@ -85,12 +85,20 @@ sub process_file {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
elsif ( $interpreter =~ m{/bin/ksh} ) {
|
elsif ( $interpreter =~ m{/bin/ksh} ) {
|
||||||
run_check(
|
subtest $filename => sub {
|
||||||
{ command => [ 'ksh', '-n', $file ],
|
plan tests => 2;
|
||||||
description => 'ksh syntax check',
|
run_check(
|
||||||
filename => $filename
|
{ command => [ 'ksh', '-n', $file ],
|
||||||
}
|
description => 'ksh syntax check',
|
||||||
);
|
filename => $filename
|
||||||
|
}
|
||||||
|
);
|
||||||
|
run_check(
|
||||||
|
{ command => [ 'shellcheck', $file ],
|
||||||
|
description => 'shellcheck'
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
elsif ( $interpreter =~ m{bash} ) {
|
elsif ( $interpreter =~ m{bash} ) {
|
||||||
run_check(
|
run_check(
|
||||||
|
|
Loading…
Reference in New Issue