Files
RustPython/whats_left.sh
2019-07-01 14:21:29 -05:00

44 lines
880 B
Bash
Executable File
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/bin/bash
set -e
ALL_SECTIONS=(methods modules)
GREEN=''
BOLD=''
NC='(B'
h() {
# uppercase input
header_name=$(echo "$@" | tr "[:lower:]" "[:upper:]")
echo "$GREEN$BOLD===== $header_name =====$NC"
}
cd "$(dirname "$0")"
(
cd tests
# -I means isolate from environment; we don't want any pip packages to be listed
python3 -I not_impl_gen.py
)
# show the building first, so people aren't confused why it's taking so long to
# run whats_left_to_implement
cargo build --release
if [ $# -eq 0 ]; then
sections=(${ALL_SECTIONS[@]})
else
sections=($@)
fi
for section in "${sections[@]}"; do
section=$(echo "$section" | tr "[:upper:]" "[:lower:]")
snippet=tests/snippets/whats_left_$section.py
if ! [[ -f $snippet ]]; then
echo "Invalid section $section" >&2
continue
fi
h "$section" >&2
cargo run --release -q -- "$snippet"
done