Exemple #1
0
        public TestVm(string testPath, int id, ITestTreeNode parent)
            : base(parent, testPath)
        {
            _testFolder = parent as TestFolderVm;
            TestPath    = testPath;
            TestSuite   = _testFolder == null ? (TestSuiteVm)parent : _testFolder.TestSuite;

            if (_testFolder != null)
            {
                Statistics     = null;
                FileStatistics = new FileStatistics(
                    _testFolder.ParsingStatistics.ReplaceSingleSubtask(Name),
                    _testFolder.ParseTreeStatistics.ReplaceSingleSubtask(Name),
                    _testFolder.AstStatistics.ReplaceSingleSubtask(Name),
                    _testFolder.DependPropsStatistics);
                _file = new TestFile(this, TestSuite.Language, id, _testFolder.Project, FileStatistics);
            }
            else
            {
                Statistics     = new StatisticsTask.Container("Total");
                FileStatistics = new FileStatistics(
                    Statistics.ReplaceSingleSubtask("Parsing"),
                    Statistics.ReplaceSingleSubtask("ParseTree"),
                    Statistics.ReplaceSingleSubtask("Ast", "AST Creation"),
                    Statistics.ReplaceContainerSubtask("DependProps", "Dependent properties"));
                var solution = new FsSolution <IAst>();
                var project  = new FsProject <IAst>(solution, Path.GetDirectoryName(testPath), TestSuite.Libs);
                _file = new TestFile(this, TestSuite.Language, id, project, FileStatistics);
            }

            if (TestSuite.TestState == TestState.Ignored)
            {
                TestState = TestState.Ignored;
            }
        }
Exemple #2
0
    //public ObservableCollection<IAst>   CompilationUnits  { get; private set; }

    public TestFolderVm(string testPath, TestSuiteVm testSuite)
      : base(testSuite, testPath)
    {
      var solution = new FsSolution<IAst>();
      this.Project = new FsProject<IAst>(solution, testPath, testSuite.Libs.Select(
        lib =>
        {
          var file = lib as FileLibReference;
          if (file == null || Path.IsPathRooted(file.Path))
            return lib;

          return new FileLibReference(Path.Combine(@"..", file.Path));
        }));

      Statistics            = new StatisticsTask.Container("Total");
      ParsingStatistics     = Statistics.ReplaceContainerSubtask("Parsing");
      ParseTreeStatistics   = Statistics.ReplaceContainerSubtask("ParseTree");
      AstStatistics         = Statistics.ReplaceContainerSubtask("Ast", "AST Creation");
      DependPropsStatistics = Statistics.ReplaceContainerSubtask("DependProps", "Dependent properties");

      TestPath = testPath;
      TestSuite = testSuite;
      if (TestSuite.TestState == TestState.Ignored)
        TestState = TestState.Ignored;

      string testSuitePath = base.FullPath;
      var tests = new ObservableCollection<TestVm>();

      var paths = Directory.GetFiles(testSuitePath, "*.test");
      foreach (var path in paths.OrderBy(f => f))
        tests.Add(new TestVm(path, this));

      Tests = tests;
    }
Exemple #3
0
        //public ObservableCollection<IAst>   CompilationUnits  { get; private set; }

        public TestFolderVm(string testPath, TestSuiteVm testSuite)
            : base(testSuite, testPath)
        {
            var solution = new FsSolution <IAst>();

            this.Project = new FsProject <IAst>(solution, testPath, testSuite.Libs.Select(
                                                    lib =>
            {
                var file = lib as FileLibReference;
                if (file == null || Path.IsPathRooted(file.Path))
                {
                    return(lib);
                }

                return(new FileLibReference(Path.Combine(@"..", file.Path)));
            }));

            Statistics            = new StatisticsTask.Container("Total");
            ParsingStatistics     = Statistics.ReplaceContainerSubtask("Parsing");
            ParseTreeStatistics   = Statistics.ReplaceContainerSubtask("ParseTree");
            AstStatistics         = Statistics.ReplaceContainerSubtask("Ast", "AST Creation");
            DependPropsStatistics = Statistics.ReplaceContainerSubtask("DependProps", "Dependent properties");

            TestPath  = testPath;
            TestSuite = testSuite;
            if (TestSuite.TestState == TestState.Ignored)
            {
                TestState = TestState.Ignored;
            }

            string testSuitePath = base.FullPath;
            var    tests         = new ObservableCollection <TestVm>();

            var paths = Directory.GetFiles(testSuitePath, "*.test");
            var id    = 0;

            foreach (var path in paths.OrderBy(f => f))
            {
                tests.Add(new TestVm(path, id, this));
                id++;
            }

            Tests = tests;
        }