Commit graph

339 commits

Author SHA1 Message Date
Carmeli Tamir
a62164a95f Converted MD to AsciiDoc 2020-04-18 10:46:44 -04:00
Michael Opdenacker
fded04ed0c
Merge pull request #110 from carmeli-tamir/fix_broken_ci
Adding python3-pytest to CI dependencies
2020-04-15 20:42:43 +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
Michael Opdenacker
8df1fc473e
Merge pull request #108 from carmeli-tamir/more_api_tests
Added more API tests
2020-04-09 16:15:42 +02:00
Carmeli Tamir
e7e3542216 1. Testing results for existing identifiers. 2. Testing version parameter options 2020-04-09 10:08:34 -04:00
Michael Opdenacker
7b21214eb9 Add sample project definition for testing
Signed-off-by: Michael Opdenacker <michael.opdenacker@bootlin.com>
2020-04-09 15:50:07 +02:00
Michael Opdenacker
3ce8bcf316 README.md: now need Python >= 3.6
- For new statements like these (in "update.py"):
  print(f"New blob #{idx} {hash}:{filename}")

Signed-off-by: Michael Opdenacker <michael.opdenacker@bootlin.com>
2020-04-06 17:52:04 +02:00
Michael Opdenacker
893c4aabdb update.py: fix syntax issues (typical "C-isms")
Signed-off-by: Michael Opdenacker <michael.opdenacker@bootlin.com>
2020-04-06 17:21:30 +02:00
Michael Opdenacker
c497a753da
Merge pull request #104 from cxw42/issue-102
doc-comments: support uncommented first function
2020-04-06 10:34:29 +02:00
Michael Opdenacker
60ff5ecd79
Merge pull request #103 from carmeli-tamir/readme_ci_status
Add CI status in README.md
2020-04-06 10:27:18 +02: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
Michael Opdenacker
7f9c403fe3
Merge pull request #99 from cxw42/doc-comments-2
Extract doc comments - back-end
2020-04-02 23:35:38 +02:00
Christopher White
ca36e56d2a Front-end: accept (but don't use) doc comments from query()
Now that query() returns three elements instead of two, accept all three
2020-04-02 13:11:16 -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
ae6fb0dbb2 Fix syntax error
Signed-off-by: Michael Opdenacker <michael.opdenacker@bootlin.com>
2020-04-02 16:22:43 +02:00
Michael Opdenacker
59b45e86cc http/web.py: create /tmp/elixir-errors if non existing
Signed-off-by: Michael Opdenacker <michael.opdenacker@bootlin.com>
2020-04-02 16:11:14 +02:00
Michael Opdenacker
588e5db181
Merge pull request #95 from carmeli-tamir/api_test
Added API tests
2020-03-31 16:52:16 +02:00
Michael Opdenacker
9074c54018
Merge pull request #97 from cxw42/interaction-example
Add t/interact.pl for interactive testing
2020-03-31 15:45:57 +02:00
Michael Opdenacker
a2411b962c
Merge pull request #96 from cxw42/whitespace
Regularize whitespace; add editorconfig
2020-03-31 15:42:53 +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
Chris White
f112ab0826 Regularize whitespace; add editorconfig
- Change the few files that use leading tabs into leading spaces.
  This way they match the other files in the repo.
- Add an EditorConfig file so that supported editors will automatically
  use spaces instead of tabs.
- (Extra) Add some common editor backup-file extensions to .gitignore.
2020-03-21 08:58:43 -04:00
Carmeli Tamir
cdd8dc4615 Added API tests 2020-03-20 15:42:50 -04:00
Carmeli Tamir
eb42ab020f Added CI status 2020-03-12 16:10:12 -04:00
Michael Opdenacker
1b6f7d1717
Merge pull request #94 from carmeli-tamir/add_travis_ci
Add travis ci
2020-03-12 10:20:00 +01:00
Michael Opdenacker
f464bbfd65
Merge pull request #93 from cxw42/doc-comments
Refactor common test code into class
2020-03-11 19:55:19 +01:00
Carmeli Tamir
116bae3148 Check test success 2020-03-10 14:58:51 -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
Michael Opdenacker
5f063ebdf9
Merge pull request #92 from carmeli-tamir/master
Return empty lists when no identifier found
2020-03-09 10:37:38 +01:00
Carmeli Tamir
a1e8117afd Check test failure 2020-03-07 13:24:16 -05:00
Carmeli Tamir
0a96ceef9d Return empty lists when no identifier found 2020-03-07 03:38:19 -05:00
Michael Opdenacker
e9d970ced1 Fix handling of malformed URLs
- Otherwise, we end up with a wrong path variable
  that causes an internal server error

Signed-off-by: Michael Opdenacker <michael.opdenacker@bootlin.com>
2020-03-06 12:04:39 +01:00
Michael Opdenacker
c4f3a1de5b
Merge pull request #88 from cxw42/basic-test
Add basic automated-test suite
2020-03-02 15:38:45 +01:00
Michael Opdenacker
bada530879
Merge pull request #89 from pcworld/title
Prepend filename or identifier in HTML <title>
2020-03-02 15:31:34 +01:00
pcworld
97ef91036a Prepend filename or identifier in HTML <title>
Display filenames and identifiers at the *beginning* of the <title>.
This way, they are better visible in modern browsers' tabs as they
usually cut off the title for space reasons.

This also fixes handling of the root path.
Examples of changed titles:
"Linux source code: (v5.5.6) - Bootlin" becomes "Linux source code (v5.5.6) - Bootlin"
"Linux source code: arch (v5.5.6) - Bootlin" becomes "arch - Linux source code (v5.5.6) - Bootlin"
"Linux source code: arch/um/Makefile (v5.5.6) - Bootlin" becomes "Makefile - arch/um/Makefile - Linux source code (v5.5.6) - Bootlin"
2020-03-01 03:58:55 +01: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
Michael Opdenacker
3de325ca86 Improve and update website banner
Signed-off-by: Michael Opdenacker <michael.opdenacker@bootlin.com>
2020-02-04 10:51:24 +01:00
Michael Opdenacker
7eae101760 README.md: add sample configuration for lighthttpd
- Thanks to 'jmaselbas'
  See bbd8cc3bf2

Signed-off-by: Michael Opdenacker <michael.opdenacker@bootlin.com>
2020-01-30 14:22:32 +01:00
Michael Opdenacker
bbd8cc3bf2
Merge pull request #86 from jmaselbas/lighthttpd
Support for lighthttpd CGI
2020-01-29 14:34:23 +01:00
Michael Opdenacker
3037fc624e Improve details about fetching the Linux "stable" tree
Signed-off-by: Michael Opdenacker <michael.opdenacker@bootlin.com>
2020-01-29 11:18:07 +01:00
Michael Opdenacker
09806627eb
Merge pull request #85 from cxw42/readme-update
README: include URL for Linux sublevel tags
2020-01-29 10:49:42 +01:00
Michael Opdenacker
cb495269eb Remove blacklisted structure names
- Those were important structures in Linux
  They deserve to be indexed.

- This will require re-indexing, so this will take a bit
  of time to be fixed in the database

Signed-off-by: Michael Opdenacker <michael.opdenacker@bootlin.com>
2020-01-29 08:11:27 +01:00
Jules Maselbas
4b9e9e9e27 Support for lighthttpd CGI
Sample config for lighthttpd rules:

server.document-root = server_root + "/elixir/http"
url.redirect = ( "^/$" => "/linux/latest/source" )
url.rewrite  = ( "^/.*/(source|ident|search)" =>  "/web.py/$1")
setenv.add-environment = ( "PYTHONIOENCODING" => "utf-8",
	"LXR_PROJ_DIR" => "/path/to/elixir-data" )
2020-01-17 15:35:44 +01:00
Christopher White
777362c787 README: include URL for Linux sublevel tags
The GitHub repo doesn't have tags for sublevel (X.Y.Z) releases,
unlike the master Bootlin Elixir site.  Add the master repo that does
have the sublevel tags to the README.
2020-01-03 12:51:27 -05:00
Michael Opdenacker
626ac46dc8
Merge pull request #84 from carmeli-tamir/fix_query_cmd
Implemented query cmd commands for ident and file
2020-01-03 11:04:03 +01:00
Carmeli Tamir
e969b88e8b Implemented query cmd commands for ident and file 2019-12-30 15:00:44 -05:00