OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <stdarg.h> | 5 #include <stdarg.h> |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/base_paths.h" | 9 #include "base/base_paths.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 exe_dir.AppendASCII("boringssl_" + name); | 25 exe_dir.AppendASCII("boringssl_" + name); |
26 base::CommandLine cmd(test_binary); | 26 base::CommandLine cmd(test_binary); |
27 | 27 |
28 for (size_t i = 0; i < args.size(); ++i) { | 28 for (size_t i = 0; i < args.size(); ++i) { |
29 cmd.AppendArgNative(args[i]); | 29 cmd.AppendArgNative(args[i]); |
30 } | 30 } |
31 | 31 |
32 std::string output; | 32 std::string output; |
33 EXPECT_TRUE(base::GetAppOutput(cmd, &output)); | 33 EXPECT_TRUE(base::GetAppOutput(cmd, &output)); |
34 // Account for Windows line endings. | 34 // Account for Windows line endings. |
35 ReplaceSubstringsAfterOffset(&output, 0, "\r\n", "\n"); | 35 base::ReplaceSubstringsAfterOffset(&output, 0, "\r\n", "\n"); |
36 | 36 |
37 const bool ok = output.size() >= 5 && | 37 const bool ok = output.size() >= 5 && |
38 memcmp("PASS\n", &output[output.size() - 5], 5) == 0 && | 38 memcmp("PASS\n", &output[output.size() - 5], 5) == 0 && |
39 (output.size() == 5 || output[output.size() - 6] == '\n'); | 39 (output.size() == 5 || output[output.size() - 6] == '\n'); |
40 | 40 |
41 EXPECT_TRUE(ok) << output; | 41 EXPECT_TRUE(ok) << output; |
42 } | 42 } |
43 | 43 |
44 void TestSimple(const std::string& name) { | 44 void TestSimple(const std::string& name) { |
45 std::vector<base::CommandLine::StringType> empty; | 45 std::vector<base::CommandLine::StringType> empty; |
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 TestSimple("tab_test"); | 292 TestSimple("tab_test"); |
293 } | 293 } |
294 | 294 |
295 TEST(BoringSSL, Thread) { | 295 TEST(BoringSSL, Thread) { |
296 TestSimple("thread_test"); | 296 TestSimple("thread_test"); |
297 } | 297 } |
298 | 298 |
299 TEST(BoringSSL, V3NameTest) { | 299 TEST(BoringSSL, V3NameTest) { |
300 TestSimple("v3name_test"); | 300 TestSimple("v3name_test"); |
301 } | 301 } |
OLD | NEW |