#!/bin/sh
usage() { echo "Usage: $0 native | remote <hostname>"; exit 1; }
test $# -eq 0 && usage
test $1 = native -o \( $1 = remote -a $# = 2 \) || usage
test $1 = remote && export GCC_TARGET_HOSTNAME=$2
if [ $1 = native ] ; then board=cell-native; else board=cell-remote; fi
bin=/usr/bin
exec /usr/share/cell-gcc/test_installed \
  --with-testsuite=/usr/share/cell-gcc/testsuite \
  --with-gcc=$bin/ppu-gcc \
  --with-g++=$bin/ppu-g++ \
  --with-gfortran=$bin/ppu-gfortran \
  --without-objc \
  --target_board $board
test $1 = native && unset GCC_TARGET_HOSTNAME
export TARGET_GNATMAKE=/usr/bin/ppu-gnatmake
export TARGET_GNATCHOP=/usr/bin/ppu-gnatchop
export HOST_GNATMAKE=/usr/bin/ppu-gnatmake
export HOST_GNATCHOP=/usr/bin/ppu-gnatchop
export HOST_GNATLS=/usr/bin/ppu-gnatls
export GCC_DRIVER=/usr/bin/ppu-gcc
export GCC=/usr/bin/ppu-gcc
export testdir=/usr/share/cell-gcc/testsuite/ada/acats
[ -d /usr/share/cell-gcc/testsuite/ada/acats ] && /usr/share/cell-gcc/testsuite/ada/acats/run_all.sh
