summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorviettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-03-31 16:22:47 +0000
committerviettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-03-31 16:22:47 +0000
commit3b9dd37d7cd9a05ab94a05d6758730779c76aad8 (patch)
tree3060152c560cdbf6d8496668d8db22cd772ef21d
parente0a3b0455b2fa3f9ba4ff128088906772c092588 (diff)
downloadchromium_src-3b9dd37d7cd9a05ab94a05d6758730779c76aad8.zip
chromium_src-3b9dd37d7cd9a05ab94a05d6758730779c76aad8.tar.gz
chromium_src-3b9dd37d7cd9a05ab94a05d6758730779c76aad8.tar.bz2
Mojo: Move public/tests/test_{support,utils}.* to public/{c,cpp}/test_support.
R=darin@chromium.org Review URL: https://codereview.chromium.org/218833003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@260553 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--mojo/common/handle_watcher_unittest.cc2
-rw-r--r--mojo/mojo_public.gypi10
-rw-r--r--mojo/public/bindings/tests/handle_passing_unittest.cc2
-rw-r--r--mojo/public/bindings/tests/request_response_unittest.cc2
-rw-r--r--mojo/public/c/DEPS10
-rw-r--r--mojo/public/c/system/tests/DEPS7
-rw-r--r--mojo/public/c/system/tests/core_perftest.cc4
-rw-r--r--mojo/public/c/test_support/test_support.h25
-rw-r--r--mojo/public/c/test_support/test_support_export.h (renamed from mojo/public/tests/test_support_export.h)6
-rw-r--r--mojo/public/cpp/DEPS8
-rw-r--r--mojo/public/cpp/environment/tests/DEPS6
-rw-r--r--mojo/public/cpp/environment/tests/async_waiter_unittest.cc2
-rw-r--r--mojo/public/cpp/system/tests/DEPS3
-rw-r--r--mojo/public/cpp/test_support/DEPS3
-rw-r--r--mojo/public/cpp/test_support/lib/test_utils.cc (renamed from mojo/public/tests/test_utils.cc)4
-rw-r--r--mojo/public/cpp/test_support/test_support.h22
-rw-r--r--mojo/public/cpp/test_support/test_utils.h (renamed from mojo/public/tests/test_utils.h)6
-rw-r--r--mojo/public/cpp/utility/tests/DEPS5
-rw-r--r--mojo/public/cpp/utility/tests/run_loop_unittest.cc2
-rw-r--r--mojo/public/tests/test_support.h39
-rw-r--r--mojo/public/tests/test_support_private.h2
21 files changed, 88 insertions, 82 deletions
diff --git a/mojo/common/handle_watcher_unittest.cc b/mojo/common/handle_watcher_unittest.cc
index 3eace0c..729ffe1 100644
--- a/mojo/common/handle_watcher_unittest.cc
+++ b/mojo/common/handle_watcher_unittest.cc
@@ -12,7 +12,7 @@
#include "base/test/simple_test_tick_clock.h"
#include "mojo/common/time_helper.h"
#include "mojo/public/cpp/system/core.h"
-#include "mojo/public/tests/test_utils.h"
+#include "mojo/public/cpp/test_support/test_utils.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace mojo {
diff --git a/mojo/mojo_public.gypi b/mojo/mojo_public.gypi
index 073d5e4..47968e4 100644
--- a/mojo/mojo_public.gypi
+++ b/mojo/mojo_public.gypi
@@ -19,8 +19,6 @@
'public/c/system/core.h',
'public/c/system/macros.h',
'public/c/system/system_export.h',
- 'public/cpp/system/core.h',
- 'public/cpp/system/macros.h',
'public/system/core_private.cc',
'public/system/core_private.h',
],
@@ -96,10 +94,10 @@
],
},
'sources': [
- 'public/tests/test_support.h',
+ 'public/c/test_support/test_support.h',
+ 'public/c/test_support/test_support_export.h',
'public/tests/test_support_private.cc',
'public/tests/test_support_private.h',
- 'public/tests/test_support_export.h',
],
'conditions': [
['OS=="mac"', {
@@ -126,8 +124,8 @@
'mojo_test_support',
],
'sources': [
- 'public/tests/test_utils.cc',
- 'public/tests/test_utils.h',
+ 'public/cpp/test_support/lib/test_utils.cc',
+ 'public/cpp/test_support/test_utils.h',
],
},
# TODO(vtl): Reorganize the mojo_public_*_unittests.
diff --git a/mojo/public/bindings/tests/handle_passing_unittest.cc b/mojo/public/bindings/tests/handle_passing_unittest.cc
index 5467996..92aacb4 100644
--- a/mojo/public/bindings/tests/handle_passing_unittest.cc
+++ b/mojo/public/bindings/tests/handle_passing_unittest.cc
@@ -6,8 +6,8 @@
#include "mojo/public/bindings/remote_ptr.h"
#include "mojo/public/bindings/tests/sample_factory.mojom.h"
#include "mojo/public/cpp/environment/environment.h"
+#include "mojo/public/cpp/test_support/test_utils.h"
#include "mojo/public/cpp/utility/run_loop.h"
-#include "mojo/public/tests/test_utils.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace mojo {
diff --git a/mojo/public/bindings/tests/request_response_unittest.cc b/mojo/public/bindings/tests/request_response_unittest.cc
index f7d2346..b1b9b1d 100644
--- a/mojo/public/bindings/tests/request_response_unittest.cc
+++ b/mojo/public/bindings/tests/request_response_unittest.cc
@@ -7,8 +7,8 @@
#include "mojo/public/bindings/tests/sample_import.mojom.h"
#include "mojo/public/bindings/tests/sample_interfaces.mojom.h"
#include "mojo/public/cpp/environment/environment.h"
+#include "mojo/public/cpp/test_support/test_utils.h"
#include "mojo/public/cpp/utility/run_loop.h"
-#include "mojo/public/tests/test_utils.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace mojo {
diff --git a/mojo/public/c/DEPS b/mojo/public/c/DEPS
index b7a363c..5272770 100644
--- a/mojo/public/c/DEPS
+++ b/mojo/public/c/DEPS
@@ -4,3 +4,13 @@ include_rules = [
# But everyone can depend on the C system headers.
"+mojo/public/c/system",
]
+
+specific_include_rules = {
+ r".*_(unit|perf)test\.cc": [
+ "+testing",
+ # Our test harness is C++, so allow the use of C++:
+ "+mojo/public/cpp/system",
+ "+mojo/public/cpp/test_support",
+ "+mojo/public/cpp/utility",
+ ],
+}
diff --git a/mojo/public/c/system/tests/DEPS b/mojo/public/c/system/tests/DEPS
deleted file mode 100644
index d7c012c..0000000
--- a/mojo/public/c/system/tests/DEPS
+++ /dev/null
@@ -1,7 +0,0 @@
-include_rules = [
- "+testing",
- # Our test harness is C++, so allow the use of C++:
- "+mojo/public/cpp",
- # TODO(vtl): Temporary until these are moved to mojo/public/cpp:
- "+mojo/public/tests",
-]
diff --git a/mojo/public/c/system/tests/core_perftest.cc b/mojo/public/c/system/tests/core_perftest.cc
index eee782d..a133d7b 100644
--- a/mojo/public/c/system/tests/core_perftest.cc
+++ b/mojo/public/c/system/tests/core_perftest.cc
@@ -12,8 +12,8 @@
#include <stdio.h>
#include "mojo/public/cpp/system/macros.h"
-#include "mojo/public/tests/test_support.h"
-#include "mojo/public/tests/test_utils.h"
+#include "mojo/public/cpp/test_support/test_support.h"
+#include "mojo/public/cpp/test_support/test_utils.h"
#include "testing/gtest/include/gtest/gtest.h"
// TODO(vtl): (here and below) crbug.com/342893
diff --git a/mojo/public/c/test_support/test_support.h b/mojo/public/c/test_support/test_support.h
new file mode 100644
index 0000000..f854647
--- /dev/null
+++ b/mojo/public/c/test_support/test_support.h
@@ -0,0 +1,25 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef MOJO_PUBLIC_C_TEST_SUPPORT_TEST_SUPPORT_H_
+#define MOJO_PUBLIC_C_TEST_SUPPORT_TEST_SUPPORT_H_
+
+// Note: This header should be compilable as C.
+
+#include "mojo/public/c/test_support/test_support_export.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+MOJO_TEST_SUPPORT_EXPORT void MojoTestSupportLogPerfResult(
+ const char* test_name,
+ double value,
+ const char* units);
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // MOJO_PUBLIC_C_TEST_SUPPORT_TEST_SUPPORT_H_
diff --git a/mojo/public/tests/test_support_export.h b/mojo/public/c/test_support/test_support_export.h
index 962e096..e22a9e3 100644
--- a/mojo/public/tests/test_support_export.h
+++ b/mojo/public/c/test_support/test_support_export.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef MOJO_PUBLIC_TESTS_TEST_SUPPORT_EXPORT_H_
-#define MOJO_PUBLIC_TESTS_TEST_SUPPORT_EXPORT_H_
+#ifndef MOJO_PUBLIC_C_TEST_SUPPORT_TEST_SUPPORT_EXPORT_H_
+#define MOJO_PUBLIC_C_TEST_SUPPORT_TEST_SUPPORT_EXPORT_H_
#if defined(WIN32)
@@ -23,4 +23,4 @@
#endif // defined(WIN32)
-#endif // MOJO_PUBLIC_TESTS_TEST_SUPPORT_EXPORT_H_
+#endif // MOJO_PUBLIC_C_TEST_SUPPORT_TEST_SUPPORT_EXPORT_H_
diff --git a/mojo/public/cpp/DEPS b/mojo/public/cpp/DEPS
index c5aa397..166a30e 100644
--- a/mojo/public/cpp/DEPS
+++ b/mojo/public/cpp/DEPS
@@ -5,3 +5,11 @@ include_rules = [
"+mojo/public/c/system",
"+mojo/public/cpp/system",
]
+
+specific_include_rules = {
+ r".*_(unit|perf)test\.cc": [
+ "+testing",
+ "+mojo/public/cpp/test_support",
+ "+mojo/public/cpp/utility",
+ ],
+}
diff --git a/mojo/public/cpp/environment/tests/DEPS b/mojo/public/cpp/environment/tests/DEPS
deleted file mode 100644
index 9266146..0000000
--- a/mojo/public/cpp/environment/tests/DEPS
+++ /dev/null
@@ -1,6 +0,0 @@
-include_rules = [
- "+testing",
- "+mojo/public/cpp/utility",
- # TODO(vtl): Temporary until these are moved to mojo/public/cpp:
- "+mojo/public/tests",
-]
diff --git a/mojo/public/cpp/environment/tests/async_waiter_unittest.cc b/mojo/public/cpp/environment/tests/async_waiter_unittest.cc
index 444fdef..75cefb2 100644
--- a/mojo/public/cpp/environment/tests/async_waiter_unittest.cc
+++ b/mojo/public/cpp/environment/tests/async_waiter_unittest.cc
@@ -8,8 +8,8 @@
#include "mojo/public/cpp/environment/environment.h"
#include "mojo/public/cpp/system/core.h"
#include "mojo/public/cpp/system/macros.h"
+#include "mojo/public/cpp/test_support/test_utils.h"
#include "mojo/public/cpp/utility/run_loop.h"
-#include "mojo/public/tests/test_utils.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace mojo {
diff --git a/mojo/public/cpp/system/tests/DEPS b/mojo/public/cpp/system/tests/DEPS
deleted file mode 100644
index 6c53bc2..0000000
--- a/mojo/public/cpp/system/tests/DEPS
+++ /dev/null
@@ -1,3 +0,0 @@
-include_rules = [
- "+testing",
-]
diff --git a/mojo/public/cpp/test_support/DEPS b/mojo/public/cpp/test_support/DEPS
new file mode 100644
index 0000000..6dc5394
--- /dev/null
+++ b/mojo/public/cpp/test_support/DEPS
@@ -0,0 +1,3 @@
+include_rules = [
+ "+mojo/public/c/test_support",
+]
diff --git a/mojo/public/tests/test_utils.cc b/mojo/public/cpp/test_support/lib/test_utils.cc
index 2e9bc38..576c70a 100644
--- a/mojo/public/tests/test_utils.cc
+++ b/mojo/public/cpp/test_support/lib/test_utils.cc
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "mojo/public/tests/test_utils.h"
+#include "mojo/public/cpp/test_support/test_utils.h"
#include "mojo/public/cpp/system/core.h"
-#include "mojo/public/tests/test_support.h"
+#include "mojo/public/cpp/test_support/test_support.h"
namespace mojo {
namespace test {
diff --git a/mojo/public/cpp/test_support/test_support.h b/mojo/public/cpp/test_support/test_support.h
new file mode 100644
index 0000000..d0a8eb8
--- /dev/null
+++ b/mojo/public/cpp/test_support/test_support.h
@@ -0,0 +1,22 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef MOJO_PUBLIC_CPP_TEST_SUPPORT_TEST_SUPPORT_H_
+#define MOJO_PUBLIC_CPP_TEST_SUPPORT_TEST_SUPPORT_H_
+
+#include "mojo/public/c/test_support/test_support.h"
+
+namespace mojo {
+namespace test {
+
+inline void LogPerfResult(const char* test_name,
+ double value,
+ const char* units) {
+ MojoTestSupportLogPerfResult(test_name, value, units);
+}
+
+} // namespace test
+} // namespace mojo
+
+#endif // MOJO_PUBLIC_CPP_TEST_SUPPORT_TEST_SUPPORT_H_
diff --git a/mojo/public/tests/test_utils.h b/mojo/public/cpp/test_support/test_utils.h
index 300c1b7..43a3ea9 100644
--- a/mojo/public/tests/test_utils.h
+++ b/mojo/public/cpp/test_support/test_utils.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef MOJO_PUBLIC_TESTS_TEST_UTILS_H_
-#define MOJO_PUBLIC_TESTS_TEST_UTILS_H_
+#ifndef MOJO_PUBLIC_CPP_TEST_SUPPORT_TEST_UTILS_H_
+#define MOJO_PUBLIC_CPP_TEST_SUPPORT_TEST_UTILS_H_
#include <string>
@@ -36,4 +36,4 @@ void IterateAndReportPerf(const char* test_name,
} // namespace test
} // namespace mojo
-#endif // MOJO_PUBLIC_TESTS_TEST_UTILS_H_
+#endif // MOJO_PUBLIC_CPP_TEST_SUPPORT_TEST_UTILS_H_
diff --git a/mojo/public/cpp/utility/tests/DEPS b/mojo/public/cpp/utility/tests/DEPS
deleted file mode 100644
index 82f38c5..0000000
--- a/mojo/public/cpp/utility/tests/DEPS
+++ /dev/null
@@ -1,5 +0,0 @@
-include_rules = [
- "+testing",
- # TODO(vtl): Temporary until these are moved to mojo/public/cpp:
- "+mojo/public/tests",
-]
diff --git a/mojo/public/cpp/utility/tests/run_loop_unittest.cc b/mojo/public/cpp/utility/tests/run_loop_unittest.cc
index 5ba59da..b594e6c 100644
--- a/mojo/public/cpp/utility/tests/run_loop_unittest.cc
+++ b/mojo/public/cpp/utility/tests/run_loop_unittest.cc
@@ -7,8 +7,8 @@
#include <string>
#include "mojo/public/cpp/system/core.h"
+#include "mojo/public/cpp/test_support/test_utils.h"
#include "mojo/public/cpp/utility/run_loop_handler.h"
-#include "mojo/public/tests/test_utils.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace mojo {
diff --git a/mojo/public/tests/test_support.h b/mojo/public/tests/test_support.h
deleted file mode 100644
index e259456..0000000
--- a/mojo/public/tests/test_support.h
+++ /dev/null
@@ -1,39 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef MOJO_PUBLIC_TESTS_TEST_SUPPORT_H_
-#define MOJO_PUBLIC_TESTS_TEST_SUPPORT_H_
-
-// Note: This header should be compilable as C.
-
-#include "mojo/public/tests/test_support_export.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-MOJO_TEST_SUPPORT_EXPORT void MojoTestSupportLogPerfResult(
- const char* test_name,
- double value,
- const char* units);
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
-
-#ifdef __cplusplus
-namespace mojo {
-namespace test {
-
-inline void LogPerfResult(const char* test_name,
- double value,
- const char* units) {
- MojoTestSupportLogPerfResult(test_name, value, units);
-}
-
-} // namespace test
-} // namespace mojo
-#endif // __cplusplus
-
-#endif // MOJO_PUBLIC_TESTS_TEST_SUPPORT_H_
diff --git a/mojo/public/tests/test_support_private.h b/mojo/public/tests/test_support_private.h
index 88e65e1..3674fec 100644
--- a/mojo/public/tests/test_support_private.h
+++ b/mojo/public/tests/test_support_private.h
@@ -5,7 +5,7 @@
#ifndef MOJO_PUBLIC_TESTS_TEST_SUPPORT_PRIVATE_H_
#define MOJO_PUBLIC_TESTS_TEST_SUPPORT_PRIVATE_H_
-#include "mojo/public/tests/test_support.h"
+#include "mojo/public/c/test_support/test_support.h"
namespace mojo {
namespace test {