Exemple #1
0
 public TestViewModel(string name, TestData testData, ProblemViewModel problem)
 {
     _testData = testData;
     _problem = problem;
     Name = name;
     State = new StateViewModel();
     State.PropertyChanged += State_PropertyChanged;
 }
 public Future<string> Compile(ProblemViewModel problem)
 {
     return _processLauncher.Launch(_cscPath, null, "/out:{1} \"{0}\" /r:System.Numerics.dll",
                                    problem.ProblemPath, problem.CompilerExecutablePath)
         .Transform(processExecuteResult =>
             {
                 if (processExecuteResult.ExitCode == 0) return (string) null;
                 return processExecuteResult.Output;
             });
 }
Exemple #3
0
 public Future<string> Compile(ProblemViewModel problem)
 {
     return _processLauncher.Launch(_compilerPath, null, _parameters,
                                    problem.ProblemPath, problem.CompilerExecutablePath)
         .Transform(processExecuteResult =>
             {
                 if (processExecuteResult.ExitCode == 0) return (string) null;
                 return processExecuteResult.Error;
             });
 }
 public ICompilerService GetCompiler(ProblemViewModel problem)
 {
     var extension = Path.GetExtension(problem.ProblemPath);
     return _compilers[extension];
 }
Exemple #5
0
 private void UpdateTests()
 {
     if (string.IsNullOrEmpty(PathProperty.Value)) return;
     FileChangesTracker.Instance.Track(PathProperty.Value);
     Problems.Clear();
     var files =
         IoHelper.IsFile(PathProperty.Value) ? new[] {PathProperty.Value}
             : Directory.GetFiles(PathProperty.Value).Where(f => !f.EndsWith(".txt"));
     foreach (var file in files)
     {
         if (!_compilerSelector.ExtensionSupported(Path.GetExtension(file))) continue;
         var problem = new ProblemViewModel(this, file)
             {
                 Name = Path.GetFileNameWithoutExtension(file),
             };
         Problems.Add(problem);
     }
 }