OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2013 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 using System; |
| 5 using System.Text; |
| 6 using System.Collections.Generic; |
| 7 using EnvDTE; |
| 8 using EnvDTE80; |
| 9 using Microsoft.VisualStudio.TestTools.UnitTesting; |
| 10 using Microsoft.VisualStudio.VCProjectEngine; |
| 11 using NaCl.Build.CPPTasks; |
| 12 using NativeClientVSAddIn; |
| 13 |
| 14 namespace UnitTests |
| 15 { |
| 16 [TestClass] |
| 17 public class CompileParallelTest : BaseCompileTest |
| 18 { |
| 19 private static string SolutionBaseName_ = "CompileParallelTest"; |
| 20 |
| 21 [ClassInitialize] |
| 22 public new static void ClassSetUp(TestContext testContext) |
| 23 { |
| 24 BaseCompileTest.ClassSetUp(testContext, SolutionBaseName_); |
| 25 } |
| 26 |
| 27 /// <summary> |
| 28 /// This is run after each test to clean up things created in TestSetup(
). |
| 29 /// </summary> |
| 30 [TestCleanup] |
| 31 public void ClassTearDown() |
| 32 { |
| 33 TestUtilities.CleanUpVisualStudioInstance(dte_); |
| 34 } |
| 35 |
| 36 /// <summary> |
| 37 /// Test that parallel compilation works. |
| 38 /// </summary> |
| 39 [TestMethod] |
| 40 public void CheckParallelCompile() |
| 41 { |
| 42 string platform = TestUtilities.NaClProjectUniqueName; |
| 43 dte_.Solution.Open(SolutionName_); |
| 44 Project project = dte_.Solution.Projects.Item(platform); |
| 45 |
| 46 // Add property sheet that enables multiprocessing |
| 47 VCConfiguration config; |
| 48 IVCRulePropertyStorage rule; |
| 49 config = TestUtilities.GetVCConfiguration(project, "Debug", platform
); |
| 50 config.AddPropertySheet("multiprocess.props"); |
| 51 config = TestUtilities.GetVCConfiguration(project, "Release", platfo
rm); |
| 52 config.AddPropertySheet("multiprocess.props"); |
| 53 |
| 54 // Add a second file |
| 55 project.ProjectItems.AddFromFile("test_file.cpp"); |
| 56 |
| 57 dte_.Solution.Close(true); |
| 58 |
| 59 CheckCompile(Strings.NaCl64PlatformName, false); |
| 60 } |
| 61 } |
| 62 } |
OLD | NEW |