tests: add support for tcl tests

This commit is contained in:
Emil J. Tywoniak 2024-11-28 15:14:15 +01:00
parent 6c78bd3637
commit 289673a807
1 changed files with 18 additions and 1 deletions

View File

@ -20,6 +20,13 @@ generate_ys_test() {
generate_target "$ys_file" "\"$YOSYS_BASEDIR/yosys\" -ql ${ys_file%.*}.log $yosys_args_ $ys_file"
}
# $ generate_tcl_test tcl_file [yosys_args]
generate_tcl_test() {
tcl_file=$1
yosys_args_=${2:-}
generate_target "$tcl_file" "\"$YOSYS_BASEDIR/yosys\" -ql ${tcl_file%.*}.log $yosys_args_ $tcl_file"
}
# $ generate_bash_test bash_file
generate_bash_test() {
bash_file=$1
@ -29,6 +36,7 @@ generate_bash_test() {
# $ generate_tests [-y|--yosys-scripts] [-s|--prove-sv] [-b|--bash] [-a|--yosys-args yosys_args]
generate_tests() {
do_ys=false
do_tcl=false
do_sv=false
do_sh=false
yosys_args=""
@ -40,6 +48,10 @@ generate_tests() {
do_ys=true
shift
;;
-t|--tcl-scripts)
do_tcl=true
shift
;;
-s|--prove-sv)
do_sv=true
shift
@ -59,7 +71,7 @@ generate_tests() {
esac
done
if [[ ! ( $do_ys = true || $do_sv = true || $do_sh = true ) ]]; then
if [[ ! ( $do_ys = true || $do_tcl = true || $do_sv = true || $do_sh = true ) ]]; then
echo >&2 "Error: No file types selected"
exit 1
fi
@ -72,6 +84,11 @@ generate_tests() {
generate_ys_test "$x" "$yosys_args"
done
fi;
if [[ $do_tcl = true ]]; then
for x in *.tcl; do
generate_tcl_test "$x" "$yosys_args"
done
fi;
if [[ $do_sv = true ]]; then
for x in *.sv; do
if [ ! -f "${x%.sv}.ys" ]; then