You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
834 B
31 lines
834 B
#!/bin/bash
|
|
|
|
GREEN="\e[32m"
|
|
RED="\e[31m"
|
|
CEND="\e[39m"
|
|
|
|
VRISCV=../build/vriscv
|
|
|
|
# test executes a test
|
|
# Arguments: test(name, executable, expected)
|
|
test() {
|
|
NAME=$1
|
|
TEST=$2
|
|
RESULT=$3
|
|
|
|
echo -ne "${NAME}""\t\t\t\t\t\t"
|
|
$VRISCV $TEST >/dev/null 2>&1
|
|
if [ $? -eq $RESULT ]; then
|
|
echo -e $GREEN"PASSED"$CEND
|
|
else
|
|
echo -e $RED"FAILED"$CEND
|
|
fi
|
|
}
|
|
|
|
test "ADDI : Add Immediate " "../build/tests/addi " 186
|
|
test "MV : Move registers " "../build/tests/mv " 186
|
|
test "BEQ : Branch EQual " "../build/tests/beq " 0
|
|
test "BLT : Branch Less Than " "../build/tests/blt " 0
|
|
test "JAL : Jump And Link " "../build/tests/jal " 0
|
|
test "SWLW : Store Word Load Word " "../build/tests/swlw " 0
|
|
test "JALR : Jump And Link Register " "../build/tests/jalr " 0
|
|
|