#!/bin/sh -e

# prepare before test

cp -rf scripts TestSuite "$AUTOPKGTEST_TMP"
cd "$AUTOPKGTEST_TMP"
mkdir -p src
cp -f /usr/bin/dmrg `find /usr/lib -name observe -type f` src

# TODO use component to package these results
git clone https://code.ornl.gov/gonzalo_3/OraclesDmrg.git
cd "$AUTOPKGTEST_TMP"/OraclesDmrg
git pull origin features

# run test

cd "$AUTOPKGTEST_TMP"/TestSuite
rm -Rf tests/
cp -f batchDollarized.pbs.sample batchDollarized.pbs
./ci.pl -n "$1-$2" -S bash

# compare test results with orcales reference

./postCi.pl -g "$AUTOPKGTEST_TMP"/OraclesDmrg/oracles/tests -n '$1-$2'
