| Index: visual_studio/NativeClientVSAddIn/UnitTests/CompileParallelTest.cs
|
| diff --git a/visual_studio/NativeClientVSAddIn/UnitTests/CompileParallelTest.cs b/visual_studio/NativeClientVSAddIn/UnitTests/CompileParallelTest.cs
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..d8df3dc135e9f03d0c1c107ea94e6c7c9584f2d4
|
| --- /dev/null
|
| +++ b/visual_studio/NativeClientVSAddIn/UnitTests/CompileParallelTest.cs
|
| @@ -0,0 +1,62 @@
|
| +// Copyright (c) 2013 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +using System;
|
| +using System.Text;
|
| +using System.Collections.Generic;
|
| +using EnvDTE;
|
| +using EnvDTE80;
|
| +using Microsoft.VisualStudio.TestTools.UnitTesting;
|
| +using Microsoft.VisualStudio.VCProjectEngine;
|
| +using NaCl.Build.CPPTasks;
|
| +using NativeClientVSAddIn;
|
| +
|
| +namespace UnitTests
|
| +{
|
| + [TestClass]
|
| + public class CompileParallelTest : BaseCompileTest
|
| + {
|
| + private static string SolutionBaseName_ = "CompileParallelTest";
|
| +
|
| + [ClassInitialize]
|
| + public new static void ClassSetUp(TestContext testContext)
|
| + {
|
| + BaseCompileTest.ClassSetUp(testContext, SolutionBaseName_);
|
| + }
|
| +
|
| + /// <summary>
|
| + /// This is run after each test to clean up things created in TestSetup().
|
| + /// </summary>
|
| + [TestCleanup]
|
| + public void ClassTearDown()
|
| + {
|
| + TestUtilities.CleanUpVisualStudioInstance(dte_);
|
| + }
|
| +
|
| + /// <summary>
|
| + /// Test that parallel compilation works.
|
| + /// </summary>
|
| + [TestMethod]
|
| + public void CheckParallelCompile()
|
| + {
|
| + string platform = TestUtilities.NaClProjectUniqueName;
|
| + dte_.Solution.Open(SolutionName_);
|
| + Project project = dte_.Solution.Projects.Item(platform);
|
| +
|
| + // Add property sheet that enables multiprocessing
|
| + VCConfiguration config;
|
| + IVCRulePropertyStorage rule;
|
| + config = TestUtilities.GetVCConfiguration(project, "Debug", platform);
|
| + config.AddPropertySheet("multiprocess.props");
|
| + config = TestUtilities.GetVCConfiguration(project, "Release", platform);
|
| + config.AddPropertySheet("multiprocess.props");
|
| +
|
| + // Add a second file
|
| + project.ProjectItems.AddFromFile("test_file.cpp");
|
| +
|
| + dte_.Solution.Close(true);
|
| +
|
| + CheckCompile(Strings.NaCl64PlatformName, false);
|
| + }
|
| + }
|
| +}
|
|
|