summaryrefslogtreecommitdiff
path: root/debian/tests/tests.sh
blob: b681dea31a470166878b43bb9152563e623b547f (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
43
44
45
46
47
48
49
50
51
52
53
54
#!/bin/bash

names="test1 test2"

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

testSO() {
    cwd=$(pwd)
    cd $AUTOPKGTEST_TMP
    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
}

testStatic() {
    cwd=$(pwd)
    cd $AUTOPKGTEST_TMP
    for name in $names
    do
        echo "Building."
        set -x
        gfortran $name.f90 -O3 -march=native -static -llbfgsb -lblas -pthread -o $name-static
        ret=$?
        set +x
        assertEquals 0 $ret
        
        echo "Running."
        set -x
        ./$name-static
        ret=$?
        set +x
        assertEquals 0 $ret
    done
    cd $cwd
}

. shunit2