Commit graph

43 commits

Author SHA1 Message Date
Franciszek Stachura
3f6aa021a7 Improve tests
* 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
2024-11-05 12:20:02 +01:00
Costa Shulyupin
47a6001385 parse linux system calls definitions
fixes #222
2023-05-15 14:58:57 +02:00
Maxime Chretien (MixLeNain)
10f08e33ea test: Remove defs from refs results
Signed-off-by: Maxime Chretien (MixLeNain) <mchretien@linuxmail.org>
2020-12-07 12:20:59 +01:00
Chris White
7613d5be61 Remove duplicate test [minor]
Apparently a copy-and-paste error --- we were running one test twice.
Remove the second test, since I can't think of any reason we would need it.
2020-10-26 21:48:42 -04:00
Chris White
868b8676b8 Add test of #192 2020-10-26 21:43:11 -04:00
Maxime Chretien (MixLeNain)
bec8105305 t/api_test.py : Update tests results according to query changes
Signed-off-by: Maxime Chretien (MixLeNain) <mchretien@linuxmail.org>
2020-10-26 13:31:40 +01:00
Chris White
ff6a55bb57 Added test of #188 2020-10-15 20:32:04 -04:00
Chris White
90392b543d doc-comment tests: add counterexamples for issue186
Issue 186 relates to symbols that are not documented.  Add tests for
symbols that are documented in a file of the same structure.
2020-10-10 17:22:26 -04:00
Chris White
68232f8fba Added test file and test for #186 2020-10-10 17:04:26 -04:00
Chris White
5aeb22b3e7 Fix typo in TestEnvironment docs [minor] 2020-10-10 17:04:26 -04:00
Chris White
224ec06ced Add tests for struct, enum, macro doc comments 2020-10-03 22:01:36 -04:00
Chris White
4ea9120101 Add test file for issue-134-specific tests
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.
2020-10-03 21:59:39 -04:00
Chris White
9d8b213862 Add test file t/tree/include/linux/memblock.h
Per <https://github.com/bootlin/elixir/issues/78#issuecomment-632611233>.
Copied from Linux 5.6, at
<https://elixir.bootlin.com/linux/v5.6/source/include/linux/memblock.h>.

This file is GPL-2.0-or-later.
2020-10-03 21:58:27 -04:00
Maxime Chretien
48e59b909a test : Update api tests
Signed-off-by: Maxime Chretien <maxime.chretien@bootlin.com>
2020-06-12 16:32:50 +02:00
Christopher White
1a26548527 t/100: update to look in specific section [minor]
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.
2020-06-04 08:35:38 -04:00
Christopher White
50b83a4376 Add ENTRY tests 2020-06-04 08:33:59 -04:00
Christopher White
9ebed89cbe Added additional test files
- drivers/firmware/broadcom/bcm74xx_sprom.c is GPL 2+
- arch/arm/xen/hypercall.S, when distributed with Elixir, is
  MIT-like.
2020-06-04 08:25:31 -04:00
Christopher White
85f83574cf Added test of function definitions in .S files
Issue 150
2020-06-03 11:01:42 -04:00
Michael Opdenacker
b6606359e0
Merge pull request #136 from cxw42/tests-issue-131
Add tests of `struct class` (#131)
2020-05-26 10:12:27 +02:00
Michael Opdenacker
a5afbeb2a7
Merge pull request #135 from cxw42/doc-frontend
Doc comments: frontend
2020-05-26 10:11:49 +02:00
Michael Opdenacker
7cec7659b2
Merge pull request #133 from cxw42/issue-129
API: Always set LXR_DATA_DIR and LXR_REPO_DIR based on LXR_PROJ_DIR.
2020-05-26 10:10:32 +02:00
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
d3664c5704 Add tests of struct class (#131)
This adds a file and a test to detect the issue reported in #131
2020-05-25 12:54:00 -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
Chris White
5e7cab18ca Added/updated copyright notices; whitespace fixes
No functional changes
2020-05-23 15:14:21 -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