Move more tests from wpa_supplicant/tests into tests
authorJouni Malinen <j@w1.fi>
Sat, 5 Dec 2009 20:25:32 +0000 (22:25 +0200)
committerJouni Malinen <j@w1.fi>
Sat, 5 Dec 2009 20:25:32 +0000 (22:25 +0200)
tests/.gitignore
tests/Makefile
tests/test-aes.c [moved from wpa_supplicant/tests/test_aes.c with 100% similarity]
tests/test-md5.c [moved from wpa_supplicant/tests/test_md5.c with 100% similarity]
tests/test-ms_funcs.c [moved from wpa_supplicant/tests/test_ms_funcs.c with 100% similarity]
tests/test-sha1.c [moved from wpa_supplicant/tests/test_sha1.c with 100% similarity]
tests/test-sha256.c [moved from wpa_supplicant/tests/test_sha256.c with 100% similarity]
wpa_supplicant/Makefile

index 460b76c..0710c37 100644 (file)
@@ -1,3 +1,8 @@
+test-aes
 test-base64
 test-md4
+test-md5
 test-milenage
+test-ms_funcs
+test-sha1
+test-sha256
index 1665a56..7c0a6ff 100644 (file)
@@ -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
index 79da19c..428f010 100644 (file)
@@ -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