#!/bin/sh

# This script it top level script for lsb xml test suites. There are two 
# kind of test suites available with XML. 
# a) XML regression test suite
# b) XML API test cases 
# This script first executes XML regression test and after that XML API test.
# The output journal file produce by this script is journal.libxml2

if [ ! -f ./runtest ]; then
    echo "XML regression test binary is missing, terminating!"
    echo ""
    exit 1
else
    echo "Starting XML regression test..."
    ./runtest
fi

if [ ! -f ./testapi ]; then
    echo "XML API test binary is missing, terminating!"
    echo ""
    exit 1
else
    echo "Starting XML API test..."
    ./testapi
fi

if [ -f ./journal.runtest ] && [ -f ./journal.testapi ]; then
    cat ./journal.runtest ./journal.testapi > ./journal.libxml2 
    rm -rf ./journal.runtest ./journal.testapi ./stderr-dump.log
else
    echo "Journal files are missing"
    echo ""
    exit 1
fi
