2023-04-19 18:14:16 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
#
|
|
|
|
set -euo pipefail
|
|
|
|
IFS=$'\n\t'
|
|
|
|
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
|
|
|
|
2023-04-19 20:15:58 +00:00
|
|
|
samples_dir=$(readlink -f "$DIR/../org_mode_samples")
|
2023-04-19 18:14:16 +00:00
|
|
|
|
|
|
|
function get_test_names {
|
|
|
|
for test_file in "$@"
|
|
|
|
do
|
2023-04-19 18:17:31 +00:00
|
|
|
if [ -e "$test_file" ]; then
|
|
|
|
test_file_full_path=$(readlink -f "$test_file")
|
|
|
|
relative_to_samples=$(realpath --relative-to "$samples_dir" "$test_file_full_path")
|
|
|
|
without_extension="${relative_to_samples%.org}"
|
2023-04-23 01:50:34 +00:00
|
|
|
echo "${without_extension/\//_}" | tr '[:upper:]' '[:lower:]'
|
2023-04-19 18:17:31 +00:00
|
|
|
else
|
2023-04-23 01:50:34 +00:00
|
|
|
echo "$test_file" | tr '[:upper:]' '[:lower:]'
|
2023-04-19 18:17:31 +00:00
|
|
|
fi
|
2023-04-19 18:14:16 +00:00
|
|
|
done
|
|
|
|
}
|
|
|
|
|
|
|
|
get_test_names "$@" | while read test; do
|
2023-04-21 19:40:47 +00:00
|
|
|
(cd "$DIR/../" && cargo test --no-fail-fast --test test_loader "$test" -- --show-output)
|
2023-04-19 18:14:16 +00:00
|
|
|
done
|