Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(148)

Unified Diff: chromeos/test_helpers.h

Issue 6597120: libchromeos: re-push add process control library, syslog logging capability, and run unit tests (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/common.git@master
Patch Set: Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chromeos/syslog_logging.cc ('k') | testrunner.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/test_helpers.h
diff --git a/chromeos/test_helpers.h b/chromeos/test_helpers.h
new file mode 100644
index 0000000000000000000000000000000000000000..8cf4ad841596b8834086fd532d9ffab93cca5915
--- /dev/null
+++ b/chromeos/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 _CHROMEOS_TEST_HELPERS_H_
+#define _CHROMEOS_TEST_HELPERS_H_
+
+#include "gtest/gtest.h"
+
+#include <string>
+
+#include <base/command_line.h>
+#include <base/file_util.h>
+#include <base/logging.h>
+#include <chromeos/syslog_logging.h>
+
+inline void ExpectFileEquals(const char* golden,
+ const char* file_path) {
+ std::string contents;
+ EXPECT_TRUE(file_util::ReadFileToString(FilePath(file_path),
+ &contents));
+ EXPECT_EQ(golden, contents);
+}
+
+inline void SetUpTests(int *argc, char** argv, bool log_to_stderr) {
+ CommandLine::Init(*argc, argv);
+ ::chromeos::InitLog(log_to_stderr ? chromeos::kLogToStderr : 0);
+ ::chromeos::LogToString(true);
+ ::testing::InitGoogleTest(argc, argv);
+}
+
+#endif // _CHROMEOS_TEST_HELPERS_H_
« no previous file with comments | « chromeos/syslog_logging.cc ('k') | testrunner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698