#!../../../common/bats/bin/bats
# -*-sh-*-

load ./common/test_helper_functions || exit 1
source ./common/functions || exit 1

if [ -s ./common/TEST_ENV ];then
    source ./common/TEST_ENV
fi

check_rms

setup() {
    rm=$RESOURCE_MANAGER
    testname="libs/PLASMA"
    ARGS=0

    if [ "$LMOD_FAMILY_COMPILER" == "acfl" ];then
        skip "plasma tests segfault with acfl"
    fi
    if [ "$LMOD_FAMILY_COMPILER" == "intel" ];then
        skip "plasma tests segfault with intel"
    fi
}

@test "[libs/PLASMA/C_test] C_test under resource manager ($RESOURCE_MANAGER/$LMOD_FAMILY_COMPILER)" {
    if [ ! -s C_test ];then
	flunk "C_test binary does not exist"
    fi

    run_serial_binary -t 5 ./C_test "${ARGS}"
    assert_success
}

@test "[libs/PLASMA/F90_test] F90_test under resource manager ($RESOURCE_MANAGER/$LMOD_FAMILY_COMPILER)" {
    if [ ! -s F90_test ];then
	flunk "F90_test binary does not exist"
    fi

    run_serial_binary -t 5 ./F90_test "< gebrd_example.d"
    assert_success
}
