Skip to content

Commit

Permalink
ruin run_tests.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
ThinkOpenly committed Sep 10, 2024
1 parent 2dbe417 commit 7e5415f
Showing 1 changed file with 95 additions and 95 deletions.
190 changes: 95 additions & 95 deletions test/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,81 +51,81 @@ SAILLIBDIR="$DIR/../../lib/"

cd $RISCVDIR

# Do 'make clean' to avoid cross-arch pollution.
## Do 'make clean' to avoid cross-arch pollution.
#make clean
#
#printf "Building 32-bit RISCV specification...\n"
#if ARCH=RV32 make ocaml_emulator/riscv_ocaml_sim_RV32 ;
#then
# green "Building 32-bit RISCV OCaml emulator" "ok"
#else
# red "Building 32-bit RISCV OCaml emulator" "fail"
#fi
#for test in $DIR/riscv-tests/rv32*.elf; do
# # skip F/D tests on OCaml for now
# pat='rv32ud-.+elf'
# if [[ $(basename $test) =~ $pat ]];
# then continue
# fi
# pat='rv32uf-.+elf'
# if [[ $(basename $test) =~ $pat ]];
# then continue
# fi
# if $RISCVDIR/ocaml_emulator/riscv_ocaml_sim_RV32 "$test" >"${test/.elf/.out}" 2>&1 && grep -q SUCCESS "${test/.elf/.out}"
# then
# green "OCaml-32 $(basename $test)" "ok"
# else
# red "OCaml-32 $(basename $test)" "fail"
# fi
#done
#finish_suite "32-bit RISCV OCaml tests"
#
#
#if ARCH=RV32 make c_emulator/riscv_sim_RV32;
#then
# green "Building 32-bit RISCV C emulator" "ok"
#else
# red "Building 32-bit RISCV C emulator" "fail"
#fi
#for test in $DIR/riscv-tests/rv32*.elf; do
# if timeout 5 $RISCVDIR/c_emulator/riscv_sim_RV32 -p $test > ${test%.elf}.cout 2>&1 && grep -q SUCCESS ${test%.elf}.cout
# then
# green "C-32 $(basename $test)" "ok"
# else
# red "C-32 $(basename $test)" "fail"
# fi
#done
#finish_suite "32-bit RISCV C tests"
#
## Do 'make clean' to avoid cross-arch pollution.
make clean

printf "Building 32-bit RISCV specification...\n"
if ARCH=RV32 make ocaml_emulator/riscv_ocaml_sim_RV32 ;
then
green "Building 32-bit RISCV OCaml emulator" "ok"
else
red "Building 32-bit RISCV OCaml emulator" "fail"
fi
for test in $DIR/riscv-tests/rv32*.elf; do
# skip F/D tests on OCaml for now
pat='rv32ud-.+elf'
if [[ $(basename $test) =~ $pat ]];
then continue
fi
pat='rv32uf-.+elf'
if [[ $(basename $test) =~ $pat ]];
then continue
fi
if $RISCVDIR/ocaml_emulator/riscv_ocaml_sim_RV32 "$test" >"${test/.elf/.out}" 2>&1 && grep -q SUCCESS "${test/.elf/.out}"
then
green "OCaml-32 $(basename $test)" "ok"
else
red "OCaml-32 $(basename $test)" "fail"
fi
done
finish_suite "32-bit RISCV OCaml tests"


if ARCH=RV32 make c_emulator/riscv_sim_RV32;
then
green "Building 32-bit RISCV C emulator" "ok"
else
red "Building 32-bit RISCV C emulator" "fail"
fi
for test in $DIR/riscv-tests/rv32*.elf; do
if timeout 5 $RISCVDIR/c_emulator/riscv_sim_RV32 -p $test > ${test%.elf}.cout 2>&1 && grep -q SUCCESS ${test%.elf}.cout
then
green "C-32 $(basename $test)" "ok"
else
red "C-32 $(basename $test)" "fail"
fi
done
finish_suite "32-bit RISCV C tests"

# Do 'make clean' to avoid cross-arch pollution.
make clean

printf "Building 64-bit RISCV specification...\n"

if make ocaml_emulator/riscv_ocaml_sim_RV64 ;
then
green "Building 64-bit RISCV OCaml emulator" "ok"
else
red "Building 64-bit RISCV OCaml emulator" "fail"
fi
for test in $DIR/riscv-tests/rv64*.elf; do
# skip F/D tests on OCaml for now
pat='rv64ud-.+elf'
if [[ $(basename $test) =~ $pat ]];
then continue
fi
pat='rv64uf-.+elf'
if [[ $(basename $test) =~ $pat ]];
then continue
fi
if $RISCVDIR/ocaml_emulator/riscv_ocaml_sim_RV64 "$test" >"${test/.elf/.out}" 2>&1 && grep -q SUCCESS "${test/.elf/.out}"
then
green "OCaml-64 $(basename $test)" "ok"
else
red "OCaml-64 $(basename $test)" "fail"
fi
done
finish_suite "64-bit RISCV OCaml tests"
#
#printf "Building 64-bit RISCV specification...\n"
#
#if make ocaml_emulator/riscv_ocaml_sim_RV64 ;
#then
# green "Building 64-bit RISCV OCaml emulator" "ok"
#else
# red "Building 64-bit RISCV OCaml emulator" "fail"
#fi
#for test in $DIR/riscv-tests/rv64*.elf; do
# # skip F/D tests on OCaml for now
# pat='rv64ud-.+elf'
# if [[ $(basename $test) =~ $pat ]];
# then continue
# fi
# pat='rv64uf-.+elf'
# if [[ $(basename $test) =~ $pat ]];
# then continue
# fi
# if $RISCVDIR/ocaml_emulator/riscv_ocaml_sim_RV64 "$test" >"${test/.elf/.out}" 2>&1 && grep -q SUCCESS "${test/.elf/.out}"
# then
# green "OCaml-64 $(basename $test)" "ok"
# else
# red "OCaml-64 $(basename $test)" "fail"
# fi
#done
#finish_suite "64-bit RISCV OCaml tests"

if make c_emulator/riscv_sim_RV64;
then
Expand All @@ -143,27 +143,27 @@ for test in $DIR/riscv-tests/rv64*.elf; do
done
finish_suite "64-bit RISCV C tests"

# Do 'make clean' to avoid cross-arch pollution.
make clean

if ARCH=RV32 make c_emulator/riscv_rvfi_RV32;
then
green "Building 32-bit RISCV RVFI C emulator" "ok"
else
red "Building 32-bit RISCV RVFI C emulator" "fail"
fi
finish_suite "32-bit RISCV RVFI C tests"

# Do 'make clean' to avoid cross-arch pollution.
make clean

if ARCH=RV64 make c_emulator/riscv_rvfi_RV64;
then
green "Building 64-bit RISCV RVFI C emulator" "ok"
else
red "Building 64-bit RISCV RVFI C emulator" "fail"
fi
finish_suite "64-bit RISCV RVFI C tests"
## Do 'make clean' to avoid cross-arch pollution.
#make clean
#
#if ARCH=RV32 make c_emulator/riscv_rvfi_RV32;
#then
# green "Building 32-bit RISCV RVFI C emulator" "ok"
#else
# red "Building 32-bit RISCV RVFI C emulator" "fail"
#fi
#finish_suite "32-bit RISCV RVFI C tests"
#
## Do 'make clean' to avoid cross-arch pollution.
#make clean
#
#if ARCH=RV64 make c_emulator/riscv_rvfi_RV64;
#then
# green "Building 64-bit RISCV RVFI C emulator" "ok"
#else
# red "Building 64-bit RISCV RVFI C emulator" "fail"
#fi
#finish_suite "64-bit RISCV RVFI C tests"

printf "Passed ${all_pass} out of $(( all_pass + all_fail ))\n\n"
XML="<testsuites tests=\"$(( all_pass + all_fail ))\" failures=\"${all_fail}\">\n$SUITES_XML</testsuites>\n"
Expand Down

0 comments on commit 7e5415f

Please sign in to comment.