Пример #1
0
        public static Collection <FileInfo> RemoveNonReproducibleErrors(Collection <FileInfo> partitionedTests)
        {
            Collection <FileInfo> reproducibleTests = new Collection <FileInfo>();

            foreach (FileInfo test in partitionedTests)
            {
                TestCase testCase = new TestCase(test);

                // Don't attempt to reproduce non-error-revealing tests (to save time).
                if (!IsErrorRevealing(testCase))
                {
                    reproducibleTests.Add(test);
                    continue;
                }

                TestCase.RunResults runResults = testCase.RunExternal();
                if (runResults.behaviorReproduced)
                {
                    reproducibleTests.Add(test);
                }
                else
                {
                    if (!runResults.compilationSuccessful)
                    {
                        //Logger.Debug("@@@COMPILATIONFAILED:");
                        //foreach (CompilerError err in runResults.compilerErrors)
                        //    Logger.Debug("@@@" + err);
                    }
                    test.Delete();
                }
            }
            return(reproducibleTests);
        }
Пример #2
0
        public static int Minimize(FileInfo testPath)
        {
            TestCase testFile = new TestCase(testPath);

            testFile.WriteToFile(testPath + ".nonmin");

            int linesRemoved = 0;

            //            Logger.Debug(testFile);

            for (int linePos = testFile.NumTestLines - 1; linePos >= 0; linePos--)
            {
                string oldLine = testFile.RemoveLine(linePos);

                if (!testFile.RunExternal().behaviorReproduced)
                {
                    testFile.AddLine(linePos, oldLine);
                }
                else
                {
                    linesRemoved++;
                }
            }

            testFile.WriteToFile(testPath);
            return(linesRemoved);
        }
Пример #3
0
 private static bool Reproduce(FileInfo oneTest)
 {
     TestCase test = new TestCase(oneTest);
     TestCase.RunResults results = test.RunExternal();
     if (results.behaviorReproduced)
         return true;
     return false;
 }
Пример #4
0
        private static bool Reproduce(FileInfo oneTest)
        {
            TestCase test = new TestCase(oneTest);

            TestCase.RunResults results = test.RunExternal();
            if (results.behaviorReproduced)
            {
                return(true);
            }
            return(false);
        }
Пример #5
0
        public static int Minimize(FileInfo testPath)
        {
            TestCase testFile = new TestCase(testPath);

            testFile.WriteToFile(testPath + ".nonmin", false);

            int linesRemoved = 0;

            //            Console.WriteLine(testFile);

            for (int linePos = testFile.NumTestLines - 1; linePos >= 0; linePos--)
            {
                string oldLine = testFile.RemoveLine(linePos);

                if (!testFile.RunExternal().behaviorReproduced)
                {
                    testFile.AddLine(linePos, oldLine);
                }
                else
                {
                    linesRemoved++;
                }
            }

            testFile.WriteToFile(testPath, false);
            return linesRemoved;
        }
Пример #6
0
        public static Collection<FileInfo> RemoveNonReproducibleErrors(Collection<FileInfo> partitionedTests)
        {
            Collection<FileInfo> reproducibleTests = new Collection<FileInfo>();
            foreach (FileInfo test in partitionedTests)
            {
                TestCase testCase = new TestCase(test);

                // Don't attempt to reproduce non-error-revealing tests (to save time).
                if (!IsErrorRevealing(testCase))
                {
                    reproducibleTests.Add(test);
                    continue;
                }

                TestCase.RunResults runResults = testCase.RunExternal();
                if (runResults.behaviorReproduced)
                    reproducibleTests.Add(test);
                else
                {
                    if (!runResults.compilationSuccessful)
                    {
                        //Console.WriteLine("@@@COMPILATIONFAILED:");
                        //foreach (CompilerError err in runResults.compilerErrors)
                        //    Console.WriteLine("@@@" + err);
                    }
                    test.Delete();
                }
            }
            return reproducibleTests;
        }