#!/bin/bash
source ../test_common.sh
set_test_name "${BASH_SOURCE[0]}"

testfun() {
    [[ -f orthologer.sh ]] || { echo "error: setup_test.sh not executed"; return 255; }

    # check setup
    ./orthologer.sh -xp >& /dev/null || { echo "error: failed check - run ./orthologer.sh -xp to see details"; return 255; }

    # run full pipeline
    ./orthologer.sh -r all

    # check existance of result

    local label="test"
    local fbase="Cluster/${label}.og"
    [[ -f ${fbase} ]] || { echo "error: missing result file ${fbase}"; return 255; }
    
    # compare with reference
    cmp_with_ref "$fbase" "proj_prot/ref_${label}.og"
    return $?
}
run_test
exit $?
