aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2013-11-24 17:16:12 (GMT)
committerJouni Malinen <j@w1.fi>2013-11-24 17:16:12 (GMT)
commit7feff0656751fb45cd4128d96a5d48d85b32cb4a (patch)
tree84bd514129de6be4b5a6a1a4aa90b6eeef874c4c
parentd9c753b4f5670ce8bcfca137c1c7b63a4cb1be46 (diff)
downloadhostap-7feff0656751fb45cd4128d96a5d48d85b32cb4a.zip
hostap-7feff0656751fb45cd4128d96a5d48d85b32cb4a.tar.gz
hostap-7feff0656751fb45cd4128d96a5d48d85b32cb4a.tar.bz2
Add CONFIG_CODE_COVERAGE=y option for gcov
This can be used to measure code coverage from test scripts. Signed-hostap: Jouni Malinen <j@w1.fi>
-rw-r--r--.gitignore3
-rw-r--r--hostapd/Makefile10
-rw-r--r--src/ap/Makefile2
-rw-r--r--src/common/Makefile2
-rw-r--r--src/crypto/Makefile2
-rw-r--r--src/drivers/Makefile2
-rw-r--r--src/eap_common/Makefile2
-rw-r--r--src/eap_peer/Makefile2
-rw-r--r--src/eap_server/Makefile2
-rw-r--r--src/eapol_auth/Makefile2
-rw-r--r--src/eapol_supp/Makefile2
-rw-r--r--src/l2_packet/Makefile2
-rw-r--r--src/p2p/Makefile3
-rw-r--r--src/radius/Makefile2
-rw-r--r--src/rsn_supp/Makefile2
-rw-r--r--src/utils/Makefile2
-rw-r--r--src/wps/Makefile2
-rw-r--r--wpa_supplicant/Makefile10
-rw-r--r--wpa_supplicant/dbus/Makefile2
19 files changed, 37 insertions, 19 deletions
diff --git a/.gitignore b/.gitignore
index 7420b72..ae624c9 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,8 @@
*.o
*.d
+*.gcno
+*.gcda
+*.gcov
*.pyc
*~
.config
diff --git a/hostapd/Makefile b/hostapd/Makefile
index b4704ba..ae96d35 100644
--- a/hostapd/Makefile
+++ b/hostapd/Makefile
@@ -105,6 +105,14 @@ OBJS += ../src/common/wpa_common.o
OBJS += ../src/eapol_auth/eapol_auth_sm.o
+ifdef CONFIG_CODE_COVERAGE
+CFLAGS += -O0 -fprofile-arcs -ftest-coverage
+LIBS += -lgcov
+LIBS_c += -lgcov
+LIBS_h += -lgcov
+LIBS_n += -lgcov
+endif
+
ifndef CONFIG_NO_DUMP_STATE
# define HOSTAPD_DUMP_STATE to include SIGUSR1 handler for dumping state to
# a file (undefine it, if you want to save in binary size)
@@ -939,6 +947,6 @@ hlr_auc_gw: $(HOBJS)
clean:
$(MAKE) -C ../src clean
rm -f core *~ *.o hostapd hostapd_cli nt_password_hash hlr_auc_gw
- rm -f *.d
+ rm -f *.d *.gcno *.gcda *.gcov
-include $(OBJS:%.o=%.d)
diff --git a/src/ap/Makefile b/src/ap/Makefile
index 9c41962..adfd3df 100644
--- a/src/ap/Makefile
+++ b/src/ap/Makefile
@@ -2,7 +2,7 @@ all:
@echo Nothing to be made.
clean:
- rm -f *~ *.o *.d
+ rm -f *~ *.o *.d *.gcno *.gcda *.gcov
install:
@echo Nothing to be made.
diff --git a/src/common/Makefile b/src/common/Makefile
index 9c41962..adfd3df 100644
--- a/src/common/Makefile
+++ b/src/common/Makefile
@@ -2,7 +2,7 @@ all:
@echo Nothing to be made.
clean:
- rm -f *~ *.o *.d
+ rm -f *~ *.o *.d *.gcno *.gcda *.gcov
install:
@echo Nothing to be made.
diff --git a/src/crypto/Makefile b/src/crypto/Makefile
index a605a65..fcf9586 100644
--- a/src/crypto/Makefile
+++ b/src/crypto/Makefile
@@ -1,7 +1,7 @@
all: libcrypto.a
clean:
- rm -f *~ *.o *.d libcrypto.a
+ rm -f *~ *.o *.d *.gcno *.gcda *.gcov libcrypto.a
install:
@echo Nothing to be made.
diff --git a/src/drivers/Makefile b/src/drivers/Makefile
index 07600e5..5721154 100644
--- a/src/drivers/Makefile
+++ b/src/drivers/Makefile
@@ -2,7 +2,7 @@ all:
@echo Nothing to be made.
clean:
- rm -f *~ *.o *.d
+ rm -f *~ *.o *.d *.gcno *.gcda *.gcov
rm -f build.wpa_supplicant build.hostapd
install:
diff --git a/src/eap_common/Makefile b/src/eap_common/Makefile
index 9c41962..adfd3df 100644
--- a/src/eap_common/Makefile
+++ b/src/eap_common/Makefile
@@ -2,7 +2,7 @@ all:
@echo Nothing to be made.
clean:
- rm -f *~ *.o *.d
+ rm -f *~ *.o *.d *.gcno *.gcda *.gcov
install:
@echo Nothing to be made.
diff --git a/src/eap_peer/Makefile b/src/eap_peer/Makefile
index 3651056..f79519b 100644
--- a/src/eap_peer/Makefile
+++ b/src/eap_peer/Makefile
@@ -2,7 +2,7 @@ all:
@echo Nothing to be made.
clean:
- rm -f *~ *.o *.so *.d
+ rm -f *~ *.o *.so *.d *.gcno *.gcda *.gcov
install:
if ls *.so >/dev/null 2>&1; then \
diff --git a/src/eap_server/Makefile b/src/eap_server/Makefile
index 9c41962..adfd3df 100644
--- a/src/eap_server/Makefile
+++ b/src/eap_server/Makefile
@@ -2,7 +2,7 @@ all:
@echo Nothing to be made.
clean:
- rm -f *~ *.o *.d
+ rm -f *~ *.o *.d *.gcno *.gcda *.gcov
install:
@echo Nothing to be made.
diff --git a/src/eapol_auth/Makefile b/src/eapol_auth/Makefile
index 9c41962..adfd3df 100644
--- a/src/eapol_auth/Makefile
+++ b/src/eapol_auth/Makefile
@@ -2,7 +2,7 @@ all:
@echo Nothing to be made.
clean:
- rm -f *~ *.o *.d
+ rm -f *~ *.o *.d *.gcno *.gcda *.gcov
install:
@echo Nothing to be made.
diff --git a/src/eapol_supp/Makefile b/src/eapol_supp/Makefile
index 9c41962..adfd3df 100644
--- a/src/eapol_supp/Makefile
+++ b/src/eapol_supp/Makefile
@@ -2,7 +2,7 @@ all:
@echo Nothing to be made.
clean:
- rm -f *~ *.o *.d
+ rm -f *~ *.o *.d *.gcno *.gcda *.gcov
install:
@echo Nothing to be made.
diff --git a/src/l2_packet/Makefile b/src/l2_packet/Makefile
index 9c41962..adfd3df 100644
--- a/src/l2_packet/Makefile
+++ b/src/l2_packet/Makefile
@@ -2,7 +2,7 @@ all:
@echo Nothing to be made.
clean:
- rm -f *~ *.o *.d
+ rm -f *~ *.o *.d *.gcno *.gcda *.gcov
install:
@echo Nothing to be made.
diff --git a/src/p2p/Makefile b/src/p2p/Makefile
index cffba62..adfd3df 100644
--- a/src/p2p/Makefile
+++ b/src/p2p/Makefile
@@ -2,8 +2,7 @@ all:
@echo Nothing to be made.
clean:
- for d in $(SUBDIRS); do make -C $$d clean; done
- rm -f *~ *.o *.d
+ rm -f *~ *.o *.d *.gcno *.gcda *.gcov
install:
@echo Nothing to be made.
diff --git a/src/radius/Makefile b/src/radius/Makefile
index b199be8..b5d063d 100644
--- a/src/radius/Makefile
+++ b/src/radius/Makefile
@@ -1,7 +1,7 @@
all: libradius.a
clean:
- rm -f *~ *.o *.d libradius.a
+ rm -f *~ *.o *.d *.gcno *.gcda *.gcov libradius.a
install:
@echo Nothing to be made.
diff --git a/src/rsn_supp/Makefile b/src/rsn_supp/Makefile
index 9c41962..adfd3df 100644
--- a/src/rsn_supp/Makefile
+++ b/src/rsn_supp/Makefile
@@ -2,7 +2,7 @@ all:
@echo Nothing to be made.
clean:
- rm -f *~ *.o *.d
+ rm -f *~ *.o *.d *.gcno *.gcda *.gcov
install:
@echo Nothing to be made.
diff --git a/src/utils/Makefile b/src/utils/Makefile
index b04a8a3..8aad813 100644
--- a/src/utils/Makefile
+++ b/src/utils/Makefile
@@ -1,7 +1,7 @@
all: libutils.a
clean:
- rm -f *~ *.o *.d libutils.a
+ rm -f *~ *.o *.d *.gcno *.gcda *.gcov libutils.a
install:
@echo Nothing to be made.
diff --git a/src/wps/Makefile b/src/wps/Makefile
index 9c41962..adfd3df 100644
--- a/src/wps/Makefile
+++ b/src/wps/Makefile
@@ -2,7 +2,7 @@ all:
@echo Nothing to be made.
clean:
- rm -f *~ *.o *.d
+ rm -f *~ *.o *.d *.gcno *.gcda *.gcov
install:
@echo Nothing to be made.
diff --git a/wpa_supplicant/Makefile b/wpa_supplicant/Makefile
index f6a46d2..260c0ae 100644
--- a/wpa_supplicant/Makefile
+++ b/wpa_supplicant/Makefile
@@ -129,6 +129,13 @@ ifdef CONFIG_EAPOL_TEST
CFLAGS += -Werror -DEAPOL_TEST
endif
+ifdef CONFIG_CODE_COVERAGE
+CFLAGS += -O0 -fprofile-arcs -ftest-coverage
+LIBS += -lgcov
+LIBS_c += -lgcov
+LIBS_p += -lgcov
+endif
+
ifdef CONFIG_HT_OVERRIDES
CFLAGS += -DCONFIG_HT_OVERRIDES
endif
@@ -1672,7 +1679,8 @@ fips:
clean:
$(MAKE) -C ../src clean
$(MAKE) -C dbus clean
- rm -f core *~ *.o *.d eap_*.so $(ALL) $(WINALL) eapol_test preauth_test
+ rm -f core *~ *.o *.d *.gcno *.gcda *.gcov
+ rm -f eap_*.so $(ALL) $(WINALL) eapol_test preauth_test
rm -f wpa_priv
rm -f nfc_pw_token
diff --git a/wpa_supplicant/dbus/Makefile b/wpa_supplicant/dbus/Makefile
index d64c65c..f355ebe 100644
--- a/wpa_supplicant/dbus/Makefile
+++ b/wpa_supplicant/dbus/Makefile
@@ -1,7 +1,7 @@
all: libwpadbus.a
clean:
- rm -f *~ *.o *.d
+ rm -f *~ *.o *.d *.gcno *.gcda *.gcov
rm -f libwpadbus.a
install: