diff --git a/tests/.gitignore b/tests/.gitignore index 460b76c56..0710c37f4 100644 --- a/tests/.gitignore +++ b/tests/.gitignore @@ -1,3 +1,8 @@ +test-aes test-base64 test-md4 +test-md5 test-milenage +test-ms_funcs +test-sha1 +test-sha256 diff --git a/tests/Makefile b/tests/Makefile index 1665a565e..7c0a6ffc2 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -1,4 +1,5 @@ -TESTS=test-base64 test-md4 test-milenage +TESTS=test-base64 test-md4 test-md5 test-milenage test-ms_funcs test-sha1 \ + test-sha256 test-aes all: $(TESTS) @@ -27,19 +28,40 @@ LIBS = ../src/utils/libutils.a \ $(MAKE) -C ../src/crypto +test-aes: test-aes.o $(LIBS) + $(LDO) $(LDFLAGS) -o $@ $^ + test-base64: test-base64.o $(LIBS) $(LDO) $(LDFLAGS) -o $@ $^ test-md4: test-md4.o $(LIBS) $(LDO) $(LDFLAGS) -o $@ $^ +test-md5: test-md5.o $(LIBS) + $(LDO) $(LDFLAGS) -o $@ $^ + test-milenage: test-milenage.o $(LIBS) $(LDO) $(LDFLAGS) -o $@ $^ +test-ms_funcs: test-ms_funcs.o $(LIBS) + $(LDO) $(LDFLAGS) -o $@ $^ + +test-sha1: test-sha1.o $(LIBS) + $(LDO) $(LDFLAGS) -o $@ $^ + +test-sha256: test-sha256.o $(LIBS) + $(LDO) $(LDFLAGS) -o $@ $^ + run-tests: $(TESTS) + ./test-aes ./test-md4 + ./test-md5 ./test-milenage + ./test-sha1 + ./test-sha256 + @echo + @echo All tests completed successfully. clean: $(MAKE) -C ../src clean diff --git a/wpa_supplicant/tests/test_aes.c b/tests/test-aes.c similarity index 100% rename from wpa_supplicant/tests/test_aes.c rename to tests/test-aes.c diff --git a/wpa_supplicant/tests/test_md5.c b/tests/test-md5.c similarity index 100% rename from wpa_supplicant/tests/test_md5.c rename to tests/test-md5.c diff --git a/wpa_supplicant/tests/test_ms_funcs.c b/tests/test-ms_funcs.c similarity index 100% rename from wpa_supplicant/tests/test_ms_funcs.c rename to tests/test-ms_funcs.c diff --git a/wpa_supplicant/tests/test_sha1.c b/tests/test-sha1.c similarity index 100% rename from wpa_supplicant/tests/test_sha1.c rename to tests/test-sha1.c diff --git a/wpa_supplicant/tests/test_sha256.c b/tests/test-sha256.c similarity index 100% rename from wpa_supplicant/tests/test_sha256.c rename to tests/test-sha256.c diff --git a/wpa_supplicant/Makefile b/wpa_supplicant/Makefile index 79da19ccd..428f01033 100644 --- a/wpa_supplicant/Makefile +++ b/wpa_supplicant/Makefile @@ -1329,31 +1329,6 @@ wpa_gui-qt4/Makefile: wpa_gui-qt4: wpa_gui-qt4/Makefile $(MAKE) -C wpa_gui-qt4 -TEST_MS_FUNCS_OBJS = ../src/crypto/crypto_openssl.o $(SHA1OBJS) $(MD5OBJS) \ - ../src/utils/os_unix.o ../src/crypto/rc4.o tests/test_ms_funcs.o -test-ms_funcs: $(TEST_MS_FUNCS_OBJS) - $(LDO) $(LDFLAGS) -o $@ $(TEST_MS_FUNCS_OBJS) $(LIBS) -lcrypto - ./test-ms_funcs - rm test-ms_funcs - -TEST_SHA1_OBJS = $(SHA1OBJS) $(MD5OBJS) tests/test_sha1.o #../src/crypto/crypto_openssl.o -test-sha1: $(TEST_SHA1_OBJS) - $(LDO) $(LDFLAGS) -o $@ $(TEST_SHA1_OBJS) $(LIBS) - ./test-sha1 - rm test-sha1 - -TEST_SHA256_OBJS = $(SHA256OBJS) $(MD5OBJS) tests/test_sha256.o ../src/utils/os_unix.o ../src/crypto/crypto_openssl.o -test-sha256: $(TEST_SHA256_OBJS) - $(LDO) $(LDFLAGS) -o $@ $(TEST_SHA256_OBJS) $(LIBS) - ./test-sha256 - rm test-sha256 - -TEST_AES_OBJS = tests/test_aes.o $(AESOBJS) -test-aes: $(TEST_AES_OBJS) - $(LDO) $(LDFLAGS) -o $@ $(TEST_AES_OBJS) $(LIBS) - ./test-aes - rm test-aes - TEST_EAP_SIM_COMMON_OBJS = $(SHA1OBJS) $(MD5OBJS) \ ../src/utils/common.o ../src/utils/os_unix.o \ ../src/utils/wpa_debug.o $(AESOBJS) \ @@ -1363,13 +1338,7 @@ test-eap_sim_common: $(TEST_EAP_SIM_COMMON_OBJS) ./test-eap_sim_common rm test-eap_sim_common -TEST_MD5_OBJS = $(MD5OBJS) tests/test_md5.o #../src/crypto/crypto_openssl.o -test-md5: $(TEST_MD5_OBJS) - $(LDO) $(LDFLAGS) -o $@ $(TEST_MD5_OBJS) $(LIBS) - ./test-md5 - rm test-md5 - -tests: test-ms_funcs test-sha1 test-aes test-eap_sim_common test-md5 +tests: test-eap_sim_common clean: $(MAKE) -C ../src clean