/// <summary> /// Create commands to publish the instrumented assemblies. /// </summary> /// <param name="sessionInfo">The session info.</param> /// <returns></returns> private static List <ICommand> CreatePublishInstrumentedAssembliesCommands(SessionInfo sessionInfo) { List <ICommand> commands = new List <ICommand>(); // Publish the code coverage assemblies foreach (AssemblyUnderTestConfig assemblyUnderTest in sessionInfo.Configuration.AssembliesUnderTestConfig) { string assemblyPath = Path.Combine(sessionInfo.AssembliesDirectory, Path.GetFileName(assemblyUnderTest.AssemblyPath)); if (assemblyUnderTest.IsStrongNamed) { SnCommand snCommand = new SnCommand(string.Format("-Vr \"{0}\"", assemblyUnderTest.AssemblyPath), false); snCommand.OutputDataReceived += new EventHandler <OutputDataEventArgs>(WriteCommandOutputToConsole); commands.Add(snCommand); } PublishAssemblyCommand publishAssemblyCommand = new PublishAssemblyCommand(assemblyPath, assemblyUnderTest.PublishPath, sessionInfo.AssemblyBackupDirectory, false); publishAssemblyCommand.OutputDataReceived += new EventHandler <OutputDataEventArgs>(WriteCommandOutputToConsole); commands.Add(publishAssemblyCommand); } // Publish the test assemblies foreach (TestAssemblyConfig testAssemblyConfig in sessionInfo.Configuration.TestAssembliesConfig) { if (!string.IsNullOrEmpty(testAssemblyConfig.PublishPath)) { PublishAssemblyCommand publishAssemblyCommand = new PublishAssemblyCommand(testAssemblyConfig.AssemblyPath, testAssemblyConfig.PublishPath, sessionInfo.AssemblyBackupDirectory, false); publishAssemblyCommand.OutputDataReceived += new EventHandler <OutputDataEventArgs>(WriteCommandOutputToConsole); commands.Add(publishAssemblyCommand); } } // Publish the referenced assemblies foreach (ReferencedAssemblyConfig referenecedAssemblyConfig in sessionInfo.Configuration.ReferencedAssembliesConfig) { PublishAssemblyCommand publishAssemblyCommand = new PublishAssemblyCommand(referenecedAssemblyConfig.AssemblyPath, referenecedAssemblyConfig.PublishPath, sessionInfo.AssemblyBackupDirectory, false); publishAssemblyCommand.OutputDataReceived += new EventHandler <OutputDataEventArgs>(WriteCommandOutputToConsole); commands.Add(publishAssemblyCommand); } return(commands); }
/// <summary> /// Create commands to publish the assemblies under test /// </summary> /// <param name="sessionInfo">The session info.</param> /// <returns></returns> private static List <ICommand> CreateCopyAssembliesCommands(SessionInfo sessionInfo) { List <ICommand> commands = new List <ICommand>(); // Publish the code coverage assemblies foreach (AssemblyUnderTestConfig assemblyUnderTest in sessionInfo.Configuration.AssembliesUnderTestConfig) { PublishAssemblyCommand publishAssemblyCommand = new PublishAssemblyCommand(assemblyUnderTest.AssemblyPath, sessionInfo.AssembliesDirectory, null, false); publishAssemblyCommand.OutputDataReceived += new EventHandler <OutputDataEventArgs>(WriteCommandOutputToConsole); commands.Add(publishAssemblyCommand); string pdbFileName = Path.GetFileNameWithoutExtension(assemblyUnderTest.AssemblyPath) + ".pdb"; string pdbFilePath = Path.Combine(Path.GetDirectoryName(assemblyUnderTest.AssemblyPath), pdbFileName); PublishAssemblyCommand publishPdbCommand = new PublishAssemblyCommand(pdbFilePath, sessionInfo.AssembliesDirectory, null, false); publishPdbCommand.OutputDataReceived += new EventHandler <OutputDataEventArgs>(WriteCommandOutputToConsole); commands.Add(publishPdbCommand); } return(commands); }