exa/xtests/run.sh

33 lines
806 B
Bash
Raw Normal View History

#!/bin/bash
2020-10-17 19:39:44 +00:00
trap 'exit' ERR
2020-10-17 19:39:44 +00:00
# Check for release mode
case "$1" in
"--release") exa_binary="$HOME/target/release/exa" ;;
*) exa_binary="$HOME/target/debug/exa" ;;
esac
2017-06-25 10:53:59 +00:00
2021-04-01 08:39:03 +00:00
if [ ! -e /vagrant ]; then
echo "The extended tests must be run on the Vagrant machine."
exit 1
fi
if [ ! -f "$exa_binary" ]; then
echo "exa binary ($exa_binary) does not exist"
if [ "$1" != "--release" ]; then echo -e "create it first with \033[1;32mbuild-exa\033[0m or \033[1;32mb\033[0m"; fi
exit 1
fi
2020-10-17 19:39:44 +00:00
echo -e "#!/bin/sh\nexec $exa_binary --colour=always \"\$@\"" > /tmp/exa
chmod +x /tmp/exa
export PATH="/tmp:$PATH"
2020-10-17 19:39:44 +00:00
# Unset any environment variables
export EXA_STRICT=""
2017-08-19 12:57:56 +00:00
export EXA_DEBUG=""
export LS_COLORS=""
export EXA_COLORS=""
2020-10-17 19:39:44 +00:00
# Run the tests
exec specsheet $(dirname "$0")/*.toml -O cmd.shell=bash