OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "tools/gn/visual_studio_utils.h" | 5 #include "tools/gn/visual_studio_utils.h" |
6 | 6 |
7 #include "base/location.h" | 7 #include "base/location.h" |
8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
10 | 10 |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 ParseCompilerOption("/wd1234", &options); | 85 ParseCompilerOption("/wd1234", &options); |
86 ParseCompilerOption("/wd56", &options); | 86 ParseCompilerOption("/wd56", &options); |
87 ASSERT_EQ("1234;56;", options.disable_specific_warnings); | 87 ASSERT_EQ("1234;56;", options.disable_specific_warnings); |
88 | 88 |
89 CHECK(options.additional_options.empty()); | 89 CHECK(options.additional_options.empty()); |
90 ParseCompilerOption("/MP", &options); | 90 ParseCompilerOption("/MP", &options); |
91 ParseCompilerOption("/bigobj", &options); | 91 ParseCompilerOption("/bigobj", &options); |
92 ParseCompilerOption("/Zc:sizedDealloc", &options); | 92 ParseCompilerOption("/Zc:sizedDealloc", &options); |
93 ASSERT_EQ("/MP /bigobj /Zc:sizedDealloc ", options.additional_options); | 93 ASSERT_EQ("/MP /bigobj /Zc:sizedDealloc ", options.additional_options); |
94 } | 94 } |
| 95 |
| 96 TEST(VisualStudioUtils, ParseLinkerOption) { |
| 97 LinkerOptions options; |
| 98 ParseLinkerOption("/SUBSYSTEM:CONSOLE,5.02h", &options); |
| 99 ASSERT_EQ("CONSOLE", options.subsystem); |
| 100 |
| 101 ParseLinkerOption("/SUBSYSTEM:WINDOWS", &options); |
| 102 ASSERT_EQ("WINDOWS", options.subsystem); |
| 103 } |
OLD | NEW |