query.py and web.py were moved from the project root and http/ into the
elixir/ package directory, but the find_program() calls in
TestEnvironment.pm were not updated to follow.
Signed-off-by: Thomas Perrot <thomas.perrot@bootlin.com>
* Run pytest only for t, do not run tests for other libraries
* Add email and name git options to test repo init
* Change test repo permissions to avoid "dubious ownership" error
New file t/tree/issue134.c exercises the bugs noted in
<https://github.com/bootlin/elixir/issues/134#issue-624392766>.
I did not copy in the files listed in that comment because those files
are GPL-2.0-only or an unspecified GPL license, not GPL-2.0-or-later.
Use the {def} and {ref} features of run_produces_ok() to look for
regexes only in the correct sections. This improves the ability of the
test to detect regressions.
- 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.
- 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/
- 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.
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>
- 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>
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.
- 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)
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`.
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`.
- 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
- 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)
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.