run_compilation_autotests.bash 5.77 KB
Newer Older
1
#!/bin/bash
2 3 4 5 6
#/*
# * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
# * contributor license agreements.  See the NOTICE file distributed with
# * this work for additional information regarding copyright ownership.
# * The OpenAirInterface Software Alliance licenses this file to You under
Cedric Roux's avatar
Cedric Roux committed
7
# * the OAI Public License, Version 1.1  (the "License"); you may not use this file
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
# * except in compliance with the License.
# * You may obtain a copy of the License at
# *
# *      http://www.openairinterface.org/?page_id=698
# *
# * Unless required by applicable law or agreed to in writing, software
# * distributed under the License is distributed on an "AS IS" BASIS,
# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# * See the License for the specific language governing permissions and
# * limitations under the License.
# *-------------------------------------------------------------------------------
# * For more information about the OpenAirInterface (OAI) Software Alliance:
# *      contact@openairinterface.org
# */

# \author Navid Nikaein, Rohit Gupta
24

gauthier's avatar
sync  
gauthier committed
25 26
if [ -s $OPENAIR_DIR/cmake_targets/tools/build_helper ] ; then
   source $OPENAIR_DIR/cmake_targets/tools/build_helper
27 28 29 30 31
else
   echo "Error: no file in the file tree: is OPENAIR_DIR variable set?"
   exit 1
fi

32 33
tdir=$OPENAIR_DIR/cmake_targets/autotests

guptar's avatar
guptar committed
34 35
results_file=$tdir/log/compilation_autotests.xml

36 37 38
# include the jUnit-like logging functions
source $OPENAIR_DIR/cmake_targets/tools/test_helper

thomasl's avatar
thomasl committed
39
test_compile() {
40
    xUnit_start
41
    test_name=$1.$2
guptar's avatar
guptar committed
42 43 44
    compile_prog=$2
    exec_prog=$3
    build_dir=$tdir/$1/build
Cedric Roux's avatar
Cedric Roux committed
45
    log_file=$tdir/log/test.$1.$2.$5.txt
guptar's avatar
guptar committed
46 47 48
    target=$5
    echo "Compiling test case $test_name. Log file = $log_file"
    rm -fr $build_dir
thomasl's avatar
thomasl committed
49
    mkdir -p $tdir/$1/build
guptar's avatar
guptar committed
50
    cd $build_dir
thomasl's avatar
thomasl committed
51
    {
52
        cmake ..
guptar's avatar
guptar committed
53 54
        rm -f $exec_prog
        make -j`nproc` $compile_prog
55
    } >> $log_file 2>&1
guptar's avatar
guptar committed
56 57 58
    if [ -s $exec_prog ] ; then
        cp $exec_prog $tdir/bin/`basename $exec_prog`.$target.$test_name
        echo_success "$test_name $exec_prog $target compiled"
Cedric Roux's avatar
Cedric Roux committed
59
        xUnit_success "compilation" $test_name "PASS" 1 "$results_file"
60
    else
guptar's avatar
guptar committed
61
        echo_error "$test_name $exec_prog $target compilation failed"
Cedric Roux's avatar
Cedric Roux committed
62
        xUnit_fail "compilation" $test_name "FAIL" 1 "$results_file"
63
    fi
thomasl's avatar
thomasl committed
64 65
}

66 67 68 69
mkdir -p $tdir/bin $tdir/log

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

thomasl's avatar
thomasl committed
73 74 75
cd $tdir 

test_compile \
guptar's avatar
guptar committed
76
    010101 oaisim_nos1 \
77
    oaisim_nos1  $tdir/bin/oaisim.r8 rel8.nos1
thomasl's avatar
thomasl committed
78 79

test_compile \
guptar's avatar
guptar committed
80
    010102 oaisim_nos1 \
81
    oaisim_nos1  $tdir/bin/oaisim.r8.nas rel8.nos1.nas
thomasl's avatar
thomasl committed
82

83
cp $tdir/010103/CMakeLists.txt.Rel8  $tdir/010103/CMakeLists.txt 
thomasl's avatar
thomasl committed
84
test_compile \
guptar's avatar
guptar committed
85
    010103 lte-softmodem \
navid's avatar
navid committed
86 87
    lte-softmodem  $tdir/bin/lte-softmodem.r8.rf Rel8.EXMIMO

88
cp $tdir/010103/CMakeLists.txt.Rel10  $tdir/010103/CMakeLists.txt   
navid's avatar
navid committed
89
test_compile \
guptar's avatar
guptar committed
90
    010103 lte-softmodem \
navid's avatar
navid committed
91 92
    lte-softmodem  $tdir/bin/lte-softmodem.r10.rf Rel10.EXMIMO

93
cp $tdir/010103/CMakeLists.txt.USRP  $tdir/010103/CMakeLists.txt   
navid's avatar
navid committed
94
test_compile \
guptar's avatar
guptar committed
95
    010103 lte-softmodem \
navid's avatar
navid committed
96
    lte-softmodem  $tdir/bin/lte-softmodem.r10.rf Rel10.USRP
thomasl's avatar
thomasl committed
97 98

test_compile \
guptar's avatar
guptar committed
99
    010104 dlsim \
navid's avatar
navid committed
100
    dlsim  $tdir/bin/dlsim dlsim.Rel8
thomasl's avatar
thomasl committed
101 102

test_compile \
guptar's avatar
guptar committed
103
    010104 ulsim \
navid's avatar
navid committed
104
    ulsim  $tdir/bin/ulsim ulsim.Rel8
thomasl's avatar
thomasl committed
105

106
test_compile \
guptar's avatar
guptar committed
107
    010104 pucchsim \
108 109 110
    pucchsim  $tdir/bin/pucchsim pucchsim.Rel8

test_compile \
guptar's avatar
guptar committed
111
    010104 prachsim \
112 113 114
    prachsim  $tdir/bin/prachsim prachsim.Rel8

test_compile \
guptar's avatar
guptar committed
115
    010104 pdcchsim \
116 117 118
    pdcchsim  $tdir/bin/pdcchsim pdcchsim.Rel8

test_compile \
guptar's avatar
guptar committed
119
    010104 pbchsim \
120 121 122
    pbchsim  $tdir/bin/pbchim pbchsim.Rel8

test_compile \
guptar's avatar
guptar committed
123
    010104 mbmssim \
124 125
    mbmssim  $tdir/bin/mbmssim mbmssim.Rel8

126
test_compile \
guptar's avatar
guptar committed
127
    010104 test_secu_knas_encrypt_eia1 \
128 129 130
    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
131
    010104 test_secu_kenb \
132 133 134
    test_secu_kenb  $tdir/bin/test_secu_kenb test_secu_kenb.Rel10

test_compile \
guptar's avatar
guptar committed
135
    010104 test_aes128_ctr_encrypt \
136 137 138
    test_aes128_ctr_encrypt  $tdir/bin/test_aes128_ctr_encrypt test_aes128_ctr_encrypt.Rel10

test_compile \
guptar's avatar
guptar committed
139
    010104 test_aes128_ctr_decrypt \
140 141 142
    test_aes128_ctr_decrypt  $tdir/bin/test_aes128_ctr_decrypt test_aes128_ctr_decrypt.Rel10

test_compile \
guptar's avatar
guptar committed
143
    010104 test_secu_knas_encrypt_eea2 \
144 145 146
    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
147
    010104 test_secu_knas \
148 149
    test_secu_knas  $tdir/bin/test_secu_knas test_secu_knas.Rel10

guptar's avatar
guptar committed
150
test_compile \
guptar's avatar
guptar committed
151
    010104 test_secu_knas_encrypt_eea1 \
guptar's avatar
guptar committed
152 153
    test_secu_knas_encrypt_eea1  $tdir/bin/test_secu_knas_encrypt_eea1 test_secu_knas_encrypt_eea1.Rel10

154
test_compile \
guptar's avatar
guptar committed
155
    010104 test_kdf \
156 157 158
    test_kdf  $tdir/bin/test_kdf test_kdf.Rel10

test_compile \
guptar's avatar
guptar committed
159
    010104 test_aes128_cmac_encrypt \
160 161 162
    test_aes128_cmac_encrypt  $tdir/bin/test_aes128_cmac_encrypt test_aes128_cmac_encrypt.Rel10

test_compile \
guptar's avatar
guptar committed
163
    010104 test_secu_knas_encrypt_eia2 \
164 165
    test_secu_knas_encrypt_eia2  $tdir/bin/test_secu_knas_encrypt_eia2 test_secu_knas_encrypt_eia2.Rel10

thomasl's avatar
thomasl committed
166
test_compile \
guptar's avatar
guptar committed
167
    010106 oaisim \
navid's avatar
navid committed
168
    oaisim  $tdir/bin/oaisim.r8.itti Rel8.itti
thomasl's avatar
thomasl committed
169 170

test_compile \
guptar's avatar
guptar committed
171
    010107 oaisim_nos1 \
navid's avatar
navid committed
172
    oaisim_nos1  $tdir/bin/oaisim.r10 Rel10.nos1
thomasl's avatar
thomasl committed
173 174

test_compile \
guptar's avatar
guptar committed
175
    010108 oaisim \
176
    oaisim  $tdir/bin/oaisim.r10.itti rel10.itti
thomasl's avatar
thomasl committed
177

178 179 180
#test_compile \  LG: RAL REMOVED
#    test.0114 oaisim \
#    oaisim  $tdir/bin/oaisim.r8.itti.ral rel8.itti.ral
thomasl's avatar
thomasl committed
181

182 183 184
#test_compile \  LG: RAL REMOVED
#    test.0115 oaisim \
#    oaisim  $tdir/bin/oaisim.r10.itti.ral rel10.itti.ral 
thomasl's avatar
thomasl committed
185 186

test_compile \
guptar's avatar
guptar committed
187
    010120 nasmesh \
188
    CMakeFiles/nasmesh/nasmesh.ko $tdir/bin/nasmesh.ko 
189

190
test_compile \
guptar's avatar
guptar committed
191
    010130 rrh_gw \
192 193
    rrh_gw $tdir/bin/rrh_gw

194
# write the test results into a file
guptar's avatar
guptar committed
195 196 197
xUnit_write "$results_file"

echo "Test Results are written to $results_file"