run_compilation_autotests.bash 2.48 KB
Newer Older
1 2
#!/bin/bash

gauthier's avatar
sync  
gauthier committed
3 4
if [ -s $OPENAIR_DIR/cmake_targets/tools/build_helper ] ; then
   source $OPENAIR_DIR/cmake_targets/tools/build_helper
5 6 7 8 9
else
   echo "Error: no file in the file tree: is OPENAIR_DIR variable set?"
   exit 1
fi

10 11 12
# include the jUnit-like logging functions
source $OPENAIR_DIR/cmake_targets/tools/test_helper

thomasl's avatar
thomasl committed
13
test_compile() {
14
    xUnit_start
thomasl's avatar
thomasl committed
15 16 17
    mkdir -p $tdir/$1/build
    cd $tdir/$1/build
    {
18 19 20
        cmake ..
        rm -f $3
        make -j4 $2
thomasl's avatar
thomasl committed
21 22
    } > $tdir/log/$1.txt 2>&1
    if [ -s $3 ] ; then
navid's avatar
navid committed
23
        cp $3 $tdir/bin/`basename $3`.$5.$1
24
        echo_success "$1 $3 $5 compiled"
25 26
        xUnit_success "compilation" $1
    else
27
        echo_error "$1 $3 $5 compilation failed"
28 29
        xUnit_fail "compilation" $1
    fi
thomasl's avatar
thomasl committed
30 31
}

32 33 34 35 36
tdir=$OPENAIR_DIR/cmake_targets/autotests
mkdir -p $tdir/bin $tdir/log

updated=$(svn st -q $OPENAIR_DIR)
if [ "$updated" != "" ] ; then
37
	echo_warning "some files are not in svn:\n $updated"
38 39
fi

thomasl's avatar
thomasl committed
40 41 42
cd $tdir 

test_compile \
43 44
    test.0101 oaisim_nos1 \
    oaisim_nos1  $tdir/bin/oaisim.r8 rel8.nos1
thomasl's avatar
thomasl committed
45 46

test_compile \
47 48
    test.0102 oaisim_nos1 \
    oaisim_nos1  $tdir/bin/oaisim.r8.nas rel8.nos1.nas
thomasl's avatar
thomasl committed
49

navid's avatar
navid committed
50
cp $tdir/test.0103/CMakeLists.txt.Rel8  $tdir/test.0103/CMakeLists.txt 
thomasl's avatar
thomasl committed
51 52
test_compile \
    test.0103 lte-softmodem \
navid's avatar
navid committed
53 54 55 56 57 58 59 60 61 62 63
    lte-softmodem  $tdir/bin/lte-softmodem.r8.rf Rel8.EXMIMO

cp $tdir/test.0103/CMakeLists.txt.Rel10  $tdir/test.0103/CMakeLists.txt   
test_compile \
    test.0103 lte-softmodem \
    lte-softmodem  $tdir/bin/lte-softmodem.r10.rf Rel10.EXMIMO

cp $tdir/test.0103/CMakeLists.txt.USRP  $tdir/test.0103/CMakeLists.txt   
test_compile \
    test.0103 lte-softmodem \
    lte-softmodem  $tdir/bin/lte-softmodem.r10.rf Rel10.USRP
thomasl's avatar
thomasl committed
64 65 66

test_compile \
    test.0104 dlsim \
navid's avatar
navid committed
67
    dlsim  $tdir/bin/dlsim dlsim.Rel8
thomasl's avatar
thomasl committed
68 69 70

test_compile \
    test.0104 ulsim \
navid's avatar
navid committed
71
    ulsim  $tdir/bin/ulsim ulsim.Rel8
thomasl's avatar
thomasl committed
72 73 74

test_compile \
    test.0106 oaisim \
navid's avatar
navid committed
75
    oaisim  $tdir/bin/oaisim.r8.itti Rel8.itti
thomasl's avatar
thomasl committed
76 77

test_compile \
78
    test.0107 oaisim_nos1 \
navid's avatar
navid committed
79
    oaisim_nos1  $tdir/bin/oaisim.r10 Rel10.nos1
thomasl's avatar
thomasl committed
80 81 82

test_compile \
    test.0108 oaisim \
83
    oaisim  $tdir/bin/oaisim.r10.itti rel10.itti
thomasl's avatar
thomasl committed
84 85 86

test_compile \
    test.0114 oaisim \
87
    oaisim  $tdir/bin/oaisim.r8.itti.ral rel8.itti.ral
thomasl's avatar
thomasl committed
88 89 90

test_compile \
    test.0115 oaisim \
navid's avatar
navid committed
91
    oaisim  $tdir/bin/oaisim.r10.itti.ral rel10.itti.ral 
thomasl's avatar
thomasl committed
92 93 94

test_compile \
    test.0120 nasmesh \
95
    CMakeFiles/nasmesh/nasmesh.ko $tdir/bin/nasmesh.ko 
96

97 98 99 100
test_compile \
    test.0130 rrh_gw \
    rrh_gw $tdir/bin/rrh_gw

101 102
# write the test results into a file
xUnit_write "$tdir/log/compilation_autotests.xml"