Files
meow_base/tests/test_all.sh

39 lines
878 B
Bash
Executable File

#! /bin/bash
# A script to run all tests. This will automatically move to the tests
# directory and call all other files as pytest scripts
# Need to more to local dir to run tests
starting_working_dir=$(pwd)
script_name=$(basename "$0")
script_dir=$(dirname "$(realpath "$0")")
skip_long_tests=0
for arg in "$@"
do
echo "Given arg: $arg";
if [[ $arg == -s ]]
then
echo "skippy the kangaroo"
skip_long_tests=1
fi
done
cd $script_dir
# Gather all other test files and run pytest
search_dir=.
for entry in "$search_dir"/*
do
if [[ $entry == ./test* ]] \
&& [[ -f $entry ]] \
&& [[ $entry != ./$script_name ]] \
&& [[ $entry != ./shared.py ]];
then
SKIP_LONG=$skip_long_tests pytest $entry "-W ignore::DeprecationWarning"
# SKIP_LONG=$skip_long_tests pytest $entry
fi
done
# Move back to where we called from
cd $starting_working_dir