From 18a64400617259b34ccf014682fd8022d551a036 Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Fri, 28 Jun 2019 06:43:32 -0400 Subject: meson: remove tap-driver.py, use meson's TAP protocol This includes a patch from Andrew to fix pactest's TAP output for subtests. Original TAP support in meson was added in 0.50, but 0.51 contains a bugfix that ensures the test still work with the --verbose flag passed to meson test, so let's depend on that. --- build-aux/tap-driver.py | 296 --------------------- test/pacman/meson.build | 675 +++++++++++++++++++++++------------------------ test/pacman/tap.py | 3 +- test/scripts/meson.build | 3 +- 4 files changed, 335 insertions(+), 642 deletions(-) delete mode 100644 build-aux/tap-driver.py diff --git a/build-aux/tap-driver.py b/build-aux/tap-driver.py deleted file mode 100644 index c231caec..00000000 --- a/build-aux/tap-driver.py +++ /dev/null @@ -1,296 +0,0 @@ -#!/usr/bin/env python3 -# Adapted from tappy copyright (c) 2016, Matt Layman -# MIT license -# https://github.com/python-tap/tappy - -import io -import re -import subprocess -import sys - - -class Directive(object): - """A representation of a result line directive.""" - - skip_pattern = re.compile( - r"""^SKIP\S* - (?P\s*) # Optional whitespace. - (?P.*) # Slurp up the rest.""", - re.IGNORECASE | re.VERBOSE) - todo_pattern = re.compile( - r"""^TODO\b # The directive name - (?P\s*) # Immediately following must be whitespace. - (?P.*) # Slurp up the rest.""", - re.IGNORECASE | re.VERBOSE) - - def __init__(self, text): - """Initialize the directive by parsing the text. - The text is assumed to be everything after a '#\s*' on a result line. - """ - self._text = text - self._skip = False - self._todo = False - self._reason = None - - match = self.skip_pattern.match(text) - if match: - self._skip = True - self._reason = match.group('reason') - - match = self.todo_pattern.match(text) - if match: - if match.group('whitespace'): - self._todo = True - else: - # Catch the case where the directive has no descriptive text. - if match.group('reason') == '': - self._todo = True - self._reason = match.group('reason') - - @property - def text(self): - """Get the entire text.""" - return self._text - - @property - def skip(self): - """Check if the directive is a SKIP type.""" - return self._skip - - @property - def todo(self): - """Check if the directive is a TODO type.""" - return self._todo - - @property - def reason(self): - """Get the reason for the directive.""" - return self._reason - - -class Parser(object): - """A parser for TAP files and lines.""" - - # ok and not ok share most of the same characteristics. - result_base = r""" - \s* # Optional whitespace. - (?P\d*) # Optional test number. - \s* # Optional whitespace. - (?P[^#]*) # Optional description before #. - \#? # Optional directive marker. - \s* # Optional whitespace. - (?P.*) # Optional directive text. - """ - ok = re.compile(r'^ok' + result_base, re.VERBOSE) - not_ok = re.compile(r'^not\ ok' + result_base, re.VERBOSE) - plan = re.compile(r""" - ^1..(?P\d+) # Match the plan details. - [^#]* # Consume any non-hash character to confirm only - # directives appear with the plan details. - \#? # Optional directive marker. - \s* # Optional whitespace. - (?P.*) # Optional directive text. - """, re.VERBOSE) - diagnostic = re.compile(r'^#') - bail = re.compile(r""" - ^Bail\ out! - \s* # Optional whitespace. - (?P.*) # Optional reason. - """, re.VERBOSE) - version = re.compile(r'^TAP version (?P\d+)$') - - TAP_MINIMUM_DECLARED_VERSION = 13 - - def parse(self, fh): - """Generate tap.line.Line objects, given a file-like object `fh`. - `fh` may be any object that implements both the iterator and - context management protocol (i.e. it can be used in both a - "with" statement and a "for...in" statement.) - Trailing whitespace and newline characters will be automatically - stripped from the input lines. - """ - with fh: - for line in fh: - yield self.parse_line(line.rstrip()) - - def parse_line(self, text): - """Parse a line into whatever TAP category it belongs.""" - match = self.ok.match(text) - if match: - return self._parse_result(True, match) - - match = self.not_ok.match(text) - if match: - return self._parse_result(False, match) - - if self.diagnostic.match(text): - return ('diagnostic', text) - - match = self.plan.match(text) - if match: - return self._parse_plan(match) - - match = self.bail.match(text) - if match: - return ('bail', match.group('reason')) - - match = self.version.match(text) - if match: - return self._parse_version(match) - - return ('unknown',) - - def _parse_plan(self, match): - """Parse a matching plan line.""" - expected_tests = int(match.group('expected')) - directive = Directive(match.group('directive')) - - # Only SKIP directives are allowed in the plan. - if directive.text and not directive.skip: - return ('unknown',) - - return ('plan', expected_tests, directive) - - def _parse_result(self, ok, match): - """Parse a matching result line into a result instance.""" - return ('result', ok, match.group('number'), - match.group('description').strip(), - Directive(match.group('directive'))) - - def _parse_version(self, match): - version = int(match.group('version')) - if version < self.TAP_MINIMUM_DECLARED_VERSION: - raise ValueError('It is an error to explicitly specify ' - 'any version lower than 13.') - return ('version', version) - - -class Rules(object): - - def __init__(self): - self._lines_seen = {'plan': [], 'test': 0, 'failed': 0, 'version': []} - self._errors = [] - - def check(self, final_line_count): - """Check the status of all provided data and update the suite.""" - if self._lines_seen['version']: - self._process_version_lines() - self._process_plan_lines(final_line_count) - - def check_errors(self): - if self._lines_seen['failed'] > 0: - self._add_error('Tests failed.') - if self._errors: - for error in self._errors: - print(error) - return 1 - return 0 - - def _process_version_lines(self): - """Process version line rules.""" - if len(self._lines_seen['version']) > 1: - self._add_error('Multiple version lines appeared.') - elif self._lines_seen['version'][0] != 1: - self._add_error('The version must be on the first line.') - - def _process_plan_lines(self, final_line_count): - """Process plan line rules.""" - if not self._lines_seen['plan']: - self._add_error('Missing a plan.') - return - - if len(self._lines_seen['plan']) > 1: - self._add_error('Only one plan line is permitted per file.') - return - - expected_tests, at_line = self._lines_seen['plan'][0] - if not self._plan_on_valid_line(at_line, final_line_count): - self._add_error( - 'A plan must appear at the beginning or end of the file.') - return - - if expected_tests != self._lines_seen['test']: - self._add_error( - 'Expected {expected_count} tests ' - 'but only {seen_count} ran.'.format( - expected_count=expected_tests, - seen_count=self._lines_seen['test'])) - - def _plan_on_valid_line(self, at_line, final_line_count): - """Check if a plan is on a valid line.""" - # Put the common cases first. - if at_line == 1 or at_line == final_line_count: - return True - - # The plan may only appear on line 2 if the version is at line 1. - after_version = ( - self._lines_seen['version'] and - self._lines_seen['version'][0] == 1 and - at_line == 2) - if after_version: - return True - - return False - - def handle_bail(self, reason): - """Handle a bail line.""" - self._add_error('Bailed: {reason}').format(reason=reason) - - def handle_skipping_plan(self): - """Handle a plan that contains a SKIP directive.""" - sys.exit(77) - - def saw_plan(self, expected_tests, at_line): - """Record when a plan line was seen.""" - self._lines_seen['plan'].append((expected_tests, at_line)) - - def saw_test(self, ok): - """Record when a test line was seen.""" - self._lines_seen['test'] += 1 - if not ok: - self._lines_seen['failed'] += 1 - - def saw_version_at(self, line_counter): - """Record when a version line was seen.""" - self._lines_seen['version'].append(line_counter) - - def _add_error(self, message): - self._errors += [message] - - -if __name__ == '__main__': - parser = Parser() - rules = Rules() - - try: - out = subprocess.check_output(sys.argv[1:], universal_newlines=True) - except subprocess.CalledProcessError as e: - sys.stdout.write(e.output) - raise e - - line_generator = parser.parse(io.StringIO(out)) - line_counter = 0 - for line in line_generator: - line_counter += 1 - - if line[0] == 'unknown': - continue - - if line[0] == 'result': - rules.saw_test(line[1]) - print('{okay} {num} {description} {directive}'.format( - okay=('' if line[1] else 'not ') + 'ok', num=line[2], - description=line[3], directive=line[4].text)) - elif line[0] == 'plan': - if line[2].skip: - rules.handle_skipping_plan() - rules.saw_plan(line[1], line_counter) - elif line[0] == 'bail': - rules.handle_bail(line[1]) - elif line[0] == 'version': - rules.saw_version_at(line_counter) - elif line[0] == 'diagnostic': - print(line[1]) - - rules.check(line_counter) - sys.exit(rules.check_errors()) diff --git a/test/pacman/meson.build b/test/pacman/meson.build index 5edbbd43..4e87b4f3 100644 --- a/test/pacman/meson.build +++ b/test/pacman/meson.build @@ -1,349 +1,338 @@ pacman_tests = [ - { 'name': 'tests/backup001.py' }, - { 'name': 'tests/clean001.py' }, - { 'name': 'tests/clean002.py' }, - { 'name': 'tests/clean003.py' }, - { 'name': 'tests/clean004.py' }, - { 'name': 'tests/clean005.py' }, - { 'name': 'tests/config001.py' }, - { 'name': 'tests/config002.py' }, - { 'name': 'tests/database001.py' }, - { 'name': 'tests/database002.py' }, - { 'name': 'tests/database010.py' }, - { 'name': 'tests/database011.py' }, - { 'name': 'tests/database012.py' }, - { 'name': 'tests/dbonly-extracted-files.py' }, - { 'name': 'tests/depconflict100.py' }, - { 'name': 'tests/depconflict110.py' }, - { 'name': 'tests/depconflict111.py' }, - { 'name': 'tests/depconflict120.py' }, - { 'name': 'tests/dependency-cycle-fixed-by-upgrade.py' }, - { 'name': 'tests/deprange001.py', - 'should_fail': true }, - { 'name': 'tests/deptest001.py' }, - { 'name': 'tests/dummy001.py' }, - { 'name': 'tests/epoch001.py' }, - { 'name': 'tests/epoch002.py' }, - { 'name': 'tests/epoch003.py' }, - { 'name': 'tests/epoch004.py' }, - { 'name': 'tests/epoch005.py' }, - { 'name': 'tests/epoch010.py' }, - { 'name': 'tests/epoch011.py' }, - { 'name': 'tests/epoch012.py' }, - { 'name': 'tests/file-conflict-with-installed-pkg.py' }, - { 'name': 'tests/fileconflict001.py' }, - { 'name': 'tests/fileconflict002.py' }, - { 'name': 'tests/fileconflict003.py' }, - { 'name': 'tests/fileconflict004.py' }, - { 'name': 'tests/fileconflict005.py' }, - { 'name': 'tests/fileconflict006.py' }, - { 'name': 'tests/fileconflict007.py' }, - { 'name': 'tests/fileconflict008.py' }, - { 'name': 'tests/fileconflict009.py' }, - { 'name': 'tests/fileconflict010.py' }, - { 'name': 'tests/fileconflict011.py' }, - { 'name': 'tests/fileconflict012.py' }, - { 'name': 'tests/fileconflict013.py' }, - { 'name': 'tests/fileconflict015.py' }, - { 'name': 'tests/fileconflict016.py' }, - { 'name': 'tests/fileconflict017.py' }, - { 'name': 'tests/fileconflict020.py' }, - { 'name': 'tests/fileconflict021.py' }, - { 'name': 'tests/fileconflict022.py' }, - { 'name': 'tests/fileconflict023.py' }, - { 'name': 'tests/fileconflict024.py' }, - { 'name': 'tests/fileconflict025.py' }, - { 'name': 'tests/fileconflict030.py' }, - { 'name': 'tests/fileconflict031.py' }, - { 'name': 'tests/fileconflict032.py' }, - { 'name': 'tests/hook-abortonfail.py' }, - { 'name': 'tests/hook-description-reused.py' }, - { 'name': 'tests/hook-exec-reused.py' }, - { 'name': 'tests/hook-exec-with-arguments.py' }, - { 'name': 'tests/hook-file-change-packages.py' }, - { 'name': 'tests/hook-file-remove-trigger-match.py' }, - { 'name': 'tests/hook-file-upgrade-nomatch.py' }, - { 'name': 'tests/hook-invalid-trigger.py' }, - { 'name': 'tests/hook-pkg-install-trigger-match.py' }, - { 'name': 'tests/hook-pkg-postinstall-trigger-match.py' }, - { 'name': 'tests/hook-pkg-remove-trigger-match.py' }, - { 'name': 'tests/hook-pkg-upgrade-trigger-match.py' }, - { 'name': 'tests/hook-target-list.py' }, - { 'name': 'tests/hook-type-reused.py' }, - { 'name': 'tests/hook-upgrade-trigger-no-match.py' }, - { 'name': 'tests/hook-when-reused.py' }, - { 'name': 'tests/ignore001.py' }, - { 'name': 'tests/ignore002.py' }, - { 'name': 'tests/ignore003.py' }, - { 'name': 'tests/ignore004.py' }, - { 'name': 'tests/ignore005.py' }, - { 'name': 'tests/ignore006.py' }, - { 'name': 'tests/ignore007.py' }, - { 'name': 'tests/ignore008.py' }, - { 'name': 'tests/ldconfig001.py' }, - { 'name': 'tests/ldconfig002.py' }, - { 'name': 'tests/ldconfig003.py' }, - { 'name': 'tests/mode001.py' }, - { 'name': 'tests/mode002.py' }, - { 'name': 'tests/mode003.py' }, - { 'name': 'tests/noupgrade-inverted.py' }, - { 'name': 'tests/overwrite-files-match-negated.py' }, - { 'name': 'tests/overwrite-files-match.py' }, - { 'name': 'tests/overwrite-files-nonmatch.py' }, - { 'name': 'tests/pacman001.py' }, - { 'name': 'tests/pacman002.py' }, - { 'name': 'tests/pacman003.py' }, - { 'name': 'tests/pacman004.py' }, - { 'name': 'tests/pacman005.py' }, - { 'name': 'tests/provision001.py' }, - { 'name': 'tests/provision002.py' }, - { 'name': 'tests/provision003.py' }, - { 'name': 'tests/provision004.py' }, - { 'name': 'tests/provision010.py' }, - { 'name': 'tests/provision011.py' }, - { 'name': 'tests/provision012.py' }, - { 'name': 'tests/provision020.py' }, - { 'name': 'tests/provision021.py' }, - { 'name': 'tests/provision022.py' }, - { 'name': 'tests/query001.py' }, - { 'name': 'tests/query002.py' }, - { 'name': 'tests/query003.py' }, - { 'name': 'tests/query004.py' }, - { 'name': 'tests/query005.py' }, - { 'name': 'tests/query006.py', - # expect failure on 32 bit machines - 'should_fail': cc.sizeof('ssize_t') < 8 }, - { 'name': 'tests/query007.py' }, - { 'name': 'tests/query010.py' }, - { 'name': 'tests/query011.py' }, - { 'name': 'tests/query012.py' }, - { 'name': 'tests/querycheck001.py' }, - { 'name': 'tests/querycheck002.py' }, - { 'name': 'tests/querycheck_fast_file_type.py' }, - { 'name': 'tests/reason001.py' }, - { 'name': 'tests/remove-assumeinstalled.py' }, - { 'name': 'tests/remove-directory-replaced-with-symlink.py' }, - { 'name': 'tests/remove-optdepend-of-installed-package.py' }, - { 'name': 'tests/remove-recursive-cycle.py' }, - { 'name': 'tests/remove001.py' }, - { 'name': 'tests/remove002.py' }, - { 'name': 'tests/remove010.py' }, - { 'name': 'tests/remove011.py' }, - { 'name': 'tests/remove012.py' }, - { 'name': 'tests/remove020.py' }, - { 'name': 'tests/remove021.py' }, - { 'name': 'tests/remove030.py' }, - { 'name': 'tests/remove031.py' }, - { 'name': 'tests/remove040.py' }, - { 'name': 'tests/remove041.py' }, - { 'name': 'tests/remove042.py' }, - { 'name': 'tests/remove043.py' }, - { 'name': 'tests/remove044.py' }, - { 'name': 'tests/remove045.py' }, - { 'name': 'tests/remove047.py' }, - { 'name': 'tests/remove049.py' }, - { 'name': 'tests/remove050.py' }, - { 'name': 'tests/remove051.py' }, - { 'name': 'tests/remove052.py' }, - { 'name': 'tests/remove060.py' }, - { 'name': 'tests/remove070.py' }, - { 'name': 'tests/remove071.py' }, - { 'name': 'tests/replace-and-upgrade-package.py' }, - { 'name': 'tests/replace100.py' }, - { 'name': 'tests/replace101.py' }, - { 'name': 'tests/replace102.py' }, - { 'name': 'tests/replace103.py' }, - { 'name': 'tests/replace104.py' }, - { 'name': 'tests/replace110.py', - 'should_fail': true }, - { 'name': 'tests/scriptlet001.py' }, - { 'name': 'tests/scriptlet002.py' }, - { 'name': 'tests/scriptlet-signal-handling.py' }, - { 'name': 'tests/scriptlet-signal-reset.py' }, - { 'name': 'tests/sign001.py' }, - { 'name': 'tests/sign002.py' }, - { 'name': 'tests/skip-remove-with-glob-chars.py' }, - { 'name': 'tests/smoke001.py' }, - { 'name': 'tests/smoke002.py' }, - { 'name': 'tests/smoke003.py' }, - { 'name': 'tests/smoke004.py' }, - { 'name': 'tests/symlink-replace-with-dir.py' }, - { 'name': 'tests/symlink001.py' }, - { 'name': 'tests/symlink002.py' }, - { 'name': 'tests/symlink010.py' }, - { 'name': 'tests/symlink011.py' }, - { 'name': 'tests/symlink012.py' }, - { 'name': 'tests/symlink020.py' }, - { 'name': 'tests/symlink021.py' }, - { 'name': 'tests/sync-install-assumeinstalled.py' }, - { 'name': 'tests/sync-nodepversion01.py' }, - { 'name': 'tests/sync-nodepversion02.py' }, - { 'name': 'tests/sync-nodepversion03.py' }, - { 'name': 'tests/sync-nodepversion04.py' }, - { 'name': 'tests/sync-nodepversion05.py' }, - { 'name': 'tests/sync-nodepversion06.py' }, - { 'name': 'tests/sync-sysupgrade-print-replaced-packages.py' }, - { 'name': 'tests/sync-update-assumeinstalled.py' }, - { 'name': 'tests/sync-update-package-removing-required-provides.py', - 'should_fail': true }, - { 'name': 'tests/sync001.py' }, - { 'name': 'tests/sync002.py' }, - { 'name': 'tests/sync003.py' }, - { 'name': 'tests/sync009.py' }, - { 'name': 'tests/sync010.py' }, - { 'name': 'tests/sync011.py' }, - { 'name': 'tests/sync012.py' }, - { 'name': 'tests/sync020.py' }, - { 'name': 'tests/sync021.py' }, - { 'name': 'tests/sync022.py' }, - { 'name': 'tests/sync023.py' }, - { 'name': 'tests/sync024.py' }, - { 'name': 'tests/sync030.py' }, - { 'name': 'tests/sync031.py' }, - { 'name': 'tests/sync040.py' }, - { 'name': 'tests/sync041.py' }, - { 'name': 'tests/sync042.py' }, - { 'name': 'tests/sync043.py' }, - { 'name': 'tests/sync044.py' }, - { 'name': 'tests/sync045.py' }, - { 'name': 'tests/sync046.py' }, - { 'name': 'tests/sync050.py' }, - { 'name': 'tests/sync051.py' }, - { 'name': 'tests/sync052.py' }, - { 'name': 'tests/sync100.py' }, - { 'name': 'tests/sync1000.py' }, - { 'name': 'tests/sync1003.py' }, - { 'name': 'tests/sync1004.py' }, - { 'name': 'tests/sync1008.py' }, - { 'name': 'tests/sync101.py' }, - { 'name': 'tests/sync102.py' }, - { 'name': 'tests/sync103.py' }, - { 'name': 'tests/sync104.py' }, - { 'name': 'tests/sync110.py' }, - { 'name': 'tests/sync1100.py' }, - { 'name': 'tests/sync1101.py' }, - { 'name': 'tests/sync1102.py' }, - { 'name': 'tests/sync1103.py' }, - { 'name': 'tests/sync1104.py' }, - { 'name': 'tests/sync1105.py' }, - { 'name': 'tests/sync120.py' }, - { 'name': 'tests/sync130.py' }, - { 'name': 'tests/sync131.py' }, - { 'name': 'tests/sync132.py' }, - { 'name': 'tests/sync133.py' }, - { 'name': 'tests/sync134.py' }, - { 'name': 'tests/sync135.py' }, - { 'name': 'tests/sync136.py' }, - { 'name': 'tests/sync137.py' }, - { 'name': 'tests/sync138.py' }, - { 'name': 'tests/sync139.py' }, - { 'name': 'tests/sync140.py' }, - { 'name': 'tests/sync141.py' }, - { 'name': 'tests/sync150.py' }, - { 'name': 'tests/sync200.py' }, - { 'name': 'tests/sync300.py' }, - { 'name': 'tests/sync306.py' }, - { 'name': 'tests/sync400.py' }, - { 'name': 'tests/sync401.py' }, - { 'name': 'tests/sync402.py' }, - { 'name': 'tests/sync403.py', - 'should_fail': true }, - { 'name': 'tests/sync404.py' }, - { 'name': 'tests/sync405.py' }, - { 'name': 'tests/sync406.py', - 'should_fail': true }, - { 'name': 'tests/sync407.py' }, - { 'name': 'tests/sync500.py' }, - { 'name': 'tests/sync501.py' }, - { 'name': 'tests/sync502.py' }, - { 'name': 'tests/sync503.py' }, - { 'name': 'tests/sync600.py' }, - { 'name': 'tests/sync700.py' }, - { 'name': 'tests/sync701.py' }, - { 'name': 'tests/sync702.py' }, - { 'name': 'tests/sync890.py' }, - { 'name': 'tests/sync891.py' }, - { 'name': 'tests/sync892.py' }, - { 'name': 'tests/sync893.py' }, - { 'name': 'tests/sync895.py' }, - { 'name': 'tests/sync896.py' }, - { 'name': 'tests/sync897.py' }, - { 'name': 'tests/sync898.py' }, - { 'name': 'tests/sync899.py' }, - { 'name': 'tests/sync900.py' }, - { 'name': 'tests/sync901.py' }, - { 'name': 'tests/sync990.py' }, - { 'name': 'tests/sync992.py' }, - { 'name': 'tests/sync993.py' }, - { 'name': 'tests/sync999.py' }, - { 'name': 'tests/trans001.py' }, - { 'name': 'tests/type001.py' }, - { 'name': 'tests/unresolvable001.py' }, - { 'name': 'tests/upgrade001.py' }, - { 'name': 'tests/upgrade002.py' }, - { 'name': 'tests/upgrade003.py' }, - { 'name': 'tests/upgrade004.py' }, - { 'name': 'tests/upgrade005.py' }, - { 'name': 'tests/upgrade006.py' }, - { 'name': 'tests/upgrade010.py' }, - { 'name': 'tests/upgrade011.py' }, - { 'name': 'tests/upgrade013.py' }, - { 'name': 'tests/upgrade020.py' }, - { 'name': 'tests/upgrade021.py' }, - { 'name': 'tests/upgrade022.py' }, - { 'name': 'tests/upgrade023.py' }, - { 'name': 'tests/upgrade024.py' }, - { 'name': 'tests/upgrade025.py' }, - { 'name': 'tests/upgrade026.py' }, - { 'name': 'tests/upgrade027.py' }, - { 'name': 'tests/upgrade028.py' }, - { 'name': 'tests/upgrade029.py' }, - { 'name': 'tests/upgrade030.py' }, - { 'name': 'tests/upgrade031.py' }, - { 'name': 'tests/upgrade032.py' }, - { 'name': 'tests/upgrade040.py' }, - { 'name': 'tests/upgrade041.py' }, - { 'name': 'tests/upgrade042.py' }, - { 'name': 'tests/upgrade043.py' }, - { 'name': 'tests/upgrade045.py' }, - { 'name': 'tests/upgrade050.py' }, - { 'name': 'tests/upgrade051.py' }, - { 'name': 'tests/upgrade052.py' }, - { 'name': 'tests/upgrade053.py' }, - { 'name': 'tests/upgrade054.py' }, - { 'name': 'tests/upgrade055.py' }, - { 'name': 'tests/upgrade056.py' }, - { 'name': 'tests/upgrade057.py' }, - { 'name': 'tests/upgrade058.py' }, - { 'name': 'tests/upgrade059.py' }, - { 'name': 'tests/upgrade060.py' }, - { 'name': 'tests/upgrade061.py' }, - { 'name': 'tests/upgrade070.py' }, - { 'name': 'tests/upgrade071.py' }, - { 'name': 'tests/upgrade072.py' }, - { 'name': 'tests/upgrade073.py' }, - { 'name': 'tests/upgrade074.py' }, - { 'name': 'tests/upgrade075.py' }, - { 'name': 'tests/upgrade076.py' }, - { 'name': 'tests/upgrade077.py' }, - { 'name': 'tests/upgrade078.py', - 'should_fail': true }, - { 'name': 'tests/upgrade080.py' }, - { 'name': 'tests/upgrade081.py' }, - { 'name': 'tests/upgrade082.py' }, - { 'name': 'tests/upgrade083.py' }, - { 'name': 'tests/upgrade084.py' }, - { 'name': 'tests/upgrade090.py' }, - { 'name': 'tests/upgrade100.py' }, - { 'name': 'tests/xfercommand001.py' }, + 'tests/backup001.py', + 'tests/clean001.py', + 'tests/clean002.py', + 'tests/clean003.py', + 'tests/clean004.py', + 'tests/clean005.py', + 'tests/config001.py', + 'tests/config002.py', + 'tests/database001.py', + 'tests/database002.py', + 'tests/database010.py', + 'tests/database011.py', + 'tests/database012.py', + 'tests/dbonly-extracted-files.py', + 'tests/depconflict100.py', + 'tests/depconflict110.py', + 'tests/depconflict111.py', + 'tests/depconflict120.py', + 'tests/dependency-cycle-fixed-by-upgrade.py', + 'tests/deprange001.py', + 'tests/deptest001.py', + 'tests/dummy001.py', + 'tests/epoch001.py', + 'tests/epoch002.py', + 'tests/epoch003.py', + 'tests/epoch004.py', + 'tests/epoch005.py', + 'tests/epoch010.py', + 'tests/epoch011.py', + 'tests/epoch012.py', + 'tests/file-conflict-with-installed-pkg.py', + 'tests/fileconflict001.py', + 'tests/fileconflict002.py', + 'tests/fileconflict003.py', + 'tests/fileconflict004.py', + 'tests/fileconflict005.py', + 'tests/fileconflict006.py', + 'tests/fileconflict007.py', + 'tests/fileconflict008.py', + 'tests/fileconflict009.py', + 'tests/fileconflict010.py', + 'tests/fileconflict011.py', + 'tests/fileconflict012.py', + 'tests/fileconflict013.py', + 'tests/fileconflict015.py', + 'tests/fileconflict016.py', + 'tests/fileconflict017.py', + 'tests/fileconflict020.py', + 'tests/fileconflict021.py', + 'tests/fileconflict022.py', + 'tests/fileconflict023.py', + 'tests/fileconflict024.py', + 'tests/fileconflict025.py', + 'tests/fileconflict030.py', + 'tests/fileconflict031.py', + 'tests/fileconflict032.py', + 'tests/hook-abortonfail.py', + 'tests/hook-description-reused.py', + 'tests/hook-exec-reused.py', + 'tests/hook-exec-with-arguments.py', + 'tests/hook-file-change-packages.py', + 'tests/hook-file-remove-trigger-match.py', + 'tests/hook-file-upgrade-nomatch.py', + 'tests/hook-invalid-trigger.py', + 'tests/hook-pkg-install-trigger-match.py', + 'tests/hook-pkg-postinstall-trigger-match.py', + 'tests/hook-pkg-remove-trigger-match.py', + 'tests/hook-pkg-upgrade-trigger-match.py', + 'tests/hook-target-list.py', + 'tests/hook-type-reused.py', + 'tests/hook-upgrade-trigger-no-match.py', + 'tests/hook-when-reused.py', + 'tests/ignore001.py', + 'tests/ignore002.py', + 'tests/ignore003.py', + 'tests/ignore004.py', + 'tests/ignore005.py', + 'tests/ignore006.py', + 'tests/ignore007.py', + 'tests/ignore008.py', + 'tests/ldconfig001.py', + 'tests/ldconfig002.py', + 'tests/ldconfig003.py', + 'tests/mode001.py', + 'tests/mode002.py', + 'tests/mode003.py', + 'tests/noupgrade-inverted.py', + 'tests/overwrite-files-match-negated.py', + 'tests/overwrite-files-match.py', + 'tests/overwrite-files-nonmatch.py', + 'tests/pacman001.py', + 'tests/pacman002.py', + 'tests/pacman003.py', + 'tests/pacman004.py', + 'tests/pacman005.py', + 'tests/provision001.py', + 'tests/provision002.py', + 'tests/provision003.py', + 'tests/provision004.py', + 'tests/provision010.py', + 'tests/provision011.py', + 'tests/provision012.py', + 'tests/provision020.py', + 'tests/provision021.py', + 'tests/provision022.py', + 'tests/query001.py', + 'tests/query002.py', + 'tests/query003.py', + 'tests/query004.py', + 'tests/query005.py', + 'tests/query006.py', + 'tests/query007.py', + 'tests/query010.py', + 'tests/query011.py', + 'tests/query012.py', + 'tests/querycheck001.py', + 'tests/querycheck002.py', + 'tests/querycheck_fast_file_type.py', + 'tests/reason001.py', + 'tests/remove-assumeinstalled.py', + 'tests/remove-directory-replaced-with-symlink.py', + 'tests/remove-optdepend-of-installed-package.py', + 'tests/remove-recursive-cycle.py', + 'tests/remove001.py', + 'tests/remove002.py', + 'tests/remove010.py', + 'tests/remove011.py', + 'tests/remove012.py', + 'tests/remove020.py', + 'tests/remove021.py', + 'tests/remove030.py', + 'tests/remove031.py', + 'tests/remove040.py', + 'tests/remove041.py', + 'tests/remove042.py', + 'tests/remove043.py', + 'tests/remove044.py', + 'tests/remove045.py', + 'tests/remove047.py', + 'tests/remove049.py', + 'tests/remove050.py', + 'tests/remove051.py', + 'tests/remove052.py', + 'tests/remove060.py', + 'tests/remove070.py', + 'tests/remove071.py', + 'tests/replace-and-upgrade-package.py', + 'tests/replace100.py', + 'tests/replace101.py', + 'tests/replace102.py', + 'tests/replace103.py', + 'tests/replace104.py', + 'tests/replace110.py', + 'tests/scriptlet001.py', + 'tests/scriptlet002.py', + 'tests/scriptlet-signal-handling.py', + 'tests/scriptlet-signal-reset.py', + 'tests/sign001.py', + 'tests/sign002.py', + 'tests/skip-remove-with-glob-chars.py', + 'tests/smoke001.py', + 'tests/smoke002.py', + 'tests/smoke003.py', + 'tests/smoke004.py', + 'tests/symlink-replace-with-dir.py', + 'tests/symlink001.py', + 'tests/symlink002.py', + 'tests/symlink010.py', + 'tests/symlink011.py', + 'tests/symlink012.py', + 'tests/symlink020.py', + 'tests/symlink021.py', + 'tests/sync-install-assumeinstalled.py', + 'tests/sync-nodepversion01.py', + 'tests/sync-nodepversion02.py', + 'tests/sync-nodepversion03.py', + 'tests/sync-nodepversion04.py', + 'tests/sync-nodepversion05.py', + 'tests/sync-nodepversion06.py', + 'tests/sync-sysupgrade-print-replaced-packages.py', + 'tests/sync-update-assumeinstalled.py', + 'tests/sync-update-package-removing-required-provides.py', + 'tests/sync001.py', + 'tests/sync002.py', + 'tests/sync003.py', + 'tests/sync009.py', + 'tests/sync010.py', + 'tests/sync011.py', + 'tests/sync012.py', + 'tests/sync020.py', + 'tests/sync021.py', + 'tests/sync022.py', + 'tests/sync023.py', + 'tests/sync024.py', + 'tests/sync030.py', + 'tests/sync031.py', + 'tests/sync040.py', + 'tests/sync041.py', + 'tests/sync042.py', + 'tests/sync043.py', + 'tests/sync044.py', + 'tests/sync045.py', + 'tests/sync046.py', + 'tests/sync050.py', + 'tests/sync051.py', + 'tests/sync052.py', + 'tests/sync100.py', + 'tests/sync1000.py', + 'tests/sync1003.py', + 'tests/sync1004.py', + 'tests/sync1008.py', + 'tests/sync101.py', + 'tests/sync102.py', + 'tests/sync103.py', + 'tests/sync104.py', + 'tests/sync110.py', + 'tests/sync1100.py', + 'tests/sync1101.py', + 'tests/sync1102.py', + 'tests/sync1103.py', + 'tests/sync1104.py', + 'tests/sync1105.py', + 'tests/sync120.py', + 'tests/sync130.py', + 'tests/sync131.py', + 'tests/sync132.py', + 'tests/sync133.py', + 'tests/sync134.py', + 'tests/sync135.py', + 'tests/sync136.py', + 'tests/sync137.py', + 'tests/sync138.py', + 'tests/sync139.py', + 'tests/sync140.py', + 'tests/sync141.py', + 'tests/sync150.py', + 'tests/sync200.py', + 'tests/sync300.py', + 'tests/sync306.py', + 'tests/sync400.py', + 'tests/sync401.py', + 'tests/sync402.py', + 'tests/sync403.py', + 'tests/sync404.py', + 'tests/sync405.py', + 'tests/sync406.py', + 'tests/sync407.py', + 'tests/sync500.py', + 'tests/sync501.py', + 'tests/sync502.py', + 'tests/sync503.py', + 'tests/sync600.py', + 'tests/sync700.py', + 'tests/sync701.py', + 'tests/sync702.py', + 'tests/sync890.py', + 'tests/sync891.py', + 'tests/sync892.py', + 'tests/sync893.py', + 'tests/sync895.py', + 'tests/sync896.py', + 'tests/sync897.py', + 'tests/sync898.py', + 'tests/sync899.py', + 'tests/sync900.py', + 'tests/sync901.py', + 'tests/sync990.py', + 'tests/sync992.py', + 'tests/sync993.py', + 'tests/sync999.py', + 'tests/trans001.py', + 'tests/type001.py', + 'tests/unresolvable001.py', + 'tests/upgrade001.py', + 'tests/upgrade002.py', + 'tests/upgrade003.py', + 'tests/upgrade004.py', + 'tests/upgrade005.py', + 'tests/upgrade006.py', + 'tests/upgrade010.py', + 'tests/upgrade011.py', + 'tests/upgrade013.py', + 'tests/upgrade020.py', + 'tests/upgrade021.py', + 'tests/upgrade022.py', + 'tests/upgrade023.py', + 'tests/upgrade024.py', + 'tests/upgrade025.py', + 'tests/upgrade026.py', + 'tests/upgrade027.py', + 'tests/upgrade028.py', + 'tests/upgrade029.py', + 'tests/upgrade030.py', + 'tests/upgrade031.py', + 'tests/upgrade032.py', + 'tests/upgrade040.py', + 'tests/upgrade041.py', + 'tests/upgrade042.py', + 'tests/upgrade043.py', + 'tests/upgrade045.py', + 'tests/upgrade050.py', + 'tests/upgrade051.py', + 'tests/upgrade052.py', + 'tests/upgrade053.py', + 'tests/upgrade054.py', + 'tests/upgrade055.py', + 'tests/upgrade056.py', + 'tests/upgrade057.py', + 'tests/upgrade058.py', + 'tests/upgrade059.py', + 'tests/upgrade060.py', + 'tests/upgrade061.py', + 'tests/upgrade070.py', + 'tests/upgrade071.py', + 'tests/upgrade072.py', + 'tests/upgrade073.py', + 'tests/upgrade074.py', + 'tests/upgrade075.py', + 'tests/upgrade076.py', + 'tests/upgrade077.py', + 'tests/upgrade078.py', + 'tests/upgrade080.py', + 'tests/upgrade081.py', + 'tests/upgrade082.py', + 'tests/upgrade083.py', + 'tests/upgrade084.py', + 'tests/upgrade090.py', + 'tests/upgrade100.py', + 'tests/xfercommand001.py', ] -foreach testobj : pacman_tests - input = testobj.get('name') +foreach input : pacman_tests test_name = input.split('/')[1] - should_fail = testobj.get('should_fail', false) args = [ - join_paths(meson.source_root(), 'build-aux/tap-driver.py'), join_paths(meson.current_source_dir(), 'pactest.py'), '--scriptlet-shell', get_option('scriptlet-shell'), '--bindir', meson.build_root(), @@ -361,7 +350,7 @@ foreach testobj : pacman_tests test( test_name, PYTHON, + protocol : 'tap', args : args, - depends : [pacman_bin], - should_fail : should_fail) + depends : [pacman_bin]) endforeach diff --git a/test/pacman/tap.py b/test/pacman/tap.py index eb0747be..8a32b3ac 100644 --- a/test/pacman/tap.py +++ b/test/pacman/tap.py @@ -19,7 +19,8 @@ level = 0 failed = 0 def _output(msg): - print("%s%s" % (" "*level, str(msg).replace("\n", "\\n"))) + leader = "#" if level > 0 else "" + print("%s%s%s" % (leader, " "*level, str(msg).replace("\n", "\\n"))) def skip_all(description=""): if description: diff --git a/test/scripts/meson.build b/test/scripts/meson.build index 0bdbfb2f..0dd05fd9 100644 --- a/test/scripts/meson.build +++ b/test/scripts/meson.build @@ -6,10 +6,9 @@ tests = [ foreach tst : tests test(tst, - PYTHON, + BASH, env : TEST_ENV, args : [ - join_paths(meson.source_root(), 'build-aux/tap-driver.py'), join_paths(meson.current_source_dir(), tst), ]) endforeach -- cgit v1.2.3-70-g09d2