summaryrefslogtreecommitdiffstats
path: root/postgresql-odbc-tests/tasks/upstream-testsuite/runtest.sh
blob: 013d7b8379954210aa796758086c7a3cbeb1b40e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
export DTF_TEST_ID="upstream-testsuite"
export DTF_TEST_DESCRIPTION="Run the upstream testsuite available with
distribution tarball."

check_libdir()
{
    test -d "$1" || return 2
    cd "$1" || return 1
    su postgres -c "make installcheck"
}

run()
{
    local libsubdir="postgresql-odbc/test/"
    local rc=$DTF_RESULT_SUCCESS
    local resdir=

    for i in /usr/lib64 /usr/lib; do
        local workdir="$i/$libsubdir"

        check_libdir "$workdir"
        case "$?" in
            1)
                rc="$DTF_RESULT_FAILURE"
                cat "$i/regression.diffs"
                # fall through
                ;&
            0)
                resdir="$workdir"
                break
                ;;
            2)
                # skip
                ;;
        esac
            break
    done

    dtf_generate_results_tarball "$resdir" || return 1

    return "$rc"
}