File: run-testsuite

package info (click to toggle)
yosys 0.8-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 9,084 kB
  • sloc: cpp: 82,579; python: 2,725; yacc: 2,018; sh: 1,516; makefile: 884; lex: 492; perl: 399; ansic: 175; vhdl: 46; tcl: 14
file content (37 lines) | stat: -rwxr-xr-x 817 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/bash

bad=

# If you encounter the following problem with Valgrind like I did:
#     https://bugzilla.redhat.com/show_bug.cgi?id=455644
# you can pass the environment variable NO_VALGRIND=1 to run the testsuite
# without it.
if [ "$NO_VALGRIND" ]; then
	cmd=(./testsuite)
else
	cmd=(valgrind --error-exitcode=1 --leak-check=full ./testsuite)
fi

set -o pipefail
# Stdout goes directly to testsuite.out; stderr goes down the pipe.
if ! "${cmd[@]}" 2>&1 >testsuite.out | tee testsuite.err; then
	echo >&2 'Memory errors!'
	bad=1
fi

if grep 'LEAK SUMMARY' testsuite.err >/dev/null; then
	echo >&2 'Memory leaks!'
	bad=1
fi

if ! diff -u testsuite.expected testsuite.out; then
	echo >&2 'Output is incorrect!'
	bad=1
fi

if [ $bad ]; then
	echo >&2 'Test suite failed!'
	exit 1
else
	echo 'Test suite passed.'
fi