#!/bin/bash

. buildsys/functions

ProcessArgs $*
Assert LoadConfigs
Assert SetupLogDir
Assert SetupResFile

cd ../../..

SetState Testing
ArchiveLogs

if [ "$DEP" != "none" ]
then
   OSPL_HOME=$DEPWORKDIR
   export OSPL_HOME
fi

SPLICE_PLATFORM=$SETUP_TYPE
export SPLICE_PLATFORM
. ./configure -full

if [ "$CONFIGURATION" != "OK" ]
then
    echo  "ERROR: configuration - dcps_build_dbt_tests"
    exit 1
fi

echo "BUILD/DBT=RUNNING" >> $RESFILE
ArchiveLogs

cd testsuite/dbt ||
{
    echo "ERROR: could not cd to testsuite/dbt dir - dcps_build_dbt_tests";
    exit 4;
}
make -k VERBOSE=yes
if [ $? = 0 ]
then
    exit 0
else
    exit 5
fi
