From 7504b3d87d6143661746d85c3c3e4052939b4e52 Mon Sep 17 00:00:00 2001 From: Bo Xu Date: Tue, 2 Dec 2014 13:06:22 -0800 Subject: Initial check in of big integer library, v2010.04.30 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/773443004 --- third_party/bigint/run-testsuite | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100755 third_party/bigint/run-testsuite (limited to 'third_party/bigint/run-testsuite') diff --git a/third_party/bigint/run-testsuite b/third_party/bigint/run-testsuite new file mode 100755 index 0000000000..ff73729164 --- /dev/null +++ b/third_party/bigint/run-testsuite @@ -0,0 +1,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 -- cgit v1.2.3