Exemplo n.º 1
0
 def test_downloader(self):
     if not self._test_downloader:
         download_options = TestDownloader.default_options()
         download_options.fetch = self.options.fetch
         download_options.verbose = self.options.verbose
         download_options.import_all = self.options.import_all
         self._test_downloader = TestDownloader(self.tests_download_path,
                                                self.host, download_options)
     return self._test_downloader
Exemplo n.º 2
0
 def test_downloader(self):
     if not self._test_downloader:
         download_options = TestDownloader.default_options()
         download_options.fetch = self.options.fetch
         download_options.verbose = self.options.verbose
         download_options.import_all = self.options.import_all
         self._test_downloader = TestDownloader(self.tests_download_path, self.host, download_options)
     return self._test_downloader
Exemplo n.º 3
0
 def __init__(self, repository_directory, host, options):
     TestDownloader.__init__(self, repository_directory, host,
                             options)
Exemplo n.º 4
0
 def __init__(self, repository_directory, host, options):
     TestDownloader.__init__(self, repository_directory, host, options)
Exemplo n.º 5
0
def parse_args(args):
    parser = argparse.ArgumentParser(
        prog='import-w3c-tests [w3c_test_source_directory]')

    parser.add_argument(
        '-n',
        '--no-overwrite',
        dest='overwrite',
        action='store_false',
        default=True,
        help=
        'Flag to prevent duplicate test files from overwriting existing tests. By default, they will be overwritten'
    )
    parser.add_argument(
        '-l',
        '--no-links-conversion',
        dest='convert_test_harness_links',
        action='store_false',
        default=True,
        help=
        'Do not change links (testharness js or css e.g.). This option only applies when providing a source directory, in which case by default, links are converted to point to WebKit testharness files. When tests are downloaded from W3C repository, links are converted for CSS tests and remain unchanged for WPT tests'
    )

    parser.add_argument(
        '-a',
        '--all',
        action='store_true',
        default=False,
        help=
        'Import all tests including reftests, JS tests, and manual/pixel tests. By default, only reftests and JS tests are imported'
    )
    fs = FileSystem()
    parser.add_argument(
        '-d',
        '--dest-dir',
        dest='destination',
        default=fs.join('imported', 'w3c'),
        help=
        'Import into a specified directory relative to the LayoutTests root. By default, imports into imported/w3c'
    )

    list_of_repositories = ' or '.join([
        test_repository['name']
        for test_repository in TestDownloader.load_test_repositories()
    ])
    parser.add_argument(
        '-t',
        '--test-path',
        action='append',
        dest='test_paths',
        default=[],
        help=
        'Import only tests in the supplied subdirectory of the source directory. Can be supplied multiple times to give multiple paths. For tests directly cloned from W3C repositories, use '
        + list_of_repositories + ' prefixes to filter specific tests')

    parser.add_argument('-v',
                        '--verbose',
                        action='store_true',
                        default=False,
                        help='Print maximal log')
    parser.add_argument(
        '--no-fetch',
        action='store_false',
        dest='fetch',
        default=True,
        help=
        'Do not fetch the repositories. By default, repositories are fetched if a source directory is not provided'
    )
    parser.add_argument(
        '--import-all',
        action='store_true',
        default=False,
        help=
        'Ignore the ImportExpectations file. All tests will be imported. This option only applies when tests are downloaded from W3C repository'
    )

    parser.add_argument(
        '--clean-dest-dir',
        action='store_true',
        dest='clean_destination_directory',
        default=False,
        help=
        'Clean destination directory. All files in the destination directory will be deleted except for WebKit specific files (test expectations, .gitignore...) before new tests import. Dangling test expectations (expectation file that is no longer related to a test) are removed after tests import.'
    )

    options, args = parser.parse_known_args(args)
    if len(args) > 1:
        parser.error('Incorrect number of arguments')
    return options, args
Exemplo n.º 6
0
def parse_args(args):
    parser = argparse.ArgumentParser(prog='import-w3c-tests [w3c_test_source_directory]')

    parser.add_argument('-n', '--no-overwrite', dest='overwrite', action='store_false', default=True,
        help='Flag to prevent duplicate test files from overwriting existing tests. By default, they will be overwritten')
    parser.add_argument('-l', '--no-links-conversion', dest='convert_test_harness_links', action='store_false', default=True,
       help='Do not change links (testharness js or css e.g.). This option only applies when providing a source directory, in which case by default, links are converted to point to WebKit testharness files. When tests are downloaded from W3C repository, links are converted for CSS tests and remain unchanged for WPT tests')

    parser.add_argument('-a', '--all', action='store_true', default=False,
        help='Import all tests including reftests, JS tests, and manual/pixel tests. By default, only reftests and JS tests are imported')
    fs = FileSystem()
    parser.add_argument('-d', '--dest-dir', dest='destination', default=fs.join('imported', 'w3c'),
        help='Import into a specified directory relative to the LayoutTests root. By default, imports into imported/w3c')

    list_of_repositories = ' or '.join([test_repository['name'] for test_repository in TestDownloader.load_test_repositories()])
    parser.add_argument('-t', '--test-path', action='append', dest='test_paths', default=[],
         help='Import only tests in the supplied subdirectory of the source directory. Can be supplied multiple times to give multiple paths. For tests directly cloned from W3C repositories, use ' + list_of_repositories + ' prefixes to filter specific tests')

    parser.add_argument('-v', '--verbose', action='store_true', default=False,
         help='Print maximal log')
    parser.add_argument('--no-fetch', action='store_false', dest='fetch', default=True,
         help='Do not fetch the repositories. By default, repositories are fetched if a source directory is not provided')
    parser.add_argument('--import-all', action='store_true', default=False,
         help='Ignore the ImportExpectations file. All tests will be imported. This option only applies when tests are downloaded from W3C repository')

    parser.add_argument('--clean-dest-dir', action='store_true', dest='clean_destination_directory', default=False,
         help='Clean destination directory. All files in the destination directory will be deleted except for WebKit specific files (test expectations, .gitignore...) before new tests import. Dangling test expectations (expectation file that is no longer related to a test) are removed after tests import.')

    options, args = parser.parse_known_args(args)
    if len(args) > 1:
        parser.error('Incorrect number of arguments')
    return options, args
Exemplo n.º 7
0
def parse_args(args):
    parser = argparse.ArgumentParser(prog="import-w3c-tests [w3c_test_source_directory]")

    parser.add_argument(
        "-n",
        "--no-overwrite",
        dest="overwrite",
        action="store_false",
        default=True,
        help="Flag to prevent duplicate test files from overwriting existing tests. By default, they will be overwritten",
    )
    parser.add_argument(
        "-l",
        "--no-links-conversion",
        dest="convert_test_harness_links",
        action="store_false",
        default=True,
        help="Do not change links (testharness js or css e.g.). This option only applies when providing a source directory, in which case by default, links are converted to point to WebKit testharness files. When tests are downloaded from W3C repository, links are converted for CSS tests and remain unchanged for WPT tests",
    )

    parser.add_argument(
        "-a",
        "--all",
        action="store_true",
        default=False,
        help="Import all tests including reftests, JS tests, and manual/pixel tests. By default, only reftests and JS tests are imported",
    )
    fs = FileSystem()
    parser.add_argument(
        "-d",
        "--dest-dir",
        dest="destination",
        default=fs.join("imported", "w3c"),
        help="Import into a specified directory relative to the LayoutTests root. By default, imports into imported/w3c",
    )

    list_of_repositories = " or ".join(
        [test_repository["name"] for test_repository in TestDownloader.load_test_repositories()]
    )
    parser.add_argument(
        "-t",
        "--test-path",
        action="append",
        dest="test_paths",
        default=[],
        help="Import only tests in the supplied subdirectory of the source directory. Can be supplied multiple times to give multiple paths. For tests directly cloned from W3C repositories, use "
        + list_of_repositories
        + " prefixes to filter specific tests",
    )

    parser.add_argument("-v", "--verbose", action="store_true", default=False, help="Print maximal log")
    parser.add_argument(
        "--no-fetch",
        action="store_false",
        dest="fetch",
        default=True,
        help="Do not fetch the repositories. By default, repositories are fetched if a source directory is not provided",
    )
    parser.add_argument(
        "--import-all",
        action="store_true",
        default=False,
        help="Ignore the ImportExpectations file. All tests will be imported. This option only applies when tests are downloaded from W3C repository",
    )

    parser.add_argument(
        "--clean-dest-dir",
        action="store_true",
        dest="clean_destination_directory",
        default=False,
        help="Clean destination directory. All files in the destination directory will be deleted except for WebKit specific files (test expectations, .gitignore...) before new tests import. Dangling test expectations (expectation file that is no longer related to a test) are removed after tests import.",
    )

    options, args = parser.parse_known_args(args)
    if len(args) > 1:
        parser.error("Incorrect number of arguments")
    return options, args