/
0003-gtest-typed-test.h-disable-warning-unused-definition.patch
111 lines (90 loc) · 4.19 KB
/
0003-gtest-typed-test.h-disable-warning-unused-definition.patch
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
From 1dac3072a62d1bb40db8c2f63f2729e658307761 Mon Sep 17 00:00:00 2001
From: Max Krummenacher <max.oss.09@gmail.com>
Date: Sat, 7 Nov 2015 00:45:46 +0100
Subject: [PATCH] gtest-typed-test.h: disable warning unused definitions
In file included from ../../testing/gtest/include/gtest/gtest.h:66:0,
from ../../base/test/task_runner_test_template.h:62,
from ../../base/test/task_runner_test_template.cc:5:
../../testing/gtest/include/gtest/gtest-typed-test.h:214:3: error: 'base::gtest_registered_test_names_TaskRunnerTest_' defined but not used [-Werror=unused-variable]
gtest_registered_test_names_##TestCaseName##_
Signed-off-by: Max Krummenacher <max.oss.09@gmail.com>
Upstream-Status: Pending
Seems to be fixed in current chromium sources.
---
testing/gtest/include/gtest/gtest-typed-test.h | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/testing/gtest/include/gtest/gtest-typed-test.h b/testing/gtest/include/gtest/gtest-typed-test.h
index fe1e83b..5053bbe 100644
--- a/testing/gtest/include/gtest/gtest-typed-test.h
+++ b/testing/gtest/include/gtest/gtest-typed-test.h
@@ -32,6 +32,9 @@
#ifndef GTEST_INCLUDE_GTEST_GTEST_TYPED_TEST_H_
#define GTEST_INCLUDE_GTEST_GTEST_TYPED_TEST_H_
+#pragma GCC diagnostic push
+#pragma GCC diagnostic warning "-Wunused"
+
// This header implements typed tests and type-parameterized tests.
// Typed (aka type-driven) tests repeat the same test for types in a
@@ -256,4 +259,6 @@ INSTANTIATE_TYPED_TEST_CASE_P(My, FooTest, MyTypes);
#endif // GTEST_HAS_TYPED_TEST_P
+#pragma GCC diagnostic pop
+
#endif // GTEST_INCLUDE_GTEST_GTEST_TYPED_TEST_H_
diff -uNr a/base/test/sequenced_task_runner_test_template.h b/base/test/sequenced_task_runner_test_template.h
--- a/base/test/sequenced_task_runner_test_template.h 2014-10-28 02:07:09.000000000 -1000
+++ b/base/test/sequenced_task_runner_test_template.h 2016-03-10 09:38:16.987413000 -1000
@@ -23,6 +23,9 @@
#include "base/time/time.h"
#include "testing/gtest/include/gtest/gtest.h"
+#pragma GCC diagnostic push
+#pragma GCC diagnostic warning "-Wunused"
+
namespace base {
namespace internal {
@@ -326,6 +329,7 @@
// whether the implementation supports nested tasks.
//
+/*
REGISTER_TYPED_TEST_CASE_P(SequencedTaskRunnerTest,
SequentialNonNestable,
SequentialNestable,
@@ -335,6 +339,8 @@
DelayedTasksSameDelay,
DelayedTaskAfterLongTask,
DelayedTaskAfterManyLongTasks);
+*/
+#pragma GCC diagnostic pop
} // namespace base
diff -uNr a/base/test/task_runner_test_template.h b/base/test/task_runner_test_template.h
--- a/base/test/task_runner_test_template.h 2014-10-28 02:07:09.000000000 -1000
+++ b/base/test/task_runner_test_template.h 2016-03-10 09:39:02.051413000 -1000
@@ -207,8 +207,10 @@
this->task_tracker_->GetTaskRunCounts());
}
+/*
REGISTER_TYPED_TEST_CASE_P(
TaskRunnerTest, Basic, Delayed, RunsTasksOnCurrentThread);
+*/
} // namespace base
diff -uNr a/testing/gtest/include/gtest/gtest-typed-test.h b/testing/gtest/include/gtest/gtest-typed-test.h
--- a/testing/gtest/include/gtest/gtest-typed-test.h 2016-03-10 10:25:47.371413000 -1000
+++ b/testing/gtest/include/gtest/gtest-typed-test.h 2016-03-10 09:35:25.811413000 -1000
@@ -34,6 +34,7 @@
#pragma GCC diagnostic push
#pragma GCC diagnostic warning "-Wunused"
+#pragma GCC diagnostic warning "-Wunused-variable"
// This header implements typed tests and type-parameterized tests.
diff -uNr a/testing/gtest/include/gtest/gtest.h b/testing/gtest/include/gtest/gtest.h
--- a/testing/gtest/include/gtest/gtest.h 2014-10-27 23:19:20.000000000 -1000
+++ b/testing/gtest/include/gtest/gtest.h 2016-03-10 09:36:13.607413000 -1000
@@ -63,7 +63,11 @@
#include "gtest/gtest-printers.h"
#include "gtest/gtest_prod.h"
#include "gtest/gtest-test-part.h"
+#pragma GCC diagnostic push
+#pragma GCC diagnostic warning "-Wunused"
+#pragma GCC diagnostic warning "-Wunused-variable"
#include "gtest/gtest-typed-test.h"
+#pragma GCC diagnostic pop
// Depending on the platform, different string classes are available.
// On Linux, in addition to ::std::string, Google also makes use of