summary refs log tree commit diff
path: root/pkgs/os-specific/linux/bpftrace/disable-gtests.patch
blob: 941d85a411265972c26c53ec5f43e50200309010 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
From 221eea24674fffb3b657b2bd0c923071b69d48a7 Mon Sep 17 00:00:00 2001
From: Rodney Lorrimar <dev@rodney.id.au>
Date: Tue, 16 Oct 2018 09:56:47 +1000
Subject: [PATCH 2/3] Disable tests

Would prefer to use gtest library in the normal way rather through
ExternalProject.
---
 CMakeLists.txt       |  4 ++--
 tests/CMakeLists.txt | 18 +++++++++++-------
 2 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index b20fb33..7025d17 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -20,7 +20,7 @@ add_compile_options("-Wno-format-security")
 #add_compile_options("-Wstrict-overflow=5")
 #add_compile_options("-Wdisabled-optimization")
 
-enable_testing()
+# enable_testing()
 
 if (OFFLINE_BUILDS)
   include(ExternalProject)
@@ -79,7 +79,7 @@ include_directories(${CLANG_INCLUDE_DIRS})
 add_subdirectory(src/arch)
 add_subdirectory(src/ast)
 add_subdirectory(src)
-add_subdirectory(tests)
+# add_subdirectory(tests)
 add_subdirectory(resources)
 add_subdirectory(tools)
 add_subdirectory(man)
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index c283efa..6b5bff0 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -45,6 +45,8 @@ if (OFFLINE_BUILDS)
     EXCLUDE_FROM_ALL 1
     UPDATE_DISCONNECTED 1
     )
+elseif (NIX_BUILDS)
+
 else()
   include(ExternalProject)
   ExternalProject_Add(gtest-git
@@ -54,13 +56,15 @@ else()
     EXCLUDE_FROM_ALL 1
     )
 endif()
-add_dependencies(bpftrace_test gtest-git-build)
-ExternalProject_Get_Property(gtest-git source_dir binary_dir)
-target_include_directories(bpftrace_test PUBLIC ${source_dir}/googletest/include)
-target_include_directories(bpftrace_test PUBLIC ${source_dir}/googlemock/include)
-target_link_libraries(bpftrace_test ${binary_dir}/googlemock/gtest/libgtest.a)
-target_link_libraries(bpftrace_test ${binary_dir}/googlemock/gtest/libgtest_main.a)
-target_link_libraries(bpftrace_test ${binary_dir}/googlemock/libgmock.a)
+
+find_library(LIBGTEST "gtest")
+if(LIBGTEST)
+    set(LIBRARY_DEPENDENCIES
+        ${LIBRARY_DEPENDENCIES}
+       ${LIBGTEST}
+    )
+endif()
+
 target_link_libraries(bpftrace_test ${CMAKE_THREAD_LIBS_INIT})
 
 add_test(NAME bpftrace_test COMMAND bpftrace_test)
-- 
2.17.1