OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include <string> |
| 6 |
| 7 #include "base/command_line.h" |
| 8 #include "base/test/test_suite.h" |
| 9 #include "base/test/test_switches.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" |
| 11 |
| 12 namespace switches { |
| 13 const char kSingleProcessTestsSwitchName[] = "single-process-tests"; |
| 14 const char kUserNameSwitchName[] = "username"; |
| 15 } |
| 16 |
| 17 int main(int argc, char* argv[]) { |
| 18 testing::InitGoogleTest(&argc, argv); |
| 19 base::TestSuite test_suite(argc, argv); |
| 20 |
| 21 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
| 22 DCHECK(command_line); |
| 23 |
| 24 // Do not retry if tests fails. |
| 25 command_line->AppendSwitchASCII(switches::kTestLauncherRetryLimit, "0"); |
| 26 |
| 27 // Different tests may require access to the same host if run in parallel. |
| 28 // To avoid shared resource contention, tests will be run one at a time. |
| 29 command_line->AppendSwitch(switches::kSingleProcessTestsSwitchName); |
| 30 |
| 31 std::string username = |
| 32 command_line->GetSwitchValueASCII(switches::kUserNameSwitchName); |
| 33 |
| 34 // Verify that the username is passed in as an argument. |
| 35 if (username.empty()) { |
| 36 LOG(ERROR) << "No username passed in, can't authenticate without that!"; |
| 37 return -1; |
| 38 } |
| 39 DVLOG(1) << "Running chromoting tests as: " << username; |
| 40 |
| 41 return 0; |
| 42 } |
| 43 |
OLD | NEW |