Commit graph

20 commits

Author SHA1 Message Date
Chris White
53bce3913f TestHelpers: report Python errors
If web.py (or other program) prints the name of a log file, log the
contents of that file.

Also, turn up verbosity in t/400-web.t.
2020-05-25 14:34:01 -04:00
Chris White
3a8b0c19ed Add tests of doc comments in HTML 2020-05-25 14:32:28 -04:00
Chris White
ff99aaf60c Add tests of web.py and relevant infrastructure
- Add sanity tests of line_mark_string
- Update TestHelpers::_parseq() to handle HTML section headers as
  well as query.py section headers
- Add tests of web.py
  - Note: don't look for 200 since web.py doesn't send an HTTP Status-Line.
- In web.py, update the shebang to use env(1).  The hard-coded path
  caused test failures on Travis, which runs Python in a virtualenv.
2020-05-25 14:31:41 -04:00
Chris White
299f762fdf Tests: don't use t/db/
- Documentation fix: TestEnvironment::build_db() doesn't take a parameter
- t/100: check for the temporary directory automatically created, not
  for t/db/.
- Remove .gitignore of t/db/
2020-05-23 15:45:39 -04:00
Christopher White
52d52cb2d6 TestEnvironment: create PROJ_DIR structure
- Instead of creating standalone temporary data and repo dirs, create a
  temporary LXR_PROJ_DIR and put the data and repo dirs under it.
- Change API test project name to match that now used in TestEnvironment

This is the beginning of the test infrastructure for web.py.
2020-05-23 15:22:38 -04:00
Maxime Chretien
fbe9fa0e72 tests: Add support for file families
And fix a problem in a test where an ident where wrongly identified by
ctags. It is fixed in the new ctags version.

Signed-off-by: Maxime Chretien <maxime.chretien@bootlin.com>
2020-05-22 10:29:24 +02:00
Carmeli Tamir
cc4c76b78b Adding python3-pytest to CI dependencies 2020-04-15 06:36:15 -04:00
Michael Opdenacker
3d3fa10084 Ubuntu update: use pytest-3
- pytest seems to be for Python 2 in Ubuntu 18.04
  If we use pytest instead of python3-test, it
  won't find the falcon module provided by python3-falcon

- Please raise your hand if this breaks other distros
  that wouldn't have the "pytest-3" executable.

- Updated documentation

Signed-off-by: Michael Opdenacker <michael.opdenacker@bootlin.com>
2020-04-13 18:52:53 +02:00
Carmeli Tamir
e7e3542216 1. Testing results for existing identifiers. 2. Testing version parameter options 2020-04-09 10:08:34 -04:00
Chris White
a171485c4f doc-comments: support uncommented first function
If the first function in a file does not have a doc comment, do not
run off the beginning of the file.  Fixes #102.

Also:
- Add t/tree/issue102.c that exhibits this bug.
- in find-file-doc-comments.pl and script.sh, exit with a nonzero code
  if this should recur.
2020-04-04 12:21:45 -04:00
Christopher White
8a6031c8a1 Add doc-comment extraction
- find-file-doc-comments.pl: new file
- data.py: Add database to store doc-comment locations
- script.sh: Add parse-docs subcommand
- update.py:
  - Add code to process doc comments
  - Update some variable names in hopes of reducing confusion
- query.py:
  - Add code to report doc comments
  - Update some variable names in hopes of reducing confusion

Also:
- t/TestEnvironment.pm: Add find_doc attribute
- t/interact.pl: Don't die if update.py fails
- t/TestHelpers.pm: Permit checking specific sections of query.py output
- t/300: update regexes per the preceding
- gitignore tags (ctags output) and .cache (api_test.py output)
2020-04-02 13:03:03 -04:00
Chris White
60f206c9fa TestHelpers: report errors at caller's line number
When a test fails, report the line number in the .t file that test
was invoked from, not the line number in TestHelpers.pm itself.

New function `line_mark_string()` adds the filename and line-number
information to strings of code, which are then run using `eval`.
2020-04-02 12:37:32 -04:00
Christopher White
14dc250744 Added initial test of doc-comment extraction
Test does not currently pass, in true TDD style.
2020-04-02 12:37:32 -04:00
Michael Opdenacker
588e5db181
Merge pull request #95 from carmeli-tamir/api_test
Added API tests
2020-03-31 16:52:16 +02:00
Carmeli Tamir
c42da0eefc CR1 2020-03-21 10:58:18 -04:00
Chris White
04e9f85474 Add t/interact.pl for interactive testing
Run `./t/interact.pl` and it will build a database from `t/tree` and
leave you in a shell so you can experiment.  When you exit the shell,
the temporary repo and database will be cleaned up.

Also:
- TestEnvironment: add report() function to produce a human-readable
  summary of the environment
- TestHelpers: turn on `strict` and `warnings` so the caller doesn't
  have to manually `use strict` and `use warnings`.
2020-03-21 09:44:49 -04:00
Carmeli Tamir
cdd8dc4615 Added API tests 2020-03-20 15:42:50 -04:00
Christopher White
1db4fb8199 Refactor common test code into class
- Create new class t/TestEnvironment.pm.  A TestEnvironment instance
  owns a temporary Git repo and a temporary Elixir database directory.
- Update t/100-basic.t to use TestEnvironment.
- Add constant MUST_SUCCEED so `run_produces_ok()` calls are more
  self-documenting
2020-03-09 16:29:57 -04:00
Christopher White
fa7243638d Add automated test of basic functions
- Added test helpers in t/TestHelpers.pm
- Added basic test of update.py and query.py in t/100-basic.t
- Updated README:
    - Added automated-testing section
    - Formatted identifiers (i.e., added backticks)
2020-02-21 15:36:51 -05:00
Christopher White
b22a562b5b Added files copied from Linux v5.4
These files all carry SPDX GPL2+ indicators.  Based on the information
available to me, I have a good-faith belief that they can be combined
into this AGPLv3 project and licensed AGPLv3.

This commit only touches t/tree.  Therefore, if the test suite later
needs to be changed, it will be sufficient to revert this commit.

The files used are those involved in the x64 compilation of
drivers/i2c/i2c-core-base.c, filtered to remove any that aren't
tagged GPL2+.

Note that t/tree itself is not a Git repo or submodule.  It is a
collection of files that test scripts can use to populate a Git repo.
2020-02-21 15:31:57 -05:00