Beispiel #1
0
        protected override IEnumerable <TestInfo> GetTests()
        {
            var testDir  = Path.Combine("Src", "StdLib", "Lib", "test");
            var fullPath = Path.Combine(CaseExecuter.FindRoot(), testDir);

            return(STDTESTS.Select(test => new TestInfo(Path.GetFullPath(Path.Combine(fullPath, test) + ".py"), category, testDir, this.manifest)));
        }
Beispiel #2
0
        protected override IEnumerable <TestInfo> GetTests()
        {
            string stdlib = Path.Combine(CaseExecuter.FindRoot(), "Src", "StdLib", "Lib", "ctypes", "test");

            return(Directory.GetFiles(stdlib, "test_*.py", SearchOption.AllDirectories)
                   .Select(file => new TestInfo(Path.GetFullPath(file), this.manifest))
                   .OrderBy(testcase => testcase.Name));
        }
Beispiel #3
0
        protected override IEnumerable <TestInfo> GetTests()
        {
            string stdlib = Path.Combine(CaseExecuter.FindRoot(), "Src", "StdLib", "Lib", "test");

            return(Directory.GetFiles(stdlib, "test_*.py", SearchOption.AllDirectories)
                   .Where(file => !StandardCPythonCaseGenerator.STDTESTS.Contains(Path.GetFileNameWithoutExtension(file)))
                   .Select(file => new TestInfo(Path.GetFullPath(file), this.manifest))
                   .OrderBy(testcase => testcase.Name));
        }
Beispiel #4
0
        protected override IEnumerable <TestInfo> GetTests()
        {
            var testDir  = Path.Combine("Src", "StdLib", "Lib", "ctypes", "test");
            var fullPath = Path.Combine(CaseExecuter.FindRoot(), testDir);

            return(Directory.EnumerateFiles(fullPath, "test_*.py", SearchOption.AllDirectories)
                   .Select(file => new TestInfo(Path.GetFullPath(file), category, testDir, this.manifest))
                   .OrderBy(testcase => testcase.Name));
        }
Beispiel #5
0
        private static string GetName(string path, string baseName, string rootDir)
        {
            var root = CaseExecuter.FindRoot();
            var dir  = System.IO.Path.GetDirectoryName(path).Replace(root, string.Empty).Replace(rootDir, string.Empty).Replace('\\', '.').Replace('/', '.').TrimStart('.');

            if (string.IsNullOrWhiteSpace(dir))
            {
                return($"{baseName}.{System.IO.Path.GetFileNameWithoutExtension(path)}");
            }
            return($"{baseName}.{dir}.{System.IO.Path.GetFileNameWithoutExtension(path)}");
        }
Beispiel #6
0
        protected override IEnumerable <TestInfo> GetTests()
        {
            var root = CaseExecuter.FindRoot();

            return(GetFilenames()
                   .Select(file => new TestInfo(Path.GetFullPath(file), category, "Tests", this.manifest))
                   .OrderBy(testcase => testcase.Name));

            IEnumerable <string> GetFilenames()
            {
                foreach (var filename in Directory.EnumerateFiles(Path.Combine(root, "Tests"), "test_*.py", SearchOption.AllDirectories))
                {
                    yield return(filename);
                }

                yield return(Path.Combine(root, "Src", "Scripts", "test_cgcheck.py"));
            }
        }
Beispiel #7
0
        protected override IEnumerable <TestInfo> GetTests()
        {
            return(GetFilenames(new[] {
                System.Tuple.Create(category, Path.Combine("Tests")),
                System.Tuple.Create($"{category}.scripts", Path.Combine("Src", "Scripts")),
            })
                   .OrderBy(testcase => testcase.Name));

            IEnumerable <TestInfo> GetFilenames(IEnumerable <System.Tuple <string, string> > folders)
            {
                foreach (var tuple in folders)
                {
                    var fullPath = Path.Combine(CaseExecuter.FindRoot(), tuple.Item2);
                    foreach (var filename in Directory.EnumerateFiles(fullPath, "test_*.py", SearchOption.AllDirectories))
                    {
                        yield return(new TestInfo(Path.GetFullPath(filename), tuple.Item1, tuple.Item2, manifest));
                    }
                }
            }
        }
Beispiel #8
0
 public void FixtureSetUp()
 {
     this.executor = new CaseExecuter();
 }
Beispiel #9
0
        protected override IEnumerable <TestInfo> GetTests()
        {
            string stdlib = Path.Combine(CaseExecuter.FindRoot(), "Src", "StdLib", "Lib", "test");

            return(STDTESTS.Select(test => new TestInfo(Path.GetFullPath(Path.Combine(stdlib, test) + ".py"), this.manifest)));
        }
Beispiel #10
0
 protected override IEnumerable <TestInfo> GetTests()
 {
     return(Directory.EnumerateFiles(Path.Combine(CaseExecuter.FindRoot(), "Tests"), "test_*.py", SearchOption.AllDirectories)
            .Select(file => new TestInfo(Path.GetFullPath(file), this.manifest))
            .OrderBy(testcase => testcase.Name));
 }