aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorIlan Peer <ilan.peer@intel.com>2014-10-26 07:06:28 (GMT)
committerJouni Malinen <j@w1.fi>2014-10-26 17:18:34 (GMT)
commit102c2bf46185d334a046682d30d40f783856ac3e (patch)
tree9e19853c3cdc94d0592ec45442c2643cf7cfe3e8 /tests
parent159a17916f68f62f4ff4570b7eee8eeeb109f05a (diff)
downloadhostap-102c2bf46185d334a046682d30d40f783856ac3e.zip
hostap-102c2bf46185d334a046682d30d40f783856ac3e.tar.gz
hostap-102c2bf46185d334a046682d30d40f783856ac3e.tar.bz2
tests: Add an option to build with code coverage
"./build.sh --codecov" can now be used to request CONFIG_CODE_COVERAGE=y to be added to hostapd and wpa_supplicant .config files. Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Diffstat (limited to 'tests')
-rwxr-xr-xtests/hwsim/build.sh34
1 files changed, 34 insertions, 0 deletions
diff --git a/tests/hwsim/build.sh b/tests/hwsim/build.sh
index 06ea424..4feea7a 100755
--- a/tests/hwsim/build.sh
+++ b/tests/hwsim/build.sh
@@ -4,16 +4,50 @@ set -e
cd $(dirname $0)
+use_lcov=0
+while [ "$1" != "" ]; do
+ case $1 in
+ -c | --codecov ) shift
+ echo "$0: use code coverage specified"
+ use_lcov=1
+ ;;
+ * ) exit 1
+ esac
+done
+
cd ../../wpa_supplicant
if [ ! -e .config ]; then
cp ../tests/hwsim/example-wpa_supplicant.config .config
+else
+ echo "wpa_supplicant config file exists"
+fi
+
+if [ $use_lcov -eq 1 ]; then
+ if ! grep -q CONFIG_CODE_COVERAGE .config; then
+ echo CONFIG_CODE_COVERAGE=y >> .config
+ else
+ echo "CONFIG_CODE_COVERAGE already exists in wpa_supplicant/.config. Ignore"
+ fi
fi
+
make clean
make -j8
+
cd ../hostapd
if [ ! -e .config ]; then
cp ../tests/hwsim/example-hostapd.config .config
+else
+ echo "hostapd config file exists"
+fi
+
+if [ $use_lcov -eq 1 ]; then
+ if ! grep -q CONFIG_CODE_COVERAGE .config; then
+ echo CONFIG_CODE_COVERAGE=y >> .config
+ else
+ echo "CONFIG_CODE_COVERAGE already exists in hostapd/.config. Ignore"
+ fi
fi
+
make clean
make -j8 hostapd hlr_auc_gw
cd ../wlantest