示例#1
0
    def main(self):
        current_scm = detect_scm_system(os.path.dirname(os.path.abspath(__file__)))
        os.chdir(os.path.join(current_scm.checkout_root, 'Source'))

        all_tests_passed = True

        base_directory = os.path.join('JavaScriptCore', 'inspector', 'scripts', 'tests')

        platform_directories = {
            'macos': 'mac',
            'ios': 'ios',
            'generic': 'generic',
            'all': 'all',
        }

        for platform_name, platform_directory in platform_directories.iteritems():
            input_directory = os.path.join(base_directory, platform_directory)
            reference_directory = os.path.join(input_directory, 'expected')
            if not os.path.isdir(input_directory) or not os.path.isdir(reference_directory):
                continue

            all_tests_passed = all_tests_passed and self.run_tests(platform_name, input_directory, reference_directory)

        print ''
        if all_tests_passed:
            print 'All tests PASS!'
            return 0
        else:
            print 'Some tests FAIL! (To update the reference files, execute "run-inspector-generator-tests --reset-results")'
            return -1
示例#2
0
    def main(self):
        current_scm = detect_scm_system(
            os.path.dirname(os.path.abspath(__file__)))
        os.chdir(os.path.join(current_scm.checkout_root, 'Source'))

        all_tests_passed = True

        base_directory = os.path.join('JavaScriptCore', 'inspector', 'scripts',
                                      'tests')

        platform_directories = {
            'macos': 'mac',
            'ios': 'ios',
            'generic': 'generic',
            'all': 'all',
        }

        for platform_name, platform_directory in platform_directories.iteritems(
        ):
            input_directory = os.path.join(base_directory, platform_directory)
            reference_directory = os.path.join(input_directory, 'expected')
            if not os.path.isdir(input_directory) or not os.path.isdir(
                    reference_directory):
                continue

            all_tests_passed = all_tests_passed and self.run_tests(
                platform_name, input_directory, reference_directory)

        print ''
        if all_tests_passed:
            print 'All tests PASS!'
            return 0
        else:
            print 'Some tests FAIL! (To update the reference files, execute "run-inspector-generator-tests --reset-results")'
            return -1
示例#3
0
    def main(self):
        current_scm = detect_scm_system(os.curdir)
        os.chdir(os.path.join(current_scm.checkout_root, 'Source'))

        all_tests_passed = True

        input_directory = os.path.join('bindings', 'tests', 'idls')
        supplemental_dependency_file = tempfile.mkstemp()[1]
        if self.generate_supplemental_dependency(input_directory, supplemental_dependency_file):
            print 'Failed to generate a supplemental dependency file.'
            os.remove(supplemental_dependency_file)
            return -1

        input_directory = os.path.join('bindings', 'tests', 'idls')
        reference_directory = os.path.join('bindings', 'tests', 'results')
        if not self.run_tests(input_directory, reference_directory, supplemental_dependency_file):
            all_tests_passed = False

        os.remove(supplemental_dependency_file)
        print ''
        if all_tests_passed:
            print 'All tests PASS!'
            return 0
        else:
            print 'Some tests FAIL! (To update the reference files, execute "run-bindings-tests --reset-results")'
            return -1
    def _set_up_git_checkouts(self):
        """Sets up fresh git repository with one commit. Then sets up a second git repo that tracks the first one."""

        self.untracking_checkout_path = self._mkdtemp(suffix="git_test_checkout2")
        self._run(["git", "init", self.untracking_checkout_path])

        self._chdir(self.untracking_checkout_path)
        self._write_text_file("foo_file", "foo")
        self._run(["git", "add", "foo_file"])
        self._run(["git", "commit", "-am", "dummy commit"])
        self.untracking_scm = detect_scm_system(self.untracking_checkout_path)

        self.tracking_git_checkout_path = self._mkdtemp(suffix="git_test_checkout")
        self._run(["git", "clone", "--quiet", self.untracking_checkout_path, self.tracking_git_checkout_path])
        self._chdir(self.tracking_git_checkout_path)
        self.tracking_scm = detect_scm_system(self.tracking_git_checkout_path)
示例#5
0
    def main(self):
        current_scm = detect_scm_system(os.curdir)
        os.chdir(os.path.join(current_scm.checkout_root, 'Source'))

        all_tests_passed = True

        input_directory = os.path.join('WebCore', 'bindings', 'scripts', 'test')
        supplemental_dependency_file = tempfile.mkstemp()[1]
        if self.generate_supplemental_dependency(input_directory, supplemental_dependency_file):
            print 'Failed to generate a supplemental dependency file.'
            os.remove(supplemental_dependency_file)
            return -1

        for generator in self.generators:
            input_directory = os.path.join('WebCore', 'bindings', 'scripts', 'test')
            reference_directory = os.path.join('WebCore', 'bindings', 'scripts', 'test', generator)
            if not self.run_tests(generator, input_directory, reference_directory, supplemental_dependency_file):
                all_tests_passed = False

        os.remove(supplemental_dependency_file)
        print ''
        if all_tests_passed:
            print 'All tests PASS!'
            return 0
        else:
            print 'Some tests FAIL! (To update the reference files, execute "run-bindings-tests --reset-results")'
            return -1
示例#6
0
文件: main.py 项目: eocanha/webkit
    def main(self):
        current_scm = detect_scm_system(
            os.path.dirname(os.path.abspath(__file__)))
        os.chdir(os.path.join(current_scm.checkout_root, 'Source'))

        all_tests_passed = True

        base_directory = os.path.join('JavaScriptCore', 'inspector', 'scripts',
                                      'tests')
        input_directory = base_directory
        reference_directory = os.path.join(input_directory, 'expected')
        if os.path.isdir(input_directory) and os.path.isdir(
                reference_directory):
            all_tests_passed = self.run_tests(input_directory,
                                              reference_directory)

        print('')
        if all_tests_passed:
            print('All tests PASS!')
            return 0
        else:
            print(
                'Some tests FAIL! (To update the reference files, execute "run-inspector-generator-tests --reset-results")'
            )
            return -1
示例#7
0
文件: main.py 项目: shsiccac/webkit
    def main(self):
        current_scm = detect_scm_system(os.curdir)
        os.chdir(os.path.join(current_scm.checkout_root, 'Source'))

        all_tests_passed = True

        input_directory = os.path.join('WebCore', 'bindings', 'scripts',
                                       'test')
        supplemental_dependency_file = tempfile.mkstemp()
        window_constructors_file = tempfile.mkstemp()
        workerglobalscope_constructors_file = tempfile.mkstemp()
        dedicatedworkerglobalscope_constructors_file = tempfile.mkstemp()
        serviceworkerglobalscope_constructors_file = tempfile.mkstemp()
        if self.generate_supplemental_dependency(
                input_directory, supplemental_dependency_file[1],
                window_constructors_file[1],
                workerglobalscope_constructors_file[1],
                dedicatedworkerglobalscope_constructors_file[1],
                serviceworkerglobalscope_constructors_file[1]):
            print('Failed to generate a supplemental dependency file.')
            self.close_and_remove(supplemental_dependency_file)
            self.close_and_remove(window_constructors_file)
            self.close_and_remove(workerglobalscope_constructors_file)
            self.close_and_remove(dedicatedworkerglobalscope_constructors_file)
            self.close_and_remove(serviceworkerglobalscope_constructors_file)
            return -1

        for generator in self.generators:
            input_directory = os.path.join('WebCore', 'bindings', 'scripts',
                                           'test')
            reference_directory = os.path.join('WebCore', 'bindings',
                                               'scripts', 'test', generator)
            if not self.run_tests(generator, input_directory,
                                  reference_directory,
                                  supplemental_dependency_file[1]):
                all_tests_passed = False

        self.close_and_remove(supplemental_dependency_file)
        self.close_and_remove(window_constructors_file)
        self.close_and_remove(workerglobalscope_constructors_file)
        self.close_and_remove(dedicatedworkerglobalscope_constructors_file)
        self.close_and_remove(serviceworkerglobalscope_constructors_file)

        if self.json_file_name:
            json_data = {
                'failures': self.failures,
            }

            with open(self.json_file_name, 'w') as json_file:
                json.dump(json_data, json_file)

        print('')
        if all_tests_passed:
            print('All tests PASS!')
            return 0
        else:
            print(
                'Some tests FAIL! (To update the reference files, execute "run-bindings-tests --reset-results")'
            )
            return -1
示例#8
0
    def _set_up_git_checkouts(self):
        """Sets up fresh git repository with one commit. Then sets up a second git repo that tracks the first one."""

        self.untracking_checkout_path = self._mkdtemp(suffix="git_test_checkout2")
        self._run(['git', 'init', self.untracking_checkout_path])

        self._chdir(self.untracking_checkout_path)
        self._write_text_file('foo_file', 'foo')
        self._run(['git', 'add', 'foo_file'])
        self._run(['git', 'commit', '-am', 'dummy commit'])
        self.untracking_scm = detect_scm_system(self.untracking_checkout_path)

        self.tracking_git_checkout_path = self._mkdtemp(suffix="git_test_checkout")
        self._run(['git', 'clone', '--quiet', self.untracking_checkout_path, self.tracking_git_checkout_path])
        self._chdir(self.tracking_git_checkout_path)
        self.tracking_scm = detect_scm_system(self.tracking_git_checkout_path)
示例#9
0
    def _set_up_git_checkouts(self):
        """Sets up fresh git repository with one commit. Then sets up a second git repo that tracks the first one."""

        self.untracking_checkout_path = self._mkdtemp(suffix="git_test_checkout2")
        self._run(['git', 'init', self.untracking_checkout_path])

        self._chdir(self.untracking_checkout_path)
        self._write_text_file('foo_file', 'foo')
        self._run(['git', 'add', 'foo_file'])
        self._run(['git', 'commit', '-am', 'dummy commit'])
        self.untracking_scm = detect_scm_system(self.untracking_checkout_path)

        self.tracking_git_checkout_path = self._mkdtemp(suffix="git_test_checkout")
        self._run(['git', 'clone', '--quiet', self.untracking_checkout_path, self.tracking_git_checkout_path])
        self._chdir(self.tracking_git_checkout_path)
        self.tracking_scm = detect_scm_system(self.tracking_git_checkout_path)
示例#10
0
    def main(self):
        current_scm = detect_scm_system(os.curdir)
        os.chdir(os.path.join(current_scm.checkout_root, 'Source'))

        all_tests_passed = self.run_tests()
        if all_tests_passed:
            if self.verbose:
                print
                print PASS_MESSAGE
            return 0
        print
        print FAIL_MESSAGE
        return -1
示例#11
0
    def main(self):
        current_scm = detect_scm_system(os.curdir)
        os.chdir(os.path.join(current_scm.checkout_root, 'Source'))

        all_tests_passed = self.run_tests()
        if all_tests_passed:
            if self.verbose:
                print
                print PASS_MESSAGE
            return 0
        print
        print FAIL_MESSAGE
        return -1
示例#12
0
    def main(self):
        current_scm = detect_scm_system(os.curdir)
        os.chdir(os.path.join(current_scm.checkout_root, "Source"))

        if self.generate_interface_dependencies():
            print "Failed to generate interface dependencies file."
            return -1

        all_tests_passed = self.run_tests()
        print
        if all_tests_passed:
            print "All tests PASS!"
            return 0
        print 'Some tests FAIL! (To update the reference files, execute "run-bindings-tests --reset-results")'
        return -1
示例#13
0
    def main(self):
        current_scm = detect_scm_system(os.curdir)
        os.chdir(os.path.join(current_scm.checkout_root, 'Source'))

        all_tests_passed = True

        input_directory = os.path.join('WebCore', 'bindings', 'scripts',
                                       'test')
        supplemental_dependency_file = tempfile.mkstemp()[1]
        window_constructors_file = tempfile.mkstemp()[1]
        workerglobalscope_constructors_file = tempfile.mkstemp()[1]
        sharedworkerglobalscope_constructors_file = tempfile.mkstemp()[1]
        dedicatedworkerglobalscope_constructors_file = tempfile.mkstemp()[1]
        if self.generate_supplemental_dependency(
                input_directory, supplemental_dependency_file,
                window_constructors_file, workerglobalscope_constructors_file,
                sharedworkerglobalscope_constructors_file,
                dedicatedworkerglobalscope_constructors_file):
            print 'Failed to generate a supplemental dependency file.'
            os.remove(supplemental_dependency_file)
            os.remove(window_constructors_file)
            os.remove(workerglobalscope_constructors_file)
            os.remove(sharedworkerglobalscope_constructors_file)
            os.remove(dedicatedworkerglobalscope_constructors_file)
            return -1

        for generator in self.generators:
            input_directory = os.path.join('WebCore', 'bindings', 'scripts',
                                           'test')
            reference_directory = os.path.join('WebCore', 'bindings',
                                               'scripts', 'test', generator)
            if not self.run_tests(generator, input_directory,
                                  reference_directory,
                                  supplemental_dependency_file):
                all_tests_passed = False

        os.remove(supplemental_dependency_file)
        os.remove(window_constructors_file)
        os.remove(workerglobalscope_constructors_file)
        os.remove(sharedworkerglobalscope_constructors_file)
        os.remove(dedicatedworkerglobalscope_constructors_file)
        print ''
        if all_tests_passed:
            print 'All tests PASS!'
            return 0
        else:
            print 'Some tests FAIL! (To update the reference files, execute "run-bindings-tests --reset-results")'
            return -1
示例#14
0
    def main(self):
        current_scm = detect_scm_system(os.curdir)
        os.chdir(os.path.join(current_scm.checkout_root, 'Source'))

        if self.generate_interface_dependencies():
            print 'Failed to generate interface dependencies file.'
            return -1

        all_tests_passed = self.run_tests()
        if all_tests_passed:
            if self.verbose:
                print
                print PASS_MESSAGE
            return 0
        print
        print FAIL_MESSAGE
        return -1
示例#15
0
    def main(self):
        current_scm = detect_scm_system(os.path.dirname(os.path.abspath(__file__)))
        os.chdir(os.path.join(current_scm.checkout_root, "Source"))

        all_tests_passed = True

        input_directory = os.path.join("JavaScriptCore", "replay", "scripts", "tests")
        reference_directory = os.path.join("JavaScriptCore", "replay", "scripts", "tests", "expected")
        if not self.run_tests(input_directory, reference_directory):
            all_tests_passed = False

        print ""
        if all_tests_passed:
            print "All tests PASS!"
            return 0
        else:
            print 'Some tests FAIL! (To update the reference files, execute "run-input-generator-tests --reset-results")'
            return -1
示例#16
0
    def main(self):
        current_scm = detect_scm_system(os.curdir)
        os.chdir(os.path.join(current_scm.checkout_root, 'Source'))

        all_tests_passed = True

        input_directory = os.path.join('JavaScriptCore', 'Scripts', 'tests', 'builtins')
        reference_directory = os.path.join('JavaScriptCore', 'Scripts', 'tests', 'builtins', 'expected')
        if not self.run_tests(input_directory, reference_directory):
            all_tests_passed = False

        print ''
        if all_tests_passed:
            print 'All tests PASS!'
            return 0
        else:
            print 'Some tests FAIL! (To update the reference files, execute "run-builtins-generator-tests --reset-results")'
            return -1
示例#17
0
文件: main.py 项目: adteven/webkit
    def main(self):
        current_scm = detect_scm_system(os.path.dirname(__file__))
        os.chdir(os.path.join(current_scm.checkout_root, 'Source'))

        all_tests_passed = True

        work_directory = tempfile.mkdtemp()
        input_directory = os.path.join('WebCore', 'bindings', 'scripts', 'test')
        supplemental_dependency_file = os.path.join(work_directory, 'supplemental_dependency.tmp')
        window_constructors_file = os.path.join(work_directory, 'DOMWindowConstructors.idl')
        workerglobalscope_constructors_file = os.path.join(work_directory, 'WorkerGlobalScopeConstructors.idl')
        dedicatedworkerglobalscope_constructors_file = os.path.join(work_directory, 'DedicatedWorkerGlobalScopeConstructors.idl')
        serviceworkerglobalscope_constructors_file = os.path.join(work_directory, 'ServiceWorkerGlobalScopeConstructors.idl')
        workletglobalscope_constructors_file = os.path.join(work_directory, 'WorkletGlobalScopeConstructors.idl')
        paintworkletglobalscope_constructors_file = os.path.join(work_directory, 'PaintWorkletGlobalScopeConstructors.idl')
        testglobalscope_constructors_file = os.path.join(work_directory, 'BindingTestGlobalConstructors.idl')
        if self.generate_supplemental_dependency(input_directory, supplemental_dependency_file, window_constructors_file, workerglobalscope_constructors_file, dedicatedworkerglobalscope_constructors_file, serviceworkerglobalscope_constructors_file, workletglobalscope_constructors_file, paintworkletglobalscope_constructors_file, testglobalscope_constructors_file):
            print('Failed to generate a supplemental dependency file.')
            shutil.rmtree(work_directory)
            return -1

        for generator in self.generators:
            input_directory = os.path.join('WebCore', 'bindings', 'scripts', 'test')
            reference_directory = os.path.join('WebCore', 'bindings', 'scripts', 'test', generator)
            if not self.run_tests(generator, input_directory, reference_directory, supplemental_dependency_file):
                all_tests_passed = False

        shutil.rmtree(work_directory)

        if self.json_file_name:
            json_data = {
                'failures': self.failures,
            }

            with open(self.json_file_name, 'w') as json_file:
                json.dump(json_data, json_file)

        print('')
        if all_tests_passed:
            print('All tests PASS!')
            return 0
        else:
            print('Some tests FAIL! (To update the reference files, execute "run-bindings-tests --reset-results")')
            return -1
示例#18
0
    def main(self):
        current_scm = detect_scm_system(os.curdir)
        os.chdir(os.path.join(current_scm.checkout_root, 'Source'))

        all_tests_passed = True

        input_directory = os.path.join('JavaScriptCore', 'replay', 'scripts',
                                       'tests')
        reference_directory = os.path.join('JavaScriptCore', 'replay',
                                           'scripts', 'tests', 'expected')
        if not self.run_tests(input_directory, reference_directory):
            all_tests_passed = False

        print ''
        if all_tests_passed:
            print 'All tests PASS!'
            return 0
        else:
            print 'Some tests FAIL! (To update the reference files, execute "run-input-generator-tests --reset-results")'
            return -1
示例#19
0
    def main(self):
        current_scm = detect_scm_system(os.curdir)
        os.chdir(os.path.join(current_scm.checkout_root, 'Source'))

        all_tests_passed = True

        provider = ScopedTempFileProvider()

        input_directory = os.path.join('bindings', 'tests', 'idls')
        reference_directory = os.path.join('bindings', 'tests', 'results')

        interface_dependencies_file = provider.newtempfile()
        window_constructors_file = provider.newtempfile()
        workerglobalscope_constructors_file = provider.newtempfile()
        sharedworkerglobalscope_constructors_file = provider.newtempfile()
        dedicatedworkerglobalscope_constructors_file = provider.newtempfile()

        if self.reset_results:
            event_names_file = os.path.join(reference_directory, 'EventInterfaces.in')
        else:
            event_names_file = provider.newtempfile()

        if self.generate_interface_dependencies(input_directory, interface_dependencies_file, window_constructors_file, workerglobalscope_constructors_file, sharedworkerglobalscope_constructors_file, dedicatedworkerglobalscope_constructors_file, event_names_file):
            print 'Failed to generate interface dependencies file.'
            return -1

        if not self.run_tests(input_directory, reference_directory, interface_dependencies_file, event_names_file):
            all_tests_passed = False

        print ''
        if all_tests_passed:
            print 'All tests PASS!'
            return 0
        else:
            print 'Some tests FAIL! (To update the reference files, execute "run-bindings-tests --reset-results")'
            return -1
示例#20
0
 def test_detect_scm_system_relative_url(self):
     scm = detect_scm_system(".")
     # I wanted to assert that we got the right path, but there was some
     # crazy magic with temp folder names that I couldn't figure out.
     self.assertTrue(scm.checkout_root)
示例#21
0
 def setUp(self):
     super(GitSVNTest, self).setUp()
     self._set_up_svn_checkout()
     self._set_up_gitsvn_checkout()
     self.scm = detect_scm_system(self.git_checkout_path)
     self.scm.svn_server_realm = None
 def setUp(self):
     super(GitSVNTest, self).setUp()
     self._set_up_svn_checkout()
     self._set_up_gitsvn_checkout()
     self.scm = detect_scm_system(self.git_checkout_path)
     self.scm.svn_server_realm = None
 def test_detect_scm_system_relative_url(self):
     scm = detect_scm_system(".")
     # I wanted to assert that we got the right path, but there was some
     # crazy magic with temp folder names that I couldn't figure out.
     self.assertTrue(scm.checkout_root)