Esempio n. 1
0
        public void FileConfig_Test2()
        {
            string sqLanguage;

            CFamily.Capture[] captures = new CFamily.FileConfig()
            {
                PlatformName    = "x64",
                PlatformToolset = "v140",
                AdditionalIncludeDirectories    = "",
                PreprocessorDefinitions         = "",
                UndefinePreprocessorDefinitions = "",
                ForcedIncludeFiles    = "",
                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,
            }.ToCaptures(FileName, out sqLanguage);
            CFamily.Capture p = captures[0];
            CFamily.Capture c = captures[1];

            p.StdErr.Should().Be("19.00.00 for x64");

            c.Cmd.Should().Equal(new [] {
                "cl.exe",
                "/X",
                "/Yu", "stdafx.h",
                "/u",
                "/TP",
                "/clr",
                "/ZW",
                "/Za",
                "/Zc:wchar_t-",
                "/Zc:forScope-",
                "/openmp",
                "/MDd",
                "/EHa",
                "/arch:IA32",
                "/GR-",
                "/RTC1",
                FileName,
            });
        }
Esempio n. 2
0
        public void FileConfig_Test1()
        {
            string sqLanguage;

            CFamily.Capture[] captures = new CFamily.FileConfig()
            {
                PlatformName                    = "Win32",
                PlatformToolset                 = "v140",
                IncludeDirectories              = "sys1;sys2;",
                AdditionalIncludeDirectories    = "dir1;dir2;",
                PreprocessorDefinitions         = "D1;D2;",
                UndefinePreprocessorDefinitions = "U1;U2;",
                ForcedIncludeFiles              = "h1;h2;",
                CompileAs                    = "Default",
                CompileAsManaged             = "",
                RuntimeLibrary               = "MultiThreaded",
                ExceptionHandling            = "false",
                EnableEnhancedInstructionSet = "NotSet",
                RuntimeTypeInfo              = "true",
                BasicRuntimeChecks           = "Default",
                AdditionalOptions            = "/a1 /a2",
                AbsoluteFilePath             = FileName,
            }.ToCaptures(FileName, out sqLanguage);
            CFamily.Capture p = captures[0];
            CFamily.Capture c = captures[1];

            p.Compiler.Should().Be("msvc-cl");
            p.StdErr.Should().Be("19.00.00 for x86");
            p.Cwd.Should().Be(@"C:\absolute\path\to");
            p.Executable.Should().Be("cl.exe");

            c.Compiler.Should().Be("msvc-cl");
            c.StdErr.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,
            });
        }