#!/bin/sh
#set -ex

if [ $# != 0 ]; then
	COMPILER_DIR=$1
fi

if [ "$COMPILER_DIR" == "" ]; then
	echo "Usage : ./reg_test.sh COMPILER_DIR"
	exit
fi


echo 'Changing to gcc build directory sb-toolchain/cc/gcc-3.4-pass2/work/build-gcc-2'
cd ../../cc/gcc-3.4-pass2/work/build-gcc-2
echo 'Starting all tests'
/scratchbox/tools/bin/time make check
echo 'All tests done'

mkdir -p $COMPILER_DIR/share/test-results
cp gcc/testsuite/gcc.*  $COMPILER_DIR/share/test-results/
cp gcc/testsuite/g++.*  $COMPILER_DIR/share/test-results/
cp arm-linux-uclibc/libstdc++-v3/testsuite/libstdc++.*  $COMPILER_DIR/share/test-results/

cd ../../../../test_tools/test_scripts

