diff options
author | Alex Vakulenko <avakulenko@google.com> | 2015-10-12 15:21:28 -0700 |
---|---|---|
committer | Alex Vakulenko <avakulenko@google.com> | 2015-10-13 16:10:03 -0700 |
commit | 9ed0cab99f18acb3570a35e9408f24355f6b8324 (patch) | |
tree | 60e3b4c2822b812b3218489a9a6d835df1e8ca6e /brillo/test_helpers.h | |
parent | eabfe23a51c91a103042793ac2d5c28170994e1f (diff) | |
download | platform_external_libbrillo-9ed0cab99f18acb3570a35e9408f24355f6b8324.tar.gz platform_external_libbrillo-9ed0cab99f18acb3570a35e9408f24355f6b8324.tar.bz2 platform_external_libbrillo-9ed0cab99f18acb3570a35e9408f24355f6b8324.zip |
Move chromeos symbols into brillo namespace
And move the include files into "brillo" directory instead of "chromeos"
BUG: 24872993
TEST=built aosp and brillo and unit tests pass on dragonoboard
Change-Id: Ieb979d1ebd3152921d36cd15acbd6247f02aae69
Diffstat (limited to 'brillo/test_helpers.h')
-rw-r--r-- | brillo/test_helpers.h | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/brillo/test_helpers.h b/brillo/test_helpers.h new file mode 100644 index 0000000..f035b66 --- /dev/null +++ b/brillo/test_helpers.h @@ -0,0 +1,32 @@ +// Copyright (c) 2011 The Chromium OS 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 LIBCHROMEOS_BRILLO_TEST_HELPERS_H_ +#define LIBCHROMEOS_BRILLO_TEST_HELPERS_H_ + +#include "gtest/gtest.h" + +#include <string> + +#include <base/command_line.h> +#include <base/files/file_path.h> +#include <base/files/file_util.h> +#include <base/logging.h> + +#include "brillo/syslog_logging.h" + +inline void ExpectFileEquals(const char* golden, const char* file_path) { + std::string contents; + EXPECT_TRUE(base::ReadFileToString(base::FilePath(file_path), &contents)); + EXPECT_EQ(golden, contents); +} + +inline void SetUpTests(int* argc, char** argv, bool log_to_stderr) { + base::CommandLine::Init(*argc, argv); + ::brillo::InitLog(log_to_stderr ? brillo::kLogToStderr : 0); + ::brillo::LogToString(true); + ::testing::InitGoogleTest(argc, argv); +} + +#endif // LIBCHROMEOS_BRILLO_TEST_HELPERS_H_ |