test: Move util/test to its own top-level directory, test.

After 9e79ea1da7, it no longer makes sense for crashpad_util_test_lib
to “hide” in util/util_test.gyp. All of util/test is moved to its own
top-level directory, test, which all other test code is allowed to
depend on. test, too, is allowed to depend on all other non-test code.

In a future change, when crashpad_util_test_lib gains a dependency on
crashpad_client, it won’t look so weird for something in util (even
though it’s in util/test) to depend on something in client, because the
thing that needs to depend on client will live in test, not util.

BUG=crashpad:33
R=scottmg@chromium.org

Review URL: https://codereview.chromium.org/1051533002
This commit is contained in:
Mark Mentovai 2015-03-31 17:44:14 -04:00
Родитель 9e79ea1da7
Коммит 809ea8158d
76 изменённых файлов: 252 добавлений и 187 удалений

Просмотреть файл

@ -47,6 +47,7 @@ def main(args):
'crashpad_client_test',
'crashpad_minidump_test',
'crashpad_snapshot_test',
'crashpad_test_test',
'crashpad_util_test',
]
for test in tests:

Просмотреть файл

@ -23,11 +23,11 @@
'dependencies': [
'client.gyp:crashpad_client',
'../compat/compat.gyp:crashpad_compat',
'../test/test.gyp:crashpad_test',
'../third_party/gtest/gtest.gyp:gtest',
'../third_party/gtest/gtest.gyp:gtest_main',
'../third_party/mini_chromium/mini_chromium.gyp:base',
'../util/util.gyp:crashpad_util',
'../util/util_test.gyp:crashpad_util_test_lib',
],
'include_dirs': [
'..',

Просмотреть файл

@ -19,9 +19,9 @@
#include "build/build_config.h"
#include "client/settings.h"
#include "gtest/gtest.h"
#include "test/errors.h"
#include "test/scoped_temp_dir.h"
#include "util/file/file_io.h"
#include "util/test/errors.h"
#include "util/test/scoped_temp_dir.h"
namespace crashpad {
namespace test {

Просмотреть файл

@ -15,8 +15,8 @@
#include "client/settings.h"
#include "gtest/gtest.h"
#include "test/scoped_temp_dir.h"
#include "util/file/file_io.h"
#include "util/test/scoped_temp_dir.h"
namespace crashpad {
namespace test {

Просмотреть файл

@ -16,7 +16,7 @@
#include "base/logging.h"
#include "gtest/gtest.h"
#include "util/test/gtest_death_check.h"
#include "test/gtest_death_check.h"
namespace crashpad {
namespace test {

Просмотреть файл

@ -21,6 +21,8 @@
#include "base/strings/stringprintf.h"
#include "build/build_config.h"
#include "gtest/gtest.h"
#include "test/mac/mach_errors.h"
#include "test/mac/mach_multiprocess.h"
#include "util/mach/exc_server_variants.h"
#include "util/mach/exception_behaviors.h"
#include "util/mach/exception_ports.h"
@ -28,8 +30,6 @@
#include "util/mach/mach_message.h"
#include "util/mach/mach_message_server.h"
#include "util/mach/symbolic_constants_mach.h"
#include "util/test/mac/mach_errors.h"
#include "util/test/mac/mach_multiprocess.h"
namespace crashpad {
namespace test {

Просмотреть файл

@ -27,6 +27,8 @@
'minidump/minidump_test.gyp:*',
'snapshot/snapshot.gyp:*',
'snapshot/snapshot_test.gyp:*',
'test/test.gyp:*',
'test/test_test.gyp:*',
'tools/tools.gyp:*',
'util/util.gyp:*',
'util/util_test.gyp:*',

Просмотреть файл

@ -33,8 +33,8 @@
#include "minidump/test/minidump_writable_test_util.h"
#include "snapshot/test/test_cpu_context.h"
#include "snapshot/test/test_exception_snapshot.h"
#include "test/gtest_death_check.h"
#include "util/file/string_file.h"
#include "util/test/gtest_death_check.h"
namespace crashpad {
namespace test {

Просмотреть файл

@ -32,8 +32,8 @@
#include "snapshot/test/test_process_snapshot.h"
#include "snapshot/test/test_system_snapshot.h"
#include "snapshot/test/test_thread_snapshot.h"
#include "test/gtest_death_check.h"
#include "util/file/string_file.h"
#include "util/test/gtest_death_check.h"
namespace crashpad {
namespace test {

Просмотреть файл

@ -30,10 +30,10 @@
#include "minidump/test/minidump_string_writer_test_util.h"
#include "minidump/test/minidump_writable_test_util.h"
#include "snapshot/test/test_module_snapshot.h"
#include "test/gtest_death_check.h"
#include "util/file/string_file.h"
#include "util/misc/uuid.h"
#include "util/stdlib/pointer_container.h"
#include "util/test/gtest_death_check.h"
namespace crashpad {
namespace test {

Просмотреть файл

@ -29,8 +29,8 @@
#include "minidump/test/minidump_string_writer_test_util.h"
#include "minidump/test/minidump_writable_test_util.h"
#include "snapshot/test/test_system_snapshot.h"
#include "test/gtest_death_check.h"
#include "util/file/string_file.h"
#include "util/test/gtest_death_check.h"
namespace crashpad {
namespace test {

Просмотреть файл

@ -23,11 +23,11 @@
'dependencies': [
'minidump.gyp:crashpad_minidump',
'../snapshot/snapshot_test.gyp:crashpad_snapshot_test_lib',
'../test/test.gyp:crashpad_test',
'../third_party/gtest/gtest.gyp:gtest',
'../third_party/gtest/gtest.gyp:gtest_main',
'../third_party/mini_chromium/mini_chromium.gyp:base',
'../util/util.gyp:crashpad_util',
'../util/util_test.gyp:crashpad_util_test',
],
'include_dirs': [
'..',

Просмотреть файл

@ -33,8 +33,8 @@
#include "snapshot/test/test_cpu_context.h"
#include "snapshot/test/test_memory_snapshot.h"
#include "snapshot/test/test_thread_snapshot.h"
#include "test/gtest_death_check.h"
#include "util/file/string_file.h"
#include "util/test/gtest_death_check.h"
namespace crashpad {
namespace test {

Просмотреть файл

@ -20,7 +20,7 @@
#include "client/crashpad_info.h"
#include "gtest/gtest.h"
#include "snapshot/mac/process_snapshot_mac.h"
#include "util/test/paths.h"
#include "test/paths.h"
namespace crashpad {
namespace test {

Просмотреть файл

@ -30,15 +30,15 @@
#include "client/simple_string_dictionary.h"
#include "gtest/gtest.h"
#include "snapshot/mac/process_reader.h"
#include "test/errors.h"
#include "test/mac/mach_errors.h"
#include "test/mac/mach_multiprocess.h"
#include "util/file/file_io.h"
#include "util/mac/mac_util.h"
#include "util/mach/exc_server_variants.h"
#include "util/mach/exception_ports.h"
#include "util/mach/mach_message.h"
#include "util/mach/mach_message_server.h"
#include "util/test/errors.h"
#include "util/test/mac/mach_errors.h"
#include "util/test/mac/mach_multiprocess.h"
namespace crashpad {
namespace test {

Просмотреть файл

@ -31,8 +31,8 @@
#include "snapshot/mac/mach_o_image_segment_reader.h"
#include "snapshot/mac/process_reader.h"
#include "snapshot/mac/process_types.h"
#include "test/mac/dyld.h"
#include "util/misc/uuid.h"
#include "util/test/mac/dyld.h"
// This file is responsible for testing MachOImageReader,
// MachOImageSegmentReader, and MachOImageSymbolTableReader.

Просмотреть файл

@ -33,15 +33,15 @@
#include "build/build_config.h"
#include "gtest/gtest.h"
#include "snapshot/mac/mach_o_image_reader.h"
#include "test/errors.h"
#include "test/mac/dyld.h"
#include "test/mac/mach_errors.h"
#include "test/mac/mach_multiprocess.h"
#include "util/file/file_io.h"
#include "util/mac/mac_util.h"
#include "util/mach/mach_extensions.h"
#include "util/stdlib/pointer_container.h"
#include "util/synchronization/semaphore.h"
#include "util/test/errors.h"
#include "util/test/mac/dyld.h"
#include "util/test/mac/mach_errors.h"
#include "util/test/mac/mach_multiprocess.h"
namespace crashpad {
namespace test {

Просмотреть файл

@ -23,8 +23,8 @@
#include "base/basictypes.h"
#include "base/strings/stringprintf.h"
#include "gtest/gtest.h"
#include "test/mac/dyld.h"
#include "util/mac/mac_util.h"
#include "util/test/mac/dyld.h"
namespace crashpad {
namespace test {

Просмотреть файл

@ -22,8 +22,8 @@
#include "build/build_config.h"
#include "gtest/gtest.h"
#include "snapshot/mac/process_reader.h"
#include "test/errors.h"
#include "util/mac/mac_util.h"
#include "util/test/errors.h"
namespace crashpad {
namespace test {

Просмотреть файл

@ -53,11 +53,11 @@
'snapshot.gyp:crashpad_snapshot',
'../client/client.gyp:crashpad_client',
'../compat/compat.gyp:crashpad_compat',
'../test/test.gyp:crashpad_test',
'../third_party/gtest/gtest.gyp:gtest',
'../third_party/gtest/gtest.gyp:gtest_main',
'../third_party/mini_chromium/mini_chromium.gyp:base',
'../util/util.gyp:crashpad_util',
'../util/util_test.gyp:crashpad_util_test_lib',
],
'include_dirs': [
'..',

Просмотреть файл

@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#include "util/test/errors.h"
#include "test/errors.h"
#include <errno.h>

Просмотреть файл

@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef CRASHPAD_UTIL_TEST_ERRORS_H_
#define CRASHPAD_UTIL_TEST_ERRORS_H_
#ifndef CRASHPAD_TEST_ERRORS_H_
#define CRASHPAD_TEST_ERRORS_H_
#include <string>
@ -79,4 +79,4 @@ std::string ErrorMessage(const std::string& base = std::string());
} // namespace test
} // namespace crashpad
#endif // CRASHPAD_UTIL_TEST_ERRORS_H_
#endif // CRASHPAD_TEST_ERRORS_H_

Просмотреть файл

@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef CRASHPAD_UTIL_TEST_GTEST_DEATH_CHECK_H_
#define CRASHPAD_UTIL_TEST_GTEST_DEATH_CHECK_H_
#ifndef CRASHPAD_TEST_GTEST_DEATH_CHECK_H_
#define CRASHPAD_TEST_GTEST_DEATH_CHECK_H_
#include "base/logging.h"
#include "gtest/gtest.h"
@ -52,4 +52,4 @@
#endif
#endif // CRASHPAD_UTIL_TEST_GTEST_DEATH_CHECK_H_
#endif // CRASHPAD_TEST_GTEST_DEATH_CHECK_H_

Просмотреть файл

@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef CRASHPAD_UTIL_TEST_MAC_DYLD_H_
#define CRASHPAD_UTIL_TEST_MAC_DYLD_H_
#ifndef CRASHPAD_TEST_MAC_DYLD_H_
#define CRASHPAD_TEST_MAC_DYLD_H_
#include <mach-o/dyld_images.h>
@ -26,4 +26,4 @@ const struct dyld_all_image_infos* _dyld_get_all_image_infos();
} // extern "C"
#endif // CRASHPAD_UTIL_TEST_MAC_DYLD_H_
#endif // CRASHPAD_TEST_MAC_DYLD_H_

Просмотреть файл

@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#include "util/test/mac/mach_errors.h"
#include "test/mac/mach_errors.h"
#include <servers/bootstrap.h>

Просмотреть файл

@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef CRASHPAD_UTIL_TEST_MAC_MACH_ERRORS_H_
#define CRASHPAD_UTIL_TEST_MAC_MACH_ERRORS_H_
#ifndef CRASHPAD_TEST_MAC_MACH_ERRORS_H_
#define CRASHPAD_TEST_MAC_MACH_ERRORS_H_
#include <mach/mach.h>
@ -67,4 +67,4 @@ std::string BootstrapErrorMessage(kern_return_t bootstrap_err,
} // namespace test
} // namespace crashpad
#endif // CRASHPAD_UTIL_TEST_MAC_MACH_ERRORS_H_
#endif // CRASHPAD_TEST_MAC_MACH_ERRORS_H_

Просмотреть файл

@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#include "util/test/mac/mach_multiprocess.h"
#include "test/mac/mach_multiprocess.h"
#include <AvailabilityMacros.h>
#include <bsm/libbsm.h>
@ -26,12 +26,12 @@
#include "base/memory/scoped_ptr.h"
#include "base/rand_util.h"
#include "gtest/gtest.h"
#include "test/errors.h"
#include "test/mac/mach_errors.h"
#include "util/file/file_io.h"
#include "util/mach/mach_extensions.h"
#include "util/mach/mach_message.h"
#include "util/misc/scoped_forbid_return.h"
#include "util/test/errors.h"
#include "util/test/mac/mach_errors.h"
namespace {

Просмотреть файл

@ -12,14 +12,14 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef CRASHPAD_UTIL_TEST_MAC_MACH_MULTIPROCESS_H_
#define CRASHPAD_UTIL_TEST_MAC_MACH_MULTIPROCESS_H_
#ifndef CRASHPAD_TEST_MAC_MACH_MULTIPROCESS_H_
#define CRASHPAD_TEST_MAC_MACH_MULTIPROCESS_H_
#include <mach/mach.h>
#include <unistd.h>
#include "base/basictypes.h"
#include "util/test/multiprocess.h"
#include "test/multiprocess.h"
namespace crashpad {
namespace test {
@ -117,4 +117,4 @@ class MachMultiprocess : public Multiprocess {
} // namespace test
} // namespace crashpad
#endif // CRASHPAD_UTIL_TEST_MAC_MACH_MULTIPROCESS_H_
#endif // CRASHPAD_TEST_MAC_MACH_MULTIPROCESS_H_

Просмотреть файл

@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#include "util/test/mac/mach_multiprocess.h"
#include "test/mac/mach_multiprocess.h"
#include <unistd.h>

Просмотреть файл

@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef CRASHPAD_UTIL_TEST_MULTIPROCESS_H_
#define CRASHPAD_UTIL_TEST_MULTIPROCESS_H_
#ifndef CRASHPAD_TEST_MULTIPROCESS_H_
#define CRASHPAD_TEST_MULTIPROCESS_H_
#include <sys/types.h>
@ -203,4 +203,4 @@ class Multiprocess {
} // namespace test
} // namespace crashpad
#endif // CRASHPAD_UTIL_TEST_MULTIPROCESS_H_
#endif // CRASHPAD_TEST_MULTIPROCESS_H_

Просмотреть файл

@ -12,15 +12,15 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef CRASHPAD_UTIL_TEST_MULTIPROCESS_EXEC_H_
#define CRASHPAD_UTIL_TEST_MULTIPROCESS_EXEC_H_
#ifndef CRASHPAD_TEST_MULTIPROCESS_EXEC_H_
#define CRASHPAD_TEST_MULTIPROCESS_EXEC_H_
#include <string>
#include <vector>
#include "base/basictypes.h"
#include "build/build_config.h"
#include "util/test/multiprocess.h"
#include "test/multiprocess.h"
namespace crashpad {
namespace test {
@ -75,4 +75,4 @@ class MultiprocessExec : public Multiprocess {
} // namespace test
} // namespace crashpad
#endif // CRASHPAD_UTIL_TEST_MULTIPROCESS_EXEC_H_
#endif // CRASHPAD_TEST_MULTIPROCESS_EXEC_H_

Просмотреть файл

@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#include "util/test/multiprocess_exec.h"
#include "test/multiprocess_exec.h"
#include <fcntl.h>
#include <stdio.h>
@ -21,9 +21,9 @@
#include "base/posix/eintr_wrapper.h"
#include "gtest/gtest.h"
#include "test/errors.h"
#include "util/misc/scoped_forbid_return.h"
#include "util/posix/close_multiple.h"
#include "util/test/errors.h"
namespace crashpad {
namespace test {

Просмотреть файл

@ -12,14 +12,14 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#include "util/test/multiprocess_exec.h"
#include "test/multiprocess_exec.h"
#include "base/basictypes.h"
#include "base/strings/utf_string_conversions.h"
#include "build/build_config.h"
#include "gtest/gtest.h"
#include "test/paths.h"
#include "util/file/file_io.h"
#include "util/test/paths.h"
namespace crashpad {
namespace test {

Просмотреть файл

@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#include "util/test/multiprocess_exec.h"
#include "test/multiprocess_exec.h"
#include "base/logging.h"
#include "base/strings/utf_string_conversions.h"

Просмотреть файл

@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#include "util/test/multiprocess.h"
#include "test/multiprocess.h"
#include <signal.h>
#include <stdlib.h>
@ -28,8 +28,8 @@
#include "base/posix/eintr_wrapper.h"
#include "base/strings/stringprintf.h"
#include "gtest/gtest.h"
#include "test/errors.h"
#include "util/misc/scoped_forbid_return.h"
#include "util/test/errors.h"
namespace crashpad {
namespace test {

Просмотреть файл

@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#include "util/test/multiprocess.h"
#include "test/multiprocess.h"
#include <stdlib.h>
#include <sys/signal.h>
@ -20,8 +20,8 @@
#include "base/basictypes.h"
#include "gtest/gtest.h"
#include "test/gtest_death_check.h"
#include "util/file/file_io.h"
#include "util/test/gtest_death_check.h"
namespace crashpad {
namespace test {

Просмотреть файл

@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#include "util/test/paths.h"
#include "test/paths.h"
#include <stdlib.h>
#include <sys/stat.h>
@ -27,8 +27,7 @@ namespace {
bool IsTestDataRoot(const base::FilePath& candidate) {
const base::FilePath marker_path =
candidate.Append(FILE_PATH_LITERAL("util"))
.Append(FILE_PATH_LITERAL("test"))
candidate.Append(FILE_PATH_LITERAL("test"))
.Append(FILE_PATH_LITERAL("paths_test_data_root.txt"));
#if !defined(OS_WIN)

Просмотреть файл

@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef CRASHPAD_UTIL_TEST_PATHS_H_
#define CRASHPAD_UTIL_TEST_PATHS_H_
#ifndef CRASHPAD_TEST_PATHS_H_
#define CRASHPAD_TEST_PATHS_H_
#include "base/basictypes.h"
#include "base/files/file_path.h"
@ -46,4 +46,4 @@ class Paths {
} // namespace test
} // namespace crashpad
#endif // CRASHPAD_UTIL_TEST_PATHS_H_
#endif // CRASHPAD_TEST_PATHS_H_

Просмотреть файл

@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#include "util/test/paths.h"
#include "test/paths.h"
#include <mach-o/dyld.h>
#include <stdint.h>

Просмотреть файл

@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#include "util/test/paths.h"
#include "test/paths.h"
#include "base/files/file_path.h"
#include "build/build_config.h"
@ -27,18 +27,17 @@ TEST(Paths, Executable) {
base::FilePath executable_path = Paths::Executable();
base::FilePath executable_name = executable_path.BaseName();
#if defined(OS_WIN)
EXPECT_EQ(FILE_PATH_LITERAL("crashpad_util_test.exe"),
EXPECT_EQ(FILE_PATH_LITERAL("crashpad_test_test.exe"),
executable_name.value());
#else
EXPECT_EQ("crashpad_util_test", executable_name.value());
EXPECT_EQ("crashpad_test_test", executable_name.value());
#endif // OS_WIN
}
TEST(Paths, TestDataRoot) {
base::FilePath test_data_root = Paths::TestDataRoot();
ScopedFileHandle file(LoggingOpenFileForRead(
test_data_root.Append(FILE_PATH_LITERAL("util"))
.Append(FILE_PATH_LITERAL("test"))
test_data_root.Append(FILE_PATH_LITERAL("test"))
.Append(FILE_PATH_LITERAL("paths_test_data_root.txt"))));
EXPECT_TRUE(file.is_valid());
}

Просмотреть файл

Просмотреть файл

@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#include "util/test/paths.h"
#include "test/paths.h"
#include <windows.h>

Просмотреть файл

@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#include "util/test/scoped_temp_dir.h"
#include "test/scoped_temp_dir.h"
namespace crashpad {
namespace test {

Просмотреть файл

@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef CRASHPAD_UTIL_TEST_SCOPED_TEMP_DIR_
#define CRASHPAD_UTIL_TEST_SCOPED_TEMP_DIR_
#ifndef CRASHPAD_TEST_SCOPED_TEMP_DIR_
#define CRASHPAD_TEST_SCOPED_TEMP_DIR_
#include "base/basictypes.h"
#include "base/files/file_path.h"
@ -61,4 +61,4 @@ class ScopedTempDir {
} // namespace test
} // namespace crashpad
#endif // CRASHPAD_UTIL_TEST_SCOPED_TEMP_DIR_
#endif // CRASHPAD_TEST_SCOPED_TEMP_DIR_

Просмотреть файл

@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#include "util/test/scoped_temp_dir.h"
#include "test/scoped_temp_dir.h"
#include <dirent.h>
#include <string.h>
@ -20,7 +20,7 @@
#include "base/logging.h"
#include "gtest/gtest.h"
#include "util/test/errors.h"
#include "test/errors.h"
namespace crashpad {
namespace test {

Просмотреть файл

@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#include "util/test/scoped_temp_dir.h"
#include "test/scoped_temp_dir.h"
#include <errno.h>
#include <fcntl.h>
@ -22,7 +22,7 @@
#include "base/posix/eintr_wrapper.h"
#include "build/build_config.h"
#include "gtest/gtest.h"
#include "util/test/errors.h"
#include "test/errors.h"
#if defined(OS_POSIX)
#include <unistd.h>

Просмотреть файл

@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#include "util/test/scoped_temp_dir.h"
#include "test/scoped_temp_dir.h"
#include <windows.h>

70
test/test.gyp Normal file
Просмотреть файл

@ -0,0 +1,70 @@
# Copyright 2015 The Crashpad Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
{
'includes': [
'../build/crashpad.gypi',
],
'targets': [
{
'target_name': 'crashpad_test',
'type': 'static_library',
'dependencies': [
'../compat/compat.gyp:crashpad_compat',
'../third_party/gtest/gtest.gyp:gtest',
'../third_party/mini_chromium/mini_chromium.gyp:base',
'../util/util.gyp:crashpad_util',
],
'include_dirs': [
'..',
],
'sources': [
'errors.cc',
'errors.h',
'gtest_death_check.h',
'mac/dyld.h',
'mac/mach_errors.cc',
'mac/mach_errors.h',
'mac/mach_multiprocess.cc',
'mac/mach_multiprocess.h',
'multiprocess.h',
'multiprocess_exec.h',
'multiprocess_exec_posix.cc',
'multiprocess_exec_win.cc',
'multiprocess_posix.cc',
'paths.cc',
'paths.h',
'paths_mac.cc',
'paths_win.cc',
'scoped_temp_dir.cc',
'scoped_temp_dir.h',
'scoped_temp_dir_posix.cc',
'scoped_temp_dir_win.cc',
'thread.cc',
'thread.h',
'thread_posix.cc',
'thread_win.cc',
],
'conditions': [
['OS=="mac"', {
'link_settings': {
'libraries': [
'$(SDKROOT)/usr/lib/libbsm.dylib',
],
},
}],
],
},
],
}

52
test/test_test.gyp Normal file
Просмотреть файл

@ -0,0 +1,52 @@
# Copyright 2015 The Crashpad Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
{
'includes': [
'../build/crashpad.gypi',
],
'targets': [
{
'target_name': 'crashpad_test_test',
'type': 'executable',
'dependencies': [
'crashpad_test_test_multiprocess_exec_test_child',
'test.gyp:crashpad_test',
'../compat/compat.gyp:crashpad_compat',
'../third_party/gmock/gmock.gyp:gmock',
'../third_party/gmock/gmock.gyp:gmock_main',
'../third_party/gtest/gtest.gyp:gtest',
'../third_party/mini_chromium/mini_chromium.gyp:base',
'../util/util.gyp:crashpad_util',
],
'include_dirs': [
'..',
],
'sources': [
'mac/mach_multiprocess_test.cc',
'multiprocess_exec_test.cc',
'multiprocess_posix_test.cc',
'paths_test.cc',
'scoped_temp_dir_test.cc',
],
},
{
'target_name': 'crashpad_test_test_multiprocess_exec_test_child',
'type': 'executable',
'sources': [
'multiprocess_exec_test_child.cc',
],
},
],
}

Просмотреть файл

@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#include "util/test/thread.h"
#include "test/thread.h"
#include "gtest/gtest.h"

Просмотреть файл

@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef CRASHPAD_UTIL_TEST_THREAD_H_
#define CRASHPAD_UTIL_TEST_THREAD_H_
#ifndef CRASHPAD_TEST_THREAD_H_
#define CRASHPAD_TEST_THREAD_H_
#include "base/basictypes.h"
#include "build/build_config.h"
@ -67,4 +67,4 @@ class Thread {
} // namespace test
} // namespace crashpad
#endif // CRASHPAD_UTIL_TEST_THREAD_H_
#endif // CRASHPAD_TEST_THREAD_H_

Просмотреть файл

@ -12,10 +12,10 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#include "util/test/thread.h"
#include "test/thread.h"
#include "gtest/gtest.h"
#include "util/test/errors.h"
#include "test/errors.h"
namespace crashpad {
namespace test {

Просмотреть файл

@ -12,10 +12,10 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#include "util/test/thread.h"
#include "test/thread.h"
#include "gtest/gtest.h"
#include "util/test/errors.h"
#include "test/errors.h"
namespace crashpad {
namespace test {

Просмотреть файл

@ -18,9 +18,9 @@
#include "base/basictypes.h"
#include "base/files/file_path.h"
#include "gtest/gtest.h"
#include "util/test/errors.h"
#include "util/test/scoped_temp_dir.h"
#include "util/test/thread.h"
#include "test/errors.h"
#include "test/scoped_temp_dir.h"
#include "test/thread.h"
namespace crashpad {
namespace test {

Просмотреть файл

@ -24,8 +24,8 @@
#include "base/posix/eintr_wrapper.h"
#include "base/strings/stringprintf.h"
#include "gtest/gtest.h"
#include "util/test/errors.h"
#include "util/test/scoped_temp_dir.h"
#include "test/errors.h"
#include "test/scoped_temp_dir.h"
namespace crashpad {
namespace test {

Просмотреть файл

@ -16,9 +16,9 @@
#include "base/mac/scoped_mach_port.h"
#include "gtest/gtest.h"
#include "test/multiprocess.h"
#include "util/mach/child_port_types.h"
#include "util/mach/mach_extensions.h"
#include "util/test/multiprocess.h"
namespace crashpad {
namespace test {

Просмотреть файл

@ -16,8 +16,8 @@
#include "base/strings/stringprintf.h"
#include "gtest/gtest.h"
#include "test/gtest_death_check.h"
#include "util/mach/mach_message.h"
#include "util/test/gtest_death_check.h"
namespace crashpad {
namespace test {

Просмотреть файл

@ -21,13 +21,13 @@
#include "base/basictypes.h"
#include "base/strings/stringprintf.h"
#include "gtest/gtest.h"
#include "test/mac/mach_errors.h"
#include "test/mac/mach_multiprocess.h"
#include "util/mach/exc_server_variants.h"
#include "util/mach/exception_behaviors.h"
#include "util/mach/mach_extensions.h"
#include "util/mach/mach_message.h"
#include "util/mach/mach_message_server.h"
#include "util/test/mac/mach_errors.h"
#include "util/test/mac/mach_multiprocess.h"
namespace crashpad {
namespace test {

Просмотреть файл

@ -21,11 +21,11 @@
#include "base/strings/stringprintf.h"
#include "gmock/gmock.h"
#include "gtest/gtest.h"
#include "test/mac/mach_errors.h"
#include "test/mac/mach_multiprocess.h"
#include "util/mach/exception_behaviors.h"
#include "util/mach/mach_extensions.h"
#include "util/mach/mach_message.h"
#include "util/test/mac/mach_errors.h"
#include "util/test/mac/mach_multiprocess.h"
namespace crashpad {
namespace test {

Просмотреть файл

@ -25,6 +25,8 @@
#include "base/mac/scoped_mach_port.h"
#include "base/strings/stringprintf.h"
#include "gtest/gtest.h"
#include "test/mac/mach_errors.h"
#include "test/mac/mach_multiprocess.h"
#include "util/file/file_io.h"
#include "util/mach/exc_server_variants.h"
#include "util/mach/mach_extensions.h"
@ -32,8 +34,6 @@
#include "util/mach/mach_message_server.h"
#include "util/misc/scoped_forbid_return.h"
#include "util/synchronization/semaphore.h"
#include "util/test/mac/mach_errors.h"
#include "util/test/mac/mach_multiprocess.h"
namespace crashpad {
namespace test {

Просмотреть файл

@ -16,7 +16,7 @@
#include "base/mac/scoped_mach_port.h"
#include "gtest/gtest.h"
#include "util/test/mac/mach_errors.h"
#include "test/mac/mach_errors.h"
namespace crashpad {
namespace test {

Просмотреть файл

@ -22,11 +22,11 @@
#include "base/basictypes.h"
#include "base/mac/scoped_mach_port.h"
#include "gtest/gtest.h"
#include "test/mac/mach_errors.h"
#include "test/mac/mach_multiprocess.h"
#include "util/file/file_io.h"
#include "util/mach/mach_extensions.h"
#include "util/mach/mach_message.h"
#include "util/test/mac/mach_errors.h"
#include "util/test/mac/mach_multiprocess.h"
namespace crashpad {
namespace test {

Просмотреть файл

@ -19,8 +19,8 @@
#include "base/basictypes.h"
#include "base/mac/scoped_mach_port.h"
#include "gtest/gtest.h"
#include "test/mac/mach_errors.h"
#include "util/mach/mach_extensions.h"
#include "util/test/mac/mach_errors.h"
namespace crashpad {
namespace test {

Просмотреть файл

@ -18,10 +18,10 @@
#include "base/mac/scoped_mach_port.h"
#include "gmock/gmock.h"
#include "gtest/gtest.h"
#include "test/mac/mach_errors.h"
#include "util/mach/mach_extensions.h"
#include "util/mach/mach_message.h"
#include "util/mach/mach_message_server.h"
#include "util/test/mac/mach_errors.h"
namespace crashpad {
namespace test {

Просмотреть файл

@ -17,8 +17,8 @@
#include <mach/mach.h>
#include "gtest/gtest.h"
#include "util/test/mac/mach_errors.h"
#include "util/test/mac/mach_multiprocess.h"
#include "test/mac/mach_errors.h"
#include "test/mac/mach_multiprocess.h"
namespace crashpad {
namespace test {

Просмотреть файл

@ -24,7 +24,7 @@
#include "base/mac/scoped_mach_vm.h"
#include "base/memory/scoped_ptr.h"
#include "gtest/gtest.h"
#include "util/test/mac/mach_errors.h"
#include "test/mac/mach_errors.h"
namespace crashpad {
namespace test {

Просмотреть файл

@ -16,7 +16,7 @@
#include "base/logging.h"
#include "gtest/gtest.h"
#include "util/test/gtest_death_check.h"
#include "test/gtest_death_check.h"
namespace crashpad {
namespace test {

Просмотреть файл

@ -16,7 +16,7 @@
#include "base/compiler_specific.h"
#include "gtest/gtest.h"
#include "util/test/gtest_death_check.h"
#include "test/gtest_death_check.h"
namespace crashpad {
namespace test {

Просмотреть файл

@ -15,8 +15,8 @@
#include "util/net/http_body.h"
#include "gtest/gtest.h"
#include "test/paths.h"
#include "util/net/http_body_test_util.h"
#include "util/test/paths.h"
namespace crashpad {
namespace test {

Просмотреть файл

@ -17,10 +17,10 @@
#include <vector>
#include "gtest/gtest.h"
#include "test/gtest_death_check.h"
#include "test/paths.h"
#include "util/net/http_body.h"
#include "util/net/http_body_test_util.h"
#include "util/test/gtest_death_check.h"
#include "util/test/paths.h"
namespace crashpad {
namespace test {

Просмотреть файл

@ -29,12 +29,12 @@
#include "base/strings/utf_string_conversions.h"
#include "build/build_config.h"
#include "gtest/gtest.h"
#include "test/multiprocess_exec.h"
#include "test/paths.h"
#include "util/file/file_io.h"
#include "util/net/http_body.h"
#include "util/net/http_headers.h"
#include "util/net/http_multipart_builder.h"
#include "util/test/multiprocess_exec.h"
#include "util/test/paths.h"
namespace crashpad {
namespace test {

Просмотреть файл

@ -24,7 +24,7 @@
#include "base/basictypes.h"
#include "build/build_config.h"
#include "gtest/gtest.h"
#include "util/test/errors.h"
#include "test/errors.h"
#if defined(OS_MACOSX)
#include <crt_externs.h>

Просмотреть файл

@ -19,7 +19,7 @@
#include "base/logging.h"
#include "base/strings/stringprintf.h"
#include "gtest/gtest.h"
#include "util/test/thread.h"
#include "test/thread.h"
namespace crashpad {
namespace test {

Просмотреть файл

@ -17,63 +17,13 @@
'../build/crashpad.gypi',
],
'targets': [
{
'target_name': 'crashpad_util_test_lib',
'type': 'static_library',
'dependencies': [
'util.gyp:crashpad_util',
'../compat/compat.gyp:crashpad_compat',
'../third_party/gtest/gtest.gyp:gtest',
'../third_party/mini_chromium/mini_chromium.gyp:base',
],
'include_dirs': [
'..',
],
'sources': [
'test/errors.cc',
'test/errors.h',
'test/gtest_death_check.h',
'test/mac/dyld.h',
'test/mac/mach_errors.cc',
'test/mac/mach_errors.h',
'test/mac/mach_multiprocess.cc',
'test/mac/mach_multiprocess.h',
'test/multiprocess.h',
'test/multiprocess_exec.h',
'test/multiprocess_exec_posix.cc',
'test/multiprocess_exec_win.cc',
'test/multiprocess_posix.cc',
'test/paths.cc',
'test/paths.h',
'test/paths_mac.cc',
'test/paths_win.cc',
'test/scoped_temp_dir.cc',
'test/scoped_temp_dir.h',
'test/scoped_temp_dir_posix.cc',
'test/scoped_temp_dir_win.cc',
'test/thread.cc',
'test/thread.h',
'test/thread_posix.cc',
'test/thread_win.cc',
],
'conditions': [
['OS=="mac"', {
'link_settings': {
'libraries': [
'$(SDKROOT)/usr/lib/libbsm.dylib',
],
},
}],
],
},
{
'target_name': 'crashpad_util_test',
'type': 'executable',
'dependencies': [
'crashpad_util_test_lib',
'crashpad_util_test_multiprocess_exec_test_child',
'util.gyp:crashpad_util',
'../compat/compat.gyp:crashpad_compat',
'../test/test.gyp:crashpad_test',
'../third_party/gmock/gmock.gyp:gmock',
'../third_party/gmock/gmock.gyp:gmock_main',
'../third_party/gtest/gtest.gyp:gtest',
@ -125,11 +75,6 @@
'stdlib/strnlen_test.cc',
'string/split_string_test.cc',
'synchronization/semaphore_test.cc',
'test/mac/mach_multiprocess_test.cc',
'test/multiprocess_exec_test.cc',
'test/multiprocess_posix_test.cc',
'test/paths_test.cc',
'test/scoped_temp_dir_test.cc',
'thread/thread_log_messages_test.cc',
'win/process_info_test.cc',
'win/time_test.cc',
@ -143,6 +88,10 @@
},
}],
['OS=="win"', {
'dependencies': [
'crashpad_util_test_process_info_test_child_x64',
'crashpad_util_test_process_info_test_child_x86',
],
'link_settings': {
'libraries': [
'-lrpcrt4.lib',
@ -151,13 +100,6 @@
}],
],
},
{
'target_name': 'crashpad_util_test_multiprocess_exec_test_child',
'type': 'executable',
'sources': [
'test/multiprocess_exec_test_child.cc',
],
},
],
'conditions': [
['OS=="win"', {

Просмотреть файл

@ -20,8 +20,8 @@
#include "base/files/file_path.h"
#include "build/build_config.h"
#include "gtest/gtest.h"
#include "test/paths.h"
#include "util/misc/uuid.h"
#include "util/test/paths.h"
#include "util/win/scoped_handle.h"
namespace crashpad {