示例#1
0
        public void CompiledToWindowsApp()
        {
            compilerTask.TargetType = "WinExe";
            compilerTask.Execute();

            Assert.AreEqual(PEFileKinds.WindowApplication, mockCompiler.TargetKind);
        }
 public void Init()
 {
     mockCompiler          = new MockPythonCompiler();
     compilerTask          = new PythonCompilerTask(mockCompiler);
     mainTaskItem          = new TaskItem("main.py");
     classTaskItem         = new TaskItem("class1.py");
     compilerTask.Sources  = new ITaskItem[] { mainTaskItem, classTaskItem };
     compilerTask.MainFile = "main.py";
     compilerTask.Execute();
 }
示例#3
0
        public void Init()
        {
            mockCompiler                  = new MockPythonCompiler();
            compiler                      = new PythonCompilerTask(mockCompiler);
            sourceTaskItem                = new TaskItem("test.py");
            compiler.Sources              = new ITaskItem[] { sourceTaskItem };
            compiler.TargetType           = "Exe";
            compiler.OutputAssembly       = "test.exe";
            compiler.EmitDebugInformation = true;

            compiler.Execute();
        }
示例#4
0
        public void Init()
        {
            mockCompiler            = new MockPythonCompiler();
            compiler                = new PythonCompilerTask(mockCompiler);
            sourceTaskItem          = new TaskItem("test.py");
            compiler.Sources        = new ITaskItem[] { sourceTaskItem };
            compiler.TargetType     = "Exe";
            compiler.OutputAssembly = "test.exe";

            systemDataReferenceTaskItem = new TaskItem(@"C:\Windows\Microsoft.NET\Framework\2.0\System.Data.dll");
            systemXmlReferenceTaskItem  = new TaskItem(@"C:\Windows\Microsoft.NET\Framework\2.0\System.Xml.dll");
            compiler.References         = new ITaskItem[] { systemDataReferenceTaskItem, systemXmlReferenceTaskItem };

            success = compiler.Execute();
        }
        public void Execute_ResourceHasLogicalNameSetInTaskItemMetadata_ResourceNamePassedToCompilerUsesLogicalName()
        {
            CreatePythonCompilerTask();

            TaskItem resourceTaskItem = new TaskItem("test.xaml");

            resourceTaskItem.SetMetadata("LogicalName", "MyLogicalResourceName");
            compilerTask.Resources = new ITaskItem[] { resourceTaskItem };
            compilerTask.Execute();

            ResourceFile resourceFile = mockCompiler.ResourceFiles[0];
            string       resourceName = resourceFile.Name;

            string expectedResourceName = "MyLogicalResourceName";

            Assert.AreEqual(expectedResourceName, resourceName);
        }
示例#6
0
        public void Init()
        {
            mockCompiler = new MockPythonCompiler();
            compiler     = new PythonCompilerTask(mockCompiler);
            TaskItem sourceTaskItem = new TaskItem("test.py");

            compiler.Sources        = new ITaskItem[] { sourceTaskItem };
            compiler.TargetType     = "Exe";
            compiler.OutputAssembly = "test.exe";

            resourceTaskItem   = new TaskItem(@"C:\Projects\Test\Test.resources");
            compiler.Resources = new ITaskItem[] { resourceTaskItem };

            compiler.Execute();

            if (mockCompiler.ResourceFiles != null && mockCompiler.ResourceFiles.Count > 0)
            {
                resourceFile = mockCompiler.ResourceFiles[0];
            }
        }
 public void DefaultPlatformIsILOnly()
 {
     compilerTask.Execute();
     Assert.AreEqual(PortableExecutableKinds.ILOnly, mockCompiler.ExecutableKind);
 }