#!/usr/bin/env -S bats --report-formatter junit --formatter tap
# -*-sh-*-

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

family=$LMOD_FAMILY_COMPILER

@test "[Compilers] debugger man page ($family)" {
    if [ "$family" = "gnu" ];then
        run man -w gdb
        assert_success
    elif [ "$family" = "intel" ];then
	module load debugger
        run man -w gdb-oneapi
        assert_success
    fi
}

@test "[Compilers] debugger availability ($family)" {
    if [ "$family" = "gnu" ];then
        run which gdb
        assert_success

        run gdb --version
        assert_success
    elif [ "$family" = "intel" ];then
	module load debugger
        run which gdb-oneapi
        assert_success

        run gdb-oneapi --version
        assert_success
    fi
}





