Ver código fonte

moved tests on each module

develop
Robin Thoni 6 anos atrás
pai
commit
8ecfae3f07

+ 6
- 10
CMakeLists.txt Ver arquivo

@@ -2,19 +2,15 @@ cmake_minimum_required(VERSION 3.9)
2 2
 project(qdnsagg)
3 3
 
4 4
 set(CMAKE_INCLUDE_CURRENT_DIR ON)
5
-
6 5
 set(CMAKE_AUTOMOC ON)
7
-
8 6
 set(CMAKE_CXX_STANDARD 17)
9 7
 
10 8
 find_package(Qt5Core REQUIRED)
11
-find_package(Qt5Network REQUIRED)
12
-set(PROJECT_LIBS Qt5::Core Qt5::Network)
13 9
 
14
-add_subdirectory(src)
10
+add_executable(qdnsagg
11
+        src/main.cpp
12
+        )
13
+
14
+add_subdirectory(src/modules/dns-base)
15 15
 
16
-find_package(GTest)
17
-if (GTEST_FOUND)
18
-    enable_testing()
19
-    add_subdirectory(tests)
20
-endif (GTEST_FOUND)
16
+target_link_libraries(qdnsagg Qt5::Core qdnsagg-dns-base)

+ 0
- 10
src/CMakeLists.txt Ver arquivo

@@ -1,10 +0,0 @@
1
-cmake_minimum_required(VERSION 3.9)
2
-project(qdnsagg)
3
-
4
-add_executable(qdnsagg
5
-        main.cpp
6
-        )
7
-
8
-add_subdirectory(modules/dns-base)
9
-
10
-target_link_libraries(qdnsagg Qt5::Core qdnsagg-dns-base)

+ 14
- 1
src/modules/dns-base/CMakeLists.txt Ver arquivo

@@ -3,6 +3,12 @@ project(qdnsagg-dns-base)
3 3
 
4 4
 include_directories(includes)
5 5
 
6
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
7
+set(CMAKE_AUTOMOC ON)
8
+set(CMAKE_CXX_STANDARD 17)
9
+
10
+find_package(Qt5Core REQUIRED)
11
+
6 12
 add_library(qdnsagg-dns-base
7 13
         src/QDnsHeader.cpp
8 14
         includes/dns-base/QDnsHeader.h
@@ -16,4 +22,11 @@ add_library(qdnsagg-dns-base
16 22
         includes/dns-base/QDnsPacket.h
17 23
         )
18 24
 
19
-target_link_libraries(qdnsagg-dns-base Qt5::Core Qt5::Network)
25
+target_link_libraries(qdnsagg-dns-base Qt5::Core)
26
+
27
+find_package(GTest)
28
+if (GTEST_FOUND)
29
+    enable_testing()
30
+    add_subdirectory(tests)
31
+endif (GTEST_FOUND)
32
+

+ 17
- 0
src/modules/dns-base/tests/CMakeLists.txt Ver arquivo

@@ -0,0 +1,17 @@
1
+cmake_minimum_required(VERSION 3.9)
2
+project(qdnsagg-dns-base-tests)
3
+
4
+enable_testing()
5
+
6
+include_directories(../includes)
7
+
8
+add_executable(qdnsagg-dns-base-tests
9
+        main.cpp
10
+        DnsHeader.cpp
11
+        DnsLabel.cpp
12
+        DnsQuery.cpp
13
+        DnsResourceRecord.cpp
14
+        DnsPacket.cpp)
15
+
16
+target_link_libraries(qdnsagg-dns-base-tests gtest pthread qdnsagg-dns-base)
17
+add_test(qdnsagg-dns-base-tests ${CMAKE_CURRENT_BINARY_DIR}/qdnsagg-tests)

tests/dns-base/DnsHeader.cpp → src/modules/dns-base/tests/DnsHeader.cpp Ver arquivo


tests/dns-base/DnsLabel.cpp → src/modules/dns-base/tests/DnsLabel.cpp Ver arquivo


tests/dns-base/DnsPacket.cpp → src/modules/dns-base/tests/DnsPacket.cpp Ver arquivo


tests/dns-base/DnsQuery.cpp → src/modules/dns-base/tests/DnsQuery.cpp Ver arquivo


tests/dns-base/DnsResourceRecord.cpp → src/modules/dns-base/tests/DnsResourceRecord.cpp Ver arquivo


tests/main.cpp → src/modules/dns-base/tests/main.cpp Ver arquivo


+ 0
- 17
tests/CMakeLists.txt Ver arquivo

@@ -1,17 +0,0 @@
1
-cmake_minimum_required(VERSION 3.9)
2
-project(qdnsagg-tests)
3
-
4
-enable_testing()
5
-
6
-include_directories(../src/modules/dns-base/includes)
7
-
8
-add_executable(qdnsagg-tests
9
-        main.cpp
10
-        dns-base/DnsHeader.cpp
11
-        dns-base/DnsLabel.cpp
12
-        dns-base/DnsQuery.cpp
13
-        dns-base/DnsResourceRecord.cpp
14
-        dns-base/DnsPacket.cpp)
15
-
16
-target_link_libraries(qdnsagg-tests gtest pthread qdnsagg-dns-base)
17
-add_test(qdnsagg-tests ${CMAKE_CURRENT_BINARY_DIR}/qdnsagg-tests)

Carregando…
Cancelar
Salvar