mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-08-08 06:59:39 +08:00
Update distro tests to support newer Cabal
This commit is contained in:
@@ -11,21 +11,34 @@ command -v cabal ||
|
||||
|
||||
cabal update ||
|
||||
die "can't update"
|
||||
cabal install --dependencies-only --enable-tests ||
|
||||
die "can't install dependencies"
|
||||
cabal configure --enable-tests ||
|
||||
|
||||
if [ -e /etc/arch-release ]
|
||||
then
|
||||
# Arch has an unconventional packaging setup
|
||||
flags=(--disable-library-vanilla --enable-shared --enable-executable-dynamic --ghc-options=-dynamic)
|
||||
else
|
||||
flags=()
|
||||
fi
|
||||
|
||||
cabal install --dependencies-only --enable-tests "${flags[@]}" ||
|
||||
cabal install --dependencies-only "${flags[@]}" ||
|
||||
die "can't install dependencies"
|
||||
cabal configure --enable-tests "${flags[@]}" ||
|
||||
die "configure failed"
|
||||
cabal build ||
|
||||
die "build failed"
|
||||
cabal test ||
|
||||
die "test failed"
|
||||
|
||||
dist/build/shellcheck/shellcheck - << 'EOF' || die "execution failed"
|
||||
sc="$(find . -name shellcheck -type f -perm -111)"
|
||||
[ -x "$sc" ] || die "Can't find executable"
|
||||
|
||||
"$sc" - << 'EOF' || die "execution failed"
|
||||
#!/bin/sh
|
||||
echo "Hello World"
|
||||
EOF
|
||||
|
||||
dist/build/shellcheck/shellcheck - << 'EOF' && die "negative execution failed"
|
||||
"$sc" - << 'EOF' && die "negative execution failed"
|
||||
#!/bin/sh
|
||||
echo $1
|
||||
EOF
|
||||
|
Reference in New Issue
Block a user