summaryrefslogtreecommitdiff
path: root/auto_tests
diff options
context:
space:
mode:
Diffstat (limited to 'auto_tests')
-rw-r--r--auto_tests/CMakeLists.txt22
-rw-r--r--auto_tests/Makefile.inc34
-rw-r--r--auto_tests/cmake/crypto_test.cmake10
-rw-r--r--auto_tests/cmake/friends_test.cmake10
-rw-r--r--auto_tests/cmake/messenger_test.cmake10
-rw-r--r--auto_tests/crypto_test.c2
-rw-r--r--auto_tests/friends_test.c4
-rw-r--r--auto_tests/messenger_test.c3
8 files changed, 39 insertions, 56 deletions
diff --git a/auto_tests/CMakeLists.txt b/auto_tests/CMakeLists.txt
deleted file mode 100644
index c0b6aee4..00000000
--- a/auto_tests/CMakeLists.txt
+++ /dev/null
@@ -1,22 +0,0 @@
1cmake_minimum_required(VERSION 2.6.0)
2cmake_policy(SET CMP0011 NEW)
3
4include_directories(${CHECK_INCLUDE_DIRS})
5
6find_package(Check REQUIRED)
7include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/messenger_test.cmake)
8include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/crypto_test.cmake)
9include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/friends_test.cmake)
10
11include( CTest )
12enable_testing()
13
14add_test(messenger messenger_test)
15add_test(crypto crypto_test)
16# TODO enable once test is fixed
17#add_test(friends friends_test)
18
19add_custom_target(
20 test COMMAND ${CMAKE_CTEST_COMMAND} -V
21 DEPENDS messenger_test crypto_test
22)
diff --git a/auto_tests/Makefile.inc b/auto_tests/Makefile.inc
new file mode 100644
index 00000000..bd883a79
--- /dev/null
+++ b/auto_tests/Makefile.inc
@@ -0,0 +1,34 @@
1if BUILD_TESTS
2
3TESTS = messenger_autotest crypto_test
4
5check_PROGRAMS = messenger_autotest crypto_test
6
7messenger_autotest_SOURCES = \
8 $(top_srcdir)/auto_tests/messenger_test.c
9
10messenger_autotest_CFLAGS = \
11 $(LIBSODIUM_CFLAGS) \
12 $(CHECK_CFLAGS)
13
14messenger_autotest_LDADD = \
15 $(LIBSODIUM_LDFLAGS) \
16 libtoxcore.la \
17 $(LIBSODIUM_LIBS) \
18 $(CHECK_LIBS)
19
20
21crypto_test_SOURCES = $(top_srcdir)/auto_tests/crypto_test.c
22
23crypto_test_CFLAGS = $(LIBSODIUM_CFLAGS) \
24 $(CHECK_CFLAGS)
25
26crypto_test_LDADD = $(LIBSODIUM_LDFLAGS) \
27 libtoxcore.la \
28 $(LIBSODIUM_LIBS) \
29 $(CHECK_LIBS)
30
31endif
32
33EXTRA_DIST += $(top_srcdir)/auto_tests/friends_test.c
34
diff --git a/auto_tests/cmake/crypto_test.cmake b/auto_tests/cmake/crypto_test.cmake
deleted file mode 100644
index 9ca9a331..00000000
--- a/auto_tests/cmake/crypto_test.cmake
+++ /dev/null
@@ -1,10 +0,0 @@
1cmake_minimum_required(VERSION 2.6.0)
2project(crypto_test C)
3set(exe_name crypto_test)
4
5add_executable(${exe_name}
6 crypto_test.c)
7
8linkCoreLibraries(${exe_name})
9add_dependencies(${exe_name} Check)
10target_link_libraries(${exe_name} check)
diff --git a/auto_tests/cmake/friends_test.cmake b/auto_tests/cmake/friends_test.cmake
deleted file mode 100644
index 5c2d0fc6..00000000
--- a/auto_tests/cmake/friends_test.cmake
+++ /dev/null
@@ -1,10 +0,0 @@
1cmake_minimum_required(VERSION 2.6.0)
2project(friends_test C)
3set(exe_name friends_test)
4
5add_executable(${exe_name}
6 friends_test.c)
7
8linkCoreLibraries(${exe_name})
9add_dependencies(${exe_name} Check)
10target_link_libraries(${exe_name} check)
diff --git a/auto_tests/cmake/messenger_test.cmake b/auto_tests/cmake/messenger_test.cmake
deleted file mode 100644
index 084586bb..00000000
--- a/auto_tests/cmake/messenger_test.cmake
+++ /dev/null
@@ -1,10 +0,0 @@
1cmake_minimum_required(VERSION 2.6.0)
2project(messenger_test C)
3set(exe_name messenger_test)
4
5add_executable(${exe_name}
6 messenger_test.c)
7
8linkCoreLibraries(${exe_name})
9add_dependencies(${exe_name} Check)
10target_link_libraries(${exe_name} check)
diff --git a/auto_tests/crypto_test.c b/auto_tests/crypto_test.c
index 01c545c8..b3ce6259 100644
--- a/auto_tests/crypto_test.c
+++ b/auto_tests/crypto_test.c
@@ -1,4 +1,4 @@
1#include "../core/net_crypto.h" 1#include "../toxcore/net_crypto.h"
2#include <sys/types.h> 2#include <sys/types.h>
3#include <stdint.h> 3#include <stdint.h>
4#include <string.h> 4#include <string.h>
diff --git a/auto_tests/friends_test.c b/auto_tests/friends_test.c
index b6223489..0426c18d 100644
--- a/auto_tests/friends_test.c
+++ b/auto_tests/friends_test.c
@@ -18,8 +18,8 @@
18 * times. This is used both to ensure that we don't loop forever on a broken build, 18 * times. This is used both to ensure that we don't loop forever on a broken build,
19 * and that we don't get too slow with messaging. The current time is 15 seconds. */ 19 * and that we don't get too slow with messaging. The current time is 15 seconds. */
20 20
21#include "../core/friend_requests.h" 21#include "../toxcore/friend_requests.h"
22#include "../core/Messenger.h" 22#include "../toxcore/Messenger.h"
23#include <assert.h> 23#include <assert.h>
24#include <unistd.h> 24#include <unistd.h>
25#include <sys/mman.h> 25#include <sys/mman.h>
diff --git a/auto_tests/messenger_test.c b/auto_tests/messenger_test.c
index 9de69409..deac749b 100644
--- a/auto_tests/messenger_test.c
+++ b/auto_tests/messenger_test.c
@@ -10,7 +10,8 @@
10 * checking that status changes are received, messages can be sent, etc. 10 * checking that status changes are received, messages can be sent, etc.
11 * All of that is done in a separate test, with two local clients running. */ 11 * All of that is done in a separate test, with two local clients running. */
12 12
13#include "../core/Messenger.h" 13#include "../toxcore/Messenger.h"
14#include "../toxcore/Lossless_UDP.h"
14#include <sys/types.h> 15#include <sys/types.h>
15#include <stdint.h> 16#include <stdint.h>
16#include <string.h> 17#include <string.h>