mirror of
https://github.com/chromium/crashpad.git
synced 2024-12-27 15:32:10 +08:00
f55a8d4ff3
Packaged test running seems to be a ways off, but with a bit of path fiddling in test_paths.cc we can actually use the paths where the tests are copied, so do that instead to get all the tests re-enabled. The setup in BUILD.gn should be mostly-useful once packaging is working as all helper/data files will need to specified there anyway. Also, attempted fix to flaky behaviour in ProcessReaderFuchsia.ChildThreads exposed because the tests are now being run. zx_object_wait_many() waits on *any* of the objects, not *all* of them. Derp! And finally, for the same test, work around some unintuitive behaviour in zx_task_suspend(), in particular that the thread will not be suspended for the purpose of reading registers right away, but instead only "sometime later", which appears in pratice to be after the next context switch. Have ScopedTaskSuspend block for a while to try to ensure the registers become readble, and if they don't, at least fail noisily at that point. Bug: crashpad:196 Change-Id: I01fb3590ede96301c941c2a88eba47fdbfe74ea7 Reviewed-on: https://chromium-review.googlesource.com/1053797 Reviewed-by: Joshua Peraza <jperaza@chromium.org> Commit-Queue: Scott Graham <scottmg@chromium.org>
36 lines
1.1 KiB
C++
36 lines
1.1 KiB
C++
// Copyright 2014 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.
|
|
|
|
#include "test/test_paths.h"
|
|
|
|
#include "base/files/file_path.h"
|
|
#include "gtest/gtest.h"
|
|
#include "util/file/file_io.h"
|
|
|
|
namespace crashpad {
|
|
namespace test {
|
|
namespace {
|
|
|
|
TEST(TestPaths, TestDataRoot) {
|
|
base::FilePath test_data_root = TestPaths::TestDataRoot();
|
|
ScopedFileHandle file(LoggingOpenFileForRead(
|
|
test_data_root.Append(FILE_PATH_LITERAL("test"))
|
|
.Append(FILE_PATH_LITERAL("test_paths_test_data_root.txt"))));
|
|
EXPECT_TRUE(file.is_valid());
|
|
}
|
|
|
|
} // namespace
|
|
} // namespace test
|
|
} // namespace crashpad
|