Exemplo n.º 1
0
 def ListTests(self, context):
     tests = []
     for subtest in FuzzerTestSuite.SUB_TESTS:
         shell = 'v8_simple_%s_fuzzer' % subtest
         for fname in os.listdir(os.path.join(self.root, subtest)):
             if not os.path.isfile(os.path.join(self.root, subtest, fname)):
                 continue
             test = testcase.TestCase(self,
                                      '%s/%s' % (subtest, fname),
                                      override_shell=shell)
             tests.append(test)
     tests.sort()
     return tests
Exemplo n.º 2
0
 def ListTests(self, context):
     tests = []
     for dirname, dirs, files in os.walk(self.root):
         for dotted in [x for x in dirs if x.startswith('.')]:
             dirs.remove(dotted)
         dirs.sort()
         files.sort()
         for filename in files:
             if filename.endswith(".js"):
                 testname = join(dirname[len(self.root) + 1:],
                                 filename[:-3])
                 test = testcase.TestCase(self, testname)
                 tests.append(test)
     return tests
Exemplo n.º 3
0
 def ListTests(self, context):
     tests = []
     for dirname, dirs, files in os.walk(self.root):
         for dotted in [x for x in dirs if x.startswith('.')]:
             dirs.remove(dotted)
         dirs.sort()
         files.sort()
         for filename in files:
             if filename.endswith(".js"):
                 fullpath = os.path.join(dirname, filename)
                 relpath = fullpath[len(self.root) + 1:-3]
                 testname = relpath.replace(os.path.sep, "/")
                 test = testcase.TestCase(self, testname)
                 tests.append(test)
     return tests
Exemplo n.º 4
0
 def ListTests(self, context):
   tests = []
   for dirname, dirs, files in os.walk(self.testroot):
     for dotted in [x for x in dirs if x.startswith(".")]:
       dirs.remove(dotted)
     if context.noi18n and "intl402" in dirs:
       dirs.remove("intl402")
     dirs.sort()
     files.sort()
     for filename in files:
       if filename.endswith(".js"):
         testname = os.path.join(dirname[len(self.testroot) + 1:],
                                 filename[:-3])
         case = testcase.TestCase(self, testname)
         tests.append(case)
   return tests
Exemplo n.º 5
0
 def ListTests(self, context):
     shell = os.path.abspath(os.path.join(context.shell_dir, self.shell()))
     if utils.IsWindows():
         shell += ".exe"
     output = commands.Execute(context.command_prefix + [shell, "--list"] +
                               context.extra_flags)
     if output.exit_code != 0:
         print output.stdout
         print output.stderr
         return []
     tests = []
     for test_desc in output.stdout.strip().split():
         test = testcase.TestCase(self, test_desc)
         tests.append(test)
     tests.sort()
     return tests
Exemplo n.º 6
0
 def ListTests(self, context):
   tests = []
   for dirname, dirs, files in os.walk(self.testroot):
     for dotted in [x for x in dirs if x.startswith(".")]:
       dirs.remove(dotted)
     if context.noi18n and "intl402" in dirs:
       dirs.remove("intl402")
     dirs.sort()
     files.sort()
     for filename in files:
       if filename.endswith(".js") and not filename.endswith("_FIXTURE.js"):
         fullpath = os.path.join(dirname, filename)
         relpath = fullpath[len(self.testroot) + 1 : -3]
         testname = relpath.replace(os.path.sep, "/")
         case = testcase.TestCase(self, testname)
         tests.append(case)
   return tests
Exemplo n.º 7
0
 def ListTests(self, context):
   tests = []
   for dirname, dirs, files in os.walk(os.path.join(self.root), followlinks=True):
     for dotted in [x for x in dirs if x.startswith('.')]:
       dirs.remove(dotted)
     if dirname.endswith(os.path.sep + RESOURCES_FOLDER):
       continue
     dirs.sort()
     files.sort()
     for filename in files:
       if filename.endswith(".js") and filename != PROTOCOL_TEST_JS:
         fullpath = os.path.join(dirname, filename)
         relpath = fullpath[len(self.root) + 1 : -3]
         testname = relpath.replace(os.path.sep, "/")
         test = testcase.TestCase(self, testname)
         tests.append(test)
   return tests
Exemplo n.º 8
0
 def ListTests(self, context):
     shell = os.path.abspath(os.path.join(context.shell_dir, self.SHELL))
     if utils.IsWindows():
         shell += ".exe"
     cmd = command.Command(cmd_prefix=context.command_prefix,
                           shell=shell,
                           args=["--list"] + context.extra_flags)
     output = cmd.execute()
     if output.exit_code != 0:
         print cmd
         print output.stdout
         print output.stderr
         return []
     tests = []
     for test_desc in output.stdout.strip().split():
         test = testcase.TestCase(self, test_desc)
         tests.append(test)
     tests.sort(key=lambda t: t.path)
     return tests
Exemplo n.º 9
0
 def ListTests(self, context):
   tests = []
   for testdir in TEST_DIRS:
     current_root = os.path.join(self.testroot, testdir)
     for dirname, dirs, files in os.walk(current_root):
       for dotted in [x for x in dirs if x.startswith(".")]:
         dirs.remove(dotted)
       for excluded in EXCLUDED:
         if excluded in dirs:
           dirs.remove(excluded)
       dirs.sort()
       files.sort()
       for filename in files:
         if filename.endswith(".js") and not filename in FRAMEWORK:
           testname = os.path.join(dirname[len(self.testroot) + 1:],
                                   filename[:-3])
           case = testcase.TestCase(self, testname)
           tests.append(case)
   return tests
Exemplo n.º 10
0
 def ListTests(self, context):
   tests = []
   testnames = set()
   for dirname, dirs, files in itertools.chain(os.walk(self.testroot),
                                               os.walk(self.localtestroot)):
     for dotted in [x for x in dirs if x.startswith(".")]:
       dirs.remove(dotted)
     if context.noi18n and "intl402" in dirs:
       dirs.remove("intl402")
     dirs.sort()
     files.sort()
     for filename in files:
       if not filename.endswith(".js"):
         continue
       if filename.endswith("_FIXTURE.js"):
         continue
       fullpath = os.path.join(dirname, filename)
       relpath = re.match(TEST_262_RELPATH_REGEXP, fullpath).group(1)
       testnames.add(relpath.replace(os.path.sep, "/"))
   return [testcase.TestCase(self, testname) for testname in testnames]
Exemplo n.º 11
0
 def ListTests(self, context):
     shell = join(context.shell_dir, self.shell())
     if utils.IsWindows():
         shell += '.exe'
     output = commands.Execute([shell, '--list'])
     if output.exit_code != 0:
         print output.stdout
         print output.stderr
         return []
     tests = []
     for test_desc in output.stdout.strip().split():
         raw_test, dependency = test_desc.split('<')
         if dependency != '':
             dependency = raw_test.split('/')[0] + '/' + dependency
         else:
             dependency = None
         test = testcase.TestCase(self, raw_test, dependency=dependency)
         tests.append(test)
     tests.sort()
     return tests
Exemplo n.º 12
0
  def ListTests(self, context):
    expectations = self._GetExpectations()
    result = []

    # Find all .js files in this directory.
    filenames = [f[:-3] for f in os.listdir(self.root) if f.endswith(".js")]
    filenames.sort()
    for f in filenames:
      throws = expectations.get(f, None)
      flags = [f + ".js"]
      if throws:
        flags += ["throws", throws]
      test = testcase.TestCase(self, f, flags=flags)
      result.append(test)

    # Find all .pyt files in this directory.
    filenames = [f[:-4] for f in os.listdir(self.root) if f.endswith(".pyt")]
    filenames.sort()
    for f in filenames:
      self._ParsePythonTestTemplates(result, f)
    return result
Exemplo n.º 13
0
 def ListTests(self, context):
     shell = os.path.abspath(os.path.join(context.shell_dir, self.shell()))
     if utils.IsWindows():
         shell += ".exe"
     output = commands.Execute(context.command_prefix + [shell, "--list"] +
                               context.extra_flags)
     if output.exit_code != 0:
         print output.stdout
         print output.stderr
         return []
     tests = []
     for test_desc in output.stdout.strip().split():
         raw_test, dependency = test_desc.split('<')
         if dependency != '':
             dependency = raw_test.split('/')[0] + '/' + dependency
         else:
             dependency = None
         test = testcase.TestCase(self, raw_test, dependency=dependency)
         tests.append(test)
     tests.sort()
     return tests
Exemplo n.º 14
0
 def ListTests(self, context):
   shell = os.path.abspath(os.path.join(context.shell_dir, self.shell()))
   if utils.IsWindows():
     shell += ".exe"
   output = commands.Execute(
       context.command_prefix +
       [shell, "--allow-natives-syntax", "-e",
        "try { var natives = %ListNatives();"
        "  for (var n in natives) { print(natives[n]); }"
        "} catch(e) {}"] +
       context.extra_flags)
   if output.exit_code != 0:
     print output.stdout
     print output.stderr
     assert false, "Failed to get natives list."
   tests = []
   for line in output.stdout.strip().split():
     (name, argc) = line.split(",")
     flags = ["--allow-natives-syntax",
              "-e", "var NAME = '%s', ARGC = %s;" % (name, argc)]
     test = testcase.TestCase(self, name, flags)
     tests.append(test)
   return tests
Exemplo n.º 15
0
Arquivo: testcfg.py Projeto: YYKLIT/v8
    def ListTests(self, context):
        shell = os.path.abspath(
            os.path.join(context.shell_dir, self.GetShellForTestCase(None)))
        if utils.IsWindows():
            shell += ".exe"

        output = None
        for i in xrange(3):  # Try 3 times in case of errors.
            cmd = command.Command(cmd_prefix=context.command_prefix,
                                  shell=shell,
                                  args=['--gtest_list_tests'] +
                                  context.extra_flags)
            output = cmd.execute()
            if output.exit_code == 0:
                break
            print "Test executable failed to list the tests (try %d).\n\nCmd:" % i
            print cmd
            print "\nStdout:"
            print output.stdout
            print "\nStderr:"
            print output.stderr
            print "\nExit code: %d" % output.exit_code
        else:
            raise Exception("Test executable failed to list the tests.")

        tests = []
        test_case = ''
        for line in output.stdout.splitlines():
            test_desc = line.strip().split()[0]
            if test_desc.endswith('.'):
                test_case = test_desc
            elif test_case and test_desc:
                test = testcase.TestCase(self, test_case + test_desc)
                tests.append(test)
        tests.sort(key=lambda t: t.path)
        return tests
Exemplo n.º 16
0
 def ListTests(self, context):
   return [testcase.TestCase(self, fname[:-len('.js')]) for fname in
           os.listdir(os.path.join(self.root, TEST_NAME, 'lib', 'tests'))
           if fname.endswith('.js')]
Exemplo n.º 17
0
 def ListTests(self, context):
     test = testcase.TestCase(self, self.SHELL)
     return [test]
Exemplo n.º 18
0
 def create_test(path):
     return testcase.TestCase(self, path)
Exemplo n.º 19
0
  def ListTests(self, context):
    tests = []
    for test in [
        "kraken/ai-astar",
        "kraken/audio-beat-detection",
        "kraken/audio-dft",
        "kraken/audio-fft",
        "kraken/audio-oscillator",
        "kraken/imaging-darkroom",
        "kraken/imaging-desaturate",
        "kraken/imaging-gaussian-blur",
        "kraken/json-parse-financial",
        "kraken/json-stringify-tinderbox",
        "kraken/stanford-crypto-aes",
        "kraken/stanford-crypto-ccm",
        "kraken/stanford-crypto-pbkdf2",
        "kraken/stanford-crypto-sha256-iterative",

        "octane/box2d",
        "octane/code-load",
        "octane/crypto",
        "octane/deltablue",
        "octane/earley-boyer",
        "octane/gbemu-part1",
        "octane/mandreel",
        "octane/navier-stokes",
        "octane/pdfjs",
        "octane/raytrace",
        "octane/regexp",
        "octane/richards",
        "octane/splay",
        "octane/typescript",
        "octane/zlib",

        "sunspider/3d-cube",
        "sunspider/3d-morph",
        "sunspider/3d-raytrace",
        "sunspider/access-binary-trees",
        "sunspider/access-fannkuch",
        "sunspider/access-nbody",
        "sunspider/access-nsieve",
        "sunspider/bitops-3bit-bits-in-byte",
        "sunspider/bitops-bits-in-byte",
        "sunspider/bitops-bitwise-and",
        "sunspider/bitops-nsieve-bits",
        "sunspider/controlflow-recursive",
        "sunspider/crypto-aes",
        "sunspider/crypto-md5",
        "sunspider/crypto-sha1",
        "sunspider/date-format-tofte",
        "sunspider/date-format-xparb",
        "sunspider/math-cordic",
        "sunspider/math-partial-sums",
        "sunspider/math-spectral-norm",
        "sunspider/regexp-dna",
        "sunspider/string-base64",
        "sunspider/string-fasta",
        "sunspider/string-tagcloud",
        "sunspider/string-unpack-code",
        "sunspider/string-validate-input"]:
      tests.append(testcase.TestCase(self, test))
    return tests
Exemplo n.º 20
0
 def ListTests(self, context):
   test = testcase.TestCase(self, self.shell())
   return [test]