public void ToCaptures_Test2() { var fileConfig = new CFamilyHelper.FileConfig() { PlatformName = "x64", PlatformToolset = "v140", AdditionalIncludeDirectories = "", PreprocessorDefinitions = "", UndefinePreprocessorDefinitions = "", ForcedIncludeFiles = "", PrecompiledHeader = "Use", PrecompiledHeaderFile = "stdafx.h", UndefineAllPreprocessorDefinitions = "true", IgnoreStandardIncludePath = "true", CompileAs = "CompileAsCpp", DisableLanguageExtensions = "true", CompileAsManaged = "true", CompileAsWinRT = "true", TreatWChar_tAsBuiltInType = "false", ForceConformanceInForLoopScope = "false", OpenMPSupport = "true", RuntimeLibrary = "MultiThreadedDebugDLL", RuntimeTypeInfo = "false", ExceptionHandling = "Async", EnableEnhancedInstructionSet = "NoExtensions", BasicRuntimeChecks = "EnableFastChecks", AdditionalOptions = "", AbsoluteFilePath = FileName, CompilerVersion = "19.00.00", }; CFamilyHelper.Capture[] captures = CFamilyHelper.Capture.ToCaptures(fileConfig, FileName, out _); CFamilyHelper.Capture p = captures[0]; CFamilyHelper.Capture c = captures[1]; p.CompilerVersion.Should().Be("19.00.00"); p.X64.Should().Be(true); c.Cmd.Should().Equal(new[] { "cl.exe", "/X", "/Yustdafx.h", "/u", "/TP", "/clr", "/ZW", "/Za", "/Zc:wchar_t-", "/Zc:forScope-", "/openmp", "/MDd", "/EHa", "/arch:IA32", "/GR-", "/RTC1", FileName, }); }
public void ToCaptures_Test1() { var fileConfig = new CFamilyHelper.FileConfig { PlatformName = "Win32", PlatformToolset = "v140", IncludeDirectories = "sys1;sys2;", AdditionalIncludeDirectories = "dir1;dir2;", PreprocessorDefinitions = "D1;D2;", UndefinePreprocessorDefinitions = "U1;U2;", ForcedIncludeFiles = "h1;h2;", PrecompiledHeader = "", CompileAs = "Default", CompileAsManaged = "", RuntimeLibrary = "MultiThreaded", ExceptionHandling = "false", EnableEnhancedInstructionSet = "NotSet", RuntimeTypeInfo = "true", BasicRuntimeChecks = "Default", AdditionalOptions = "/a1 /a2", AbsoluteFilePath = FileName, AbsoluteProjectPath = ProjectPath, CompilerVersion = "19.00.00", }; CFamilyHelper.Capture[] captures = CFamilyHelper.Capture.ToCaptures(fileConfig, FileName, out _); CFamilyHelper.Capture p = captures[0]; CFamilyHelper.Capture c = captures[1]; p.Compiler.Should().Be("msvc-cl"); p.CompilerVersion.Should().Be("19.00.00"); p.X64.Should().Be(false); p.Cwd.Should().Be(@"C:\absolute\path"); p.Executable.Should().Be("cl.exe"); c.Compiler.Should().Be("msvc-cl"); c.CompilerVersion.Should().BeNull("otherwise will be considered as probe"); c.Cwd.Should().Be(p.Cwd); c.Executable.Should().BeSameAs(p.Executable, "otherwise won't be associated with probe"); c.Env.Should().Equal(new[] { "INCLUDE=sys1;sys2;" }); c.Cmd.Should().Equal(new[] { "cl.exe", "/I", "dir1", "/I", "dir2", "/FI", "h1", "/FI", "h2", "/D", "D1", "/D", "D2", "/U", "U1", "/U", "U2", "/MT", "/a1", "/a2", FileName, }); }