Add Tercel PHY reset synchronization
[microwatt.git] / scripts / run_test_console.sh
1 #!/bin/bash
2
3 # Runs a test and checks the console output against known good output
4
5 if [ $# -ne 1 ]; then
6 echo "Usage: run_test.sh <test>"
7 exit 1
8 fi
9
10 TEST=$1
11
12 TMPDIR=$(mktemp -d)
13
14 function finish {
15 rm -rf "$TMPDIR"
16 }
17
18 trap finish EXIT
19
20 MICROWATT_DIR=$PWD
21
22 cd $TMPDIR
23
24 cp ${MICROWATT_DIR}/tests/${TEST}.bin main_ram.bin
25
26 ${MICROWATT_DIR}/core_tb > /dev/null 2> test1.out || true
27
28 grep -v "Failed to bind debug socket" test1.out > test.out
29
30 cp ${MICROWATT_DIR}/tests/${TEST}.console_out exp.out
31
32 cp test.out /tmp
33 cp exp.out /tmp
34
35 diff -q test.out exp.out && echo "$TEST PASS" && exit 0
36
37 echo "$TEST FAIL ********"
38 exit 1