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

Lionel Gauthier's avatar
sync  
Lionel 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
tdir=$OPENAIR_DIR/cmake_targets/autotests

guptar's avatar
guptar committed
12 13
results_file=$tdir/log/compilation_autotests.xml

14 15 16
# include the jUnit-like logging functions
source $OPENAIR_DIR/cmake_targets/tools/test_helper

thomasl's avatar
thomasl committed
17
test_compile() {
18
    xUnit_start
19
    test_name=$1.$2
guptar's avatar
guptar committed
20 21 22
    compile_prog=$2
    exec_prog=$3
    build_dir=$tdir/$1/build
23
    log_file=$tdir/log/test.$1.txt
guptar's avatar
guptar committed
24 25 26
    target=$5
    echo "Compiling test case $test_name. Log file = $log_file"
    rm -fr $build_dir
thomasl's avatar
thomasl committed
27
    mkdir -p $tdir/$1/build
guptar's avatar
guptar committed
28
    cd $build_dir
thomasl's avatar
thomasl committed
29
    {
30
        cmake ..
guptar's avatar
guptar committed
31 32
        rm -f $exec_prog
        make -j`nproc` $compile_prog
33
    } >> $log_file 2>&1
guptar's avatar
guptar committed
34 35 36 37
    if [ -s $exec_prog ] ; then
        cp $exec_prog $tdir/bin/`basename $exec_prog`.$target.$test_name
        echo_success "$test_name $exec_prog $target compiled"
        xUnit_success "compilation" $test_name "PASS" 1
38
    else
guptar's avatar
guptar committed
39 40
        echo_error "$test_name $exec_prog $target compilation failed"
        xUnit_fail "compilation" $test_name "FAIL" 1
41
    fi
thomasl's avatar
thomasl committed
42 43
}

44 45 46 47
mkdir -p $tdir/bin $tdir/log

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

thomasl's avatar
thomasl committed
51 52 53
cd $tdir 

test_compile \
guptar's avatar
guptar committed
54
    010101 oaisim_nos1 \
55
    oaisim_nos1  $tdir/bin/oaisim.r8 rel8.nos1
thomasl's avatar
thomasl committed
56 57

test_compile \
guptar's avatar
guptar committed
58
    010102 oaisim_nos1 \
59
    oaisim_nos1  $tdir/bin/oaisim.r8.nas rel8.nos1.nas
thomasl's avatar
thomasl committed
60

61
cp $tdir/010103/CMakeLists.txt.Rel8  $tdir/010103/CMakeLists.txt 
thomasl's avatar
thomasl committed
62
test_compile \
guptar's avatar
guptar committed
63
    010103 lte-softmodem \
navid's avatar
navid committed
64 65
    lte-softmodem  $tdir/bin/lte-softmodem.r8.rf Rel8.EXMIMO

66
cp $tdir/010103/CMakeLists.txt.Rel10  $tdir/010103/CMakeLists.txt   
navid's avatar
navid committed
67
test_compile \
guptar's avatar
guptar committed
68
    010103 lte-softmodem \
navid's avatar
navid committed
69 70
    lte-softmodem  $tdir/bin/lte-softmodem.r10.rf Rel10.EXMIMO

71
cp $tdir/010103/CMakeLists.txt.USRP  $tdir/010103/CMakeLists.txt   
navid's avatar
navid committed
72
test_compile \
guptar's avatar
guptar committed
73
    010103 lte-softmodem \
navid's avatar
navid committed
74
    lte-softmodem  $tdir/bin/lte-softmodem.r10.rf Rel10.USRP
thomasl's avatar
thomasl committed
75 76

test_compile \
guptar's avatar
guptar committed
77
    010104 dlsim \
navid's avatar
navid committed
78
    dlsim  $tdir/bin/dlsim dlsim.Rel8
thomasl's avatar
thomasl committed
79 80

test_compile \
guptar's avatar
guptar committed
81
    010104 ulsim \
navid's avatar
navid committed
82
    ulsim  $tdir/bin/ulsim ulsim.Rel8
thomasl's avatar
thomasl committed
83

84
test_compile \
guptar's avatar
guptar committed
85
    010104 pucchsim \
86 87 88
    pucchsim  $tdir/bin/pucchsim pucchsim.Rel8

test_compile \
guptar's avatar
guptar committed
89
    010104 prachsim \
90 91 92
    prachsim  $tdir/bin/prachsim prachsim.Rel8

test_compile \
guptar's avatar
guptar committed
93
    010104 pdcchsim \
94 95 96
    pdcchsim  $tdir/bin/pdcchsim pdcchsim.Rel8

test_compile \
guptar's avatar
guptar committed
97
    010104 pbchsim \
98 99 100
    pbchsim  $tdir/bin/pbchim pbchsim.Rel8

test_compile \
guptar's avatar
guptar committed
101
    010104 mbmssim \
102 103
    mbmssim  $tdir/bin/mbmssim mbmssim.Rel8

104
test_compile \
guptar's avatar
guptar committed
105
    010104 test_secu_knas_encrypt_eia1 \
106 107 108
    test_secu_knas_encrypt_eia1  $tdir/bin/test_secu_knas_encrypt_eia1 test_secu_knas_encrypt_eia1.Rel10

test_compile \
guptar's avatar
guptar committed
109
    010104 test_secu_kenb \
110 111 112
    test_secu_kenb  $tdir/bin/test_secu_kenb test_secu_kenb.Rel10

test_compile \
guptar's avatar
guptar committed
113
    010104 test_aes128_ctr_encrypt \
114 115 116
    test_aes128_ctr_encrypt  $tdir/bin/test_aes128_ctr_encrypt test_aes128_ctr_encrypt.Rel10

test_compile \
guptar's avatar
guptar committed
117
    010104 test_aes128_ctr_decrypt \
118 119 120
    test_aes128_ctr_decrypt  $tdir/bin/test_aes128_ctr_decrypt test_aes128_ctr_decrypt.Rel10

test_compile \
guptar's avatar
guptar committed
121
    010104 test_secu_knas_encrypt_eea2 \
122 123 124
    test_secu_knas_encrypt_eea2  $tdir/bin/test_secu_knas_encrypt_eea2 test_secu_knas_encrypt_eea2.Rel10

test_compile \
guptar's avatar
guptar committed
125
    010104 test_secu_knas \
126 127
    test_secu_knas  $tdir/bin/test_secu_knas test_secu_knas.Rel10

128
test_compile \
guptar's avatar
guptar committed
129
    010104 test_secu_knas_encrypt_eea1 \
130 131
    test_secu_knas_encrypt_eea1  $tdir/bin/test_secu_knas_encrypt_eea1 test_secu_knas_encrypt_eea1.Rel10

132
test_compile \
guptar's avatar
guptar committed
133
    010104 test_kdf \
134 135 136
    test_kdf  $tdir/bin/test_kdf test_kdf.Rel10

test_compile \
guptar's avatar
guptar committed
137
    010104 test_aes128_cmac_encrypt \
138 139 140
    test_aes128_cmac_encrypt  $tdir/bin/test_aes128_cmac_encrypt test_aes128_cmac_encrypt.Rel10

test_compile \
guptar's avatar
guptar committed
141
    010104 test_secu_knas_encrypt_eia2 \
142 143
    test_secu_knas_encrypt_eia2  $tdir/bin/test_secu_knas_encrypt_eia2 test_secu_knas_encrypt_eia2.Rel10

thomasl's avatar
thomasl committed
144
test_compile \
guptar's avatar
guptar committed
145
    010106 oaisim \
navid's avatar
navid committed
146
    oaisim  $tdir/bin/oaisim.r8.itti Rel8.itti
thomasl's avatar
thomasl committed
147 148

test_compile \
guptar's avatar
guptar committed
149
    010107 oaisim_nos1 \
navid's avatar
navid committed
150
    oaisim_nos1  $tdir/bin/oaisim.r10 Rel10.nos1
thomasl's avatar
thomasl committed
151 152

test_compile \
guptar's avatar
guptar committed
153
    010108 oaisim \
154
    oaisim  $tdir/bin/oaisim.r10.itti rel10.itti
thomasl's avatar
thomasl committed
155

156 157 158
#test_compile \  LG: RAL REMOVED
#    test.0114 oaisim \
#    oaisim  $tdir/bin/oaisim.r8.itti.ral rel8.itti.ral
thomasl's avatar
thomasl committed
159

160 161 162
#test_compile \  LG: RAL REMOVED
#    test.0115 oaisim \
#    oaisim  $tdir/bin/oaisim.r10.itti.ral rel10.itti.ral 
thomasl's avatar
thomasl committed
163 164

test_compile \
guptar's avatar
guptar committed
165
    010120 nasmesh \
166
    CMakeFiles/nasmesh/nasmesh.ko $tdir/bin/nasmesh.ko 
167

168
test_compile \
guptar's avatar
guptar committed
169
    010130 rrh_gw \
170 171
    rrh_gw $tdir/bin/rrh_gw

172
# write the test results into a file
guptar's avatar
guptar committed
173 174 175
xUnit_write "$results_file"

echo "Test Results are written to $results_file"