示例#1
0
        public void Init()
        {
            mockCompiler            = new MockPythonCompiler();
            compiler                = new DummyPythonCompilerTask(mockCompiler, @"C:\Projects\MyProject");
            compiler.TargetType     = "Exe";
            compiler.OutputAssembly = "test.exe";

            resourceTaskItem         = new TaskItem(@"..\RequiredLibraries\MyResource.resx");
            fullPathResourceTaskItem = new TaskItem(@"C:\Projects\Test\MyTest.resx");
            compiler.Resources       = new ITaskItem[] { resourceTaskItem, fullPathResourceTaskItem };

            compiler.Execute();
        }
		public void Init()
		{
			mockCompiler = new MockPythonCompiler();
			compiler = new DummyPythonCompilerTask(mockCompiler, @"C:\Projects\MyProject");
			compiler.TargetType = "Exe";
			compiler.OutputAssembly = "test.exe";
			
			resourceTaskItem = new TaskItem(@"..\RequiredLibraries\MyResource.resx");
			fullPathResourceTaskItem = new TaskItem(@"C:\Projects\Test\MyTest.resx");
			compiler.Resources = new ITaskItem[] {resourceTaskItem, fullPathResourceTaskItem};
			
			compiler.Execute();
		}
		public void Init()
		{
			mockCompiler = new MockPythonCompiler();
			compiler = new DummyPythonCompilerTask(mockCompiler, @"C:\Projects\MyProject");
			compiler.TargetType = "Exe";
			compiler.OutputAssembly = "test.exe";
			
			TaskItem sourceFile = new TaskItem(@"D:\Projects\MyProject\test.py");
			compiler.Sources = new ITaskItem[] {sourceFile};
			
			mockCompiler.ThrowExceptionAtCompile = new PythonCompilerException("Missing main file.");
			
			success = compiler.Execute();
		}
示例#4
0
        public void Init()
        {
            mockCompiler            = new MockPythonCompiler();
            compiler                = new DummyPythonCompilerTask(mockCompiler, @"C:\Projects\MyProject");
            compiler.TargetType     = "Exe";
            compiler.OutputAssembly = "test.exe";

            TaskItem sourceFile = new TaskItem(@"D:\Projects\MyProject\test.py");

            compiler.Sources = new ITaskItem[] { sourceFile };

            mockCompiler.ThrowExceptionAtCompile = new PythonCompilerException("Missing main file.");

            success = compiler.Execute();
        }
		public void Init()
		{
			mockCompiler = new MockPythonCompiler();
			compiler = new DummyPythonCompilerTask(mockCompiler, @"C:\Projects\MyProject");
			compiler.TargetType = "Exe";
			compiler.OutputAssembly = "test.exe";
			
			TaskItem sourceFile = new TaskItem(@"D:\Projects\MyProject\test.py");
			compiler.Sources = new ITaskItem[] {sourceFile};
			
			SourceUnit source = DefaultContext.DefaultPythonContext.CreateSourceUnit(NullTextContentProvider.Null, @"test", SourceCodeKind.InteractiveCode);
			
			SyntaxErrorException ex = new SyntaxErrorException("Error", null, SourceSpan.None, 1000, Severity.FatalError);
			mockCompiler.ThrowExceptionAtCompile = ex;
			
			success = compiler.Execute();
		}
        public void Init()
        {
            mockCompiler            = new MockPythonCompiler();
            compiler                = new DummyPythonCompilerTask(mockCompiler, @"C:\Projects\MyProject");
            compiler.TargetType     = "Exe";
            compiler.OutputAssembly = "test.exe";

            TaskItem sourceFile = new TaskItem(@"D:\Projects\MyProject\test.py");

            compiler.Sources = new ITaskItem[] { sourceFile };

            SourceUnit source = DefaultContext.DefaultPythonContext.CreateSourceUnit(NullTextContentProvider.Null, @"test", SourceCodeKind.InteractiveCode);

            SyntaxErrorException ex = new SyntaxErrorException("Error", null, SourceSpan.None, 1000, Severity.FatalError);

            mockCompiler.ThrowExceptionAtCompile = ex;

            success = compiler.Execute();
        }