示例#1
0
        public void WinMDModule()
        {
            WinMDExp t = new WinMDExp();

            t.WinMDModule = "Foo.dll";
            CommandLine.ValidateContains(t, "Foo.dll", false);
        }
示例#2
0
        public void WinMDModule()
        {
            WinMDExp t = new WinMDExp();

            t.WinMDModule = "Foo.dll";
            CommandLine.ValidateContains(t, "Foo.dll", useResponseFile: true);
        }
示例#3
0
        public void NoOutputFileDefined()
        {
            WinMDExp t = new WinMDExp();

            t.WinMDModule = "Foo.dll";
            t.OutputWindowsMetadataFile = "Foo.winmd";
            CommandLine.ValidateHasParameter(t, "/out:Foo.winmd", false);
        }
示例#4
0
        public void TestNoWarnSwitchWithWarnings()
        {
            WinMDExp t = new WinMDExp();

            t.WinMDModule      = "Foo.dll";
            t.DisabledWarnings = "41999,42016";
            CommandLine.ValidateHasParameter(t, "/nowarn:41999,42016", false);
        }
示例#5
0
        public void UsesrDefinedOutputFile()
        {
            WinMDExp t = new WinMDExp();

            t.WinMDModule = "Foo.dll";
            t.OutputWindowsMetadataFile = "Bob.winmd";
            CommandLine.ValidateHasParameter(t, "/out:Bob.winmd", useResponseFile: true);
        }
示例#6
0
        public void DocumentationFile()
        {
            WinMDExp t = new WinMDExp();

            t.WinMDModule             = "Foo.dll";
            t.OutputDocumentationFile = "output.xml";
            t.InputDocumentationFile  = "input.xml";

            CommandLine.ValidateHasParameter(t, "/d:output.xml", false);
            CommandLine.ValidateHasParameter(t, "/md:input.xml", false);
        }
示例#7
0
        public void PDBFileTesting()
        {
            WinMDExp t = new WinMDExp();

            t.WinMDModule = "Foo.dll";
            t.OutputWindowsMetadataFile = "Foo.dll";
            t.OutputPDBFile             = "output.pdb";
            t.InputPDBFile = "input.pdb";

            CommandLine.ValidateHasParameter(t, "/pdb:output.pdb", false);
            CommandLine.ValidateHasParameter(t, "/mp:input.pdb", false);
        }
示例#8
0
        public void References()
        {
            WinMDExp t = new WinMDExp();

            t.WinMDModule = "Foo.dll";

            TaskItem mscorlibReference          = new TaskItem("mscorlib.dll");
            TaskItem windowsFoundationReference = new TaskItem("Windows.Foundation.winmd");

            t.References = new TaskItem[] { mscorlibReference, windowsFoundationReference };
            CommandLine.ValidateHasParameter(t, "/reference:mscorlib.dll", false);
            CommandLine.ValidateHasParameter(t, "/reference:Windows.Foundation.winmd", false);
        }
示例#9
0
        public void ArgumentsAreUnquoted()
        {
            WinMDExp t = new WinMDExp
            {
                AssemblyUnificationPolicy = "sp ace",
                InputDocumentationFile    = "sp ace",
                InputPDBFile = "sp ace",
                References   = new ITaskItem[]
                {
                    new TaskItem(@"sp ace"),
                },
                OutputDocumentationFile   = "sp ace",
                OutputPDBFile             = "sp ace",
                OutputWindowsMetadataFile = "sp ace",
                WinMDModule = "sp ace",
            };

            CommandLineBuilderExtension c = new CommandLineBuilderExtension(quoteHyphensOnCommandLine: false, useNewLineSeparator: true);

            t.AddResponseFileCommands(c);

            string[] actual   = c.ToString().Split(MSBuildConstants.EnvironmentNewLine, StringSplitOptions.None);
            string[] expected =
            {
                "/d:sp ace",
                "/md:sp ace",
                "/mp:sp ace",
                "/pdb:sp ace",
                "/assemblyunificationpolicy:sp ace",
                "/out:sp ace",
                "/reference:sp ace",
                "sp ace",
            };

            Assert.Equal(expected, actual);
        }