summaryrefslogtreecommitdiff
path: root/debian/tests/tests.sh
blob: 135564ca9551f9105676ca3043617f3e59c6951f (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
#!/bin/bash

oneTimeSetUp() {
    set -u
    cp debian/tests/test*.f90 $AUTOPKGTEST_TMP
}

test() {
    cwd=$(pwd)
    cd $AUTOPKGTEST_TMP

    names="test1 test2"
    for name in $names
    do
        echo "Building."
        set -x
        gfortran -O3 -march=native -llbfgsb -o $name $name.f90
        ret=$?
        set +x
        assertEquals 0 $ret
        
        echo "Running."
        set -x
        ./$name
        ret=$?
        set +x
        assertEquals 0 $ret
    done
    cd $cwd
}

. shunit2