• Home
  • Raw
  • Download

Lines Matching +full:test +full:- +full:results

3 """Sanity checks for test data.
5 This program contains a class for traversing test cases that can be used
10 # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
19 class Results: class
20 """Store file and line information about errors or warnings in test suites."""
39 """An iterator over test cases with descriptions.
41 The test cases that have descriptions are:
42 * Individual unit tests (entries in a .data file) in test suites.
43 * Individual test cases in ssl-opt.sh.
51 """Process a test case.
55 file_name: a relative path to the file containing the test case.
57 description: the test case description as a byte string.
62 """Return a new per-file state object.
64 The default per-file state object is None. Child classes that require per-file
67 #pylint: disable=no-self-use
71 """Iterate over the test cases in the given unit test data file."""
73 descriptions = self.new_per_file_state() # pylint: disable=assignment-from-none
83 # This is a test case description line.
89 """Iterate over the test cases in ssl-opt.sh or a file with a similar format."""
90 descriptions = self.new_per_file_state() # pylint: disable=assignment-from-none
94 # with the test description entirely on the same line as the
104 """Iterate over the test cases compat.sh with a similar format."""
105 descriptions = self.new_per_file_state() # pylint: disable=assignment-from-none
106 compat_cmd = ['sh', file_name, '--list-test-case']
109 # test case description between --list-test-case and its OUTCOME.CSV
111 # idx indicates the number of test case since there is no line number
112 # in `compat.sh` for each test case.
118 """Get the relative path for the TLS and Crypto test directories."""
129 """Iterate over all named test cases."""
135 ssl_opt_sh = os.path.join(directory, 'ssl-opt.sh')
138 for ssl_opt_file_name in glob.glob(os.path.join(directory, 'opt-testcases',
146 """Collect the available test cases."""
154 """Record an available test case."""
156 key = ';'.join([base_name, description.decode('utf-8')])
160 """Collect the available test cases."""
166 """Check all test case descriptions.
169 * Check that there is no duplicated description inside of one test suite.
172 def __init__(self, results): argument
173 self.results = results
181 """Check test case descriptions for errors."""
182 results = self.results
185 results.error(file_name, line_number,
190 results.error(file_name, line_number,
193 if re.search(br'[^ -~]', description):
194 results.error(file_name, line_number,
195 'Non-ASCII character in description')
197 results.warning(file_name, line_number,
198 'Test description too long ({} > 66)',
204 parser.add_argument('--list-all',
206 help='List all test cases, without doing checks')
207 parser.add_argument('--quiet', '-q',
210 parser.add_argument('--verbose', '-v',
212 help='Show warnings (default: on; undoes --quiet)')
218 results = Results(options)
219 checker = DescriptionChecker(results)
221 if (results.warnings or results.errors) and not options.quiet:
223 .format(sys.argv[0], results.errors, results.warnings))
224 sys.exit(1 if results.errors else 0)