tests: Verify that hostapd-as-RADIUS-server started
[mech_eap.git] / tests / hwsim / build.sh
1 #!/bin/sh
2
3 set -e
4
5 cd $(dirname $0)
6
7 usage()
8 {
9         echo "$0 [-c | --codecov] [-f | --force-config]"
10         exit 1
11 }
12
13 use_lcov=0
14 force_config=0
15 while [ "$1" != "" ]; do
16         case $1 in
17                 -c | --codecov ) shift
18                         echo "$0: use code coverage specified"
19                         use_lcov=1
20                         ;;
21                 -f | --force-config ) shift
22                         force_config=1
23                         echo "$0: force copy config specified"
24                         ;;
25                 * ) usage
26         esac
27 done
28
29 cd ../../wpa_supplicant
30 if [ ! -e .config -o $force_config -eq 1 ]; then
31     cp ../tests/hwsim/example-wpa_supplicant.config .config
32 else
33     echo "wpa_supplicant config file exists"
34 fi
35
36 if [ $use_lcov -eq 1 ]; then
37     if ! grep -q CONFIG_CODE_COVERAGE .config; then
38             echo CONFIG_CODE_COVERAGE=y >> .config
39     else
40             echo "CONFIG_CODE_COVERAGE already exists in wpa_supplicant/.config. Ignore"
41     fi
42 fi
43
44 make clean
45 make -j8
46
47 cd ../hostapd
48 if [ ! -e .config -o $force_config -eq 1 ]; then
49     cp ../tests/hwsim/example-hostapd.config .config
50 else
51     echo "hostapd config file exists"
52 fi
53
54 if [ $use_lcov -eq 1 ]; then
55     if ! grep -q CONFIG_CODE_COVERAGE .config; then
56             echo CONFIG_CODE_COVERAGE=y >> .config
57     else
58             echo "CONFIG_CODE_COVERAGE already exists in hostapd/.config. Ignore"
59     fi
60 fi
61
62 make clean
63 make -j8 hostapd hostapd_cli hlr_auc_gw
64 cd ../wlantest
65 make clean
66 make -j8
67 cd ../tests/hwsim/tnc
68 make clean
69 make -j8
70 cd ..