summaryrefslogtreecommitdiff
path: root/test/lisp/progmodes/xref-tests.el
Commit message (Collapse)AuthorAgeFilesLines
* ; Add 2023 to copyright years.Eli Zaretskii2023-01-011-1/+1
|
* ; Add 2022 to copyright years.Eli Zaretskii2022-01-011-1/+1
|
* Fix the testsDmitry Gutov2021-09-131-8/+18
| | | | | | | | * test/lisp/progmodes/xref-tests.el (xref--xref-file-name-display-is-abs) (xref--xref-file-name-display-is-nondirectory) (xref--xref-file-name-display-is-relative-to-project-root): Update for the latest change in xref.el.
* project--files-in-directory: Fix handling of ignoresDmitry Gutov2021-09-061-0/+8
| | | | | | | | | | | | | | | | | | | | | * lisp/progmodes/project.el (project--files-in-directory): Pass "." as the DIR argument to 'find' because otherwise the ignore expression can match the project root directory name, which we don't want to happen (bug#50240). Fixup the resulting file names at the end with concatenation. Originally I thought it could lead to worse performance, but the results show equal or slightly better timings. * lisp/progmodes/xref.el (xref-matches-in-directory): Apply a similar fix. (xref--find-ignores-arguments): Use file-name-as-directory, so that when passed "." replace-match still had the expected effect. * test/lisp/progmodes/project-tests.el (project-ignores-bug-50240): New test. * test/lisp/progmodes/xref-tests.el (xref-matches-in-directory-filters-with-ignores): New test.
* Support old BSD find and "root dir symlink" betterDmitry Gutov2021-06-071-24/+16
| | | | | | | | | | | | | | * lisp/progmodes/grep.el (grep-compute-defaults): Add '-H' to grep-find-template (bug#48471). * lisp/cedet/semantic/symref/grep.el (semantic-symref-perform-search): Pass the root directory name without the trailing slash. * lisp/progmodes/xref.el (xref-matches-in-directory): Ditto. * test/lisp/progmodes/xref-tests.el (xref--xref-file-name-display-is-abs) (xref--xref-file-name-display-is-relative-to-project-root): Make tests more strict again.
* ; * test/lisp/progmodes/xref-tests.el: Add footer.Philipp Stephani2021-04-181-0/+2
|
* Remove redundant #' before lambda in testsStefan Kangas2021-04-041-1/+1
| | | | | | | | | | | | | | * test/lisp/electric-tests.el (save-electric-modes) (inhibit-in-mismatched-string-inside-ruby-comments) (inhibit-in-mismatched-string-inside-c-comments, js-mode-braces) (js-mode-braces-with-layout) (js-mode-braces-with-layout-and-indent, autowrapping-1) (autowrapping-2, autowrapping-3, autowrapping-4, autowrapping-5) (autowrapping-6, autowrapping-7): * test/lisp/progmodes/xref-tests.el (xref--xref-file-name-display-is-relative-to-project-root): * test/src/thread-tests.el (threads-signal-early) (threads-signal-main-thread): Remove redundant #' before lambda.
* Speed up xref rendering for matches on very long linesDmitry Gutov2021-03-081-3/+12
| | | | | | | | | | | | | | | | | | | | | | * lisp/progmodes/xref.el (xref--insert-xrefs): Cut up the current line into pieces here for multiple matches's summaries, so that xref--insert-xrefs can do less work (bug#46859). (xref--insert-xrefs): Do less work. (xref--outdated-p): Update accordingly to how the summary creation logic changed. (xref--buf-pairs-iterator): Update to the new calling convention. (xref-location-column): Effectively rename back to xref-file-location-column since the generic version is now unused. * test/lisp/progmodes/xref-tests.el (xref-matches-in-directory-finds-two-matches-on-the-same-line) (xref-matches-in-directory-finds-an-empty-line-regexp-match): Adjust to the xref-location-column change. (xref-matches-in-files-trims-summary-for-matches-on-same-line): New test. * test/lisp/progmodes/xref-resources/file1.txt: Change contents slightly to test the new xref--outdated-p code.
* Xref test improvementsDmitry Gutov2021-03-081-12/+21
| | | | | | | | * test/lisp/progmodes/xref-tests.el (xref--xref-file-name-display-is-abs): Fix not to rely on the default value. (xref-matches-in-files-includes-matches-from-all-the-files): New test.
* Fix some failing tests in BSD systemsDaniel Martín2021-01-061-14/+24
| | | | | | | | * test/lisp/progmodes/xref-tests.el (xref--xref-file-name-display-is-abs) (xref--xref-file-name-display-is-relative-to-project-root): Accommodate some older versions of BSD find (https://lists.gnu.org/archive/html/emacs-devel/2021-01/msg00156.html).
* Update copyright year to 2021Paul Eggert2021-01-011-1/+1
| | | | Run "TZ=UTC0 admin/update-copyright".
* Add 'project-relative' as value for 'xref-file-name-display'Dmitry Gutov2020-12-301-0/+31
| | | | | | | | | | | | | | | * lisp/progmodes/xref.el (xref-file-name-display): Document new value. (xref-location-group ((l xref-file-location))): Handle the new value. (xref--project-root): Extract from the default method of 'xref-backend-references' so it can be used in above's new code. Also fix an old bug in the "backward compat" branch. * lisp/progmodes/xref.el (xref--project-root-memo): New variable. * test/lisp/progmodes/xref-tests.el: Add test cases for the three possible settings of 'xref-file-name-display'. Co-authored-by: Tobias Rittweiler <trittweiler@gmail.com>
* Minor refactoring of xref-testsTobias Rittweiler2020-12-301-16/+22
| | | | | | | | * test/lisp/progmodes/xref-tests.el (xref-tests-data-dir): Rename to 'xref-tests--data-dir'. (xref-tests--matches-in-data-dir, xref-tests--locations-in-data-dir): New functions. Factored out from test cases and updated usage sites to use them.
* Generic-ify xref-location-columnDmitry Gutov2020-12-211-3/+3
| | | | | | | | | | | | * lisp/progmodes/xref.el (xref-location-column): Create a generic from xref-file-location-column, to use in the common rendering code (bug#36967). (xref--insert-xrefs): Update accordingly. * test/lisp/progmodes/xref-tests.el (xref-matches-in-directory-finds-two-matches-on-the-same-line) (xref-matches-in-directory-finds-an-empty-line-regexp-match): Ditto.
* Revert commit 1f44a776729adf9c6468a76f8310616fde62eeaa for XRef.Philipp Stephani2020-10-251-2/+4
| | | | | | | | XRef supports Emacs versions back to Emacs 26.3, so it can’t use newer functions such as ‘ert-resource-directory’. * test/lisp/progmodes/xref-tests.el (xref-tests-data-dir): Don’t use ‘ert-resource-directory’
* Move some test data to follow our conventionsStefan Kangas2020-10-231-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * test/data/emacs-module/mod-test.c: Move from here... * test/src/emacs-module-resources/mod-test.c: ...to here. * test/src/emacs-module-tests.el (ert-x): Require. (mod-test-file, module/describe-function-1): * test/Makefile.in (test_module_dir): Adjust for move. * test/data/files-bug18141.el.gz: Move from here... * test/lisp/files-resources/files-bug18141.el.gz: ... to here. * test/lisp/files-tests.el (ert-x): Require. (files-test-bug-18141-file): Use ert-resource-file. * test/data/mailcap/mime.types: Move from here... * test/lisp/net/mailcap-resources/mime.types: ...to here. * test/lisp/net/mailcap-tests.el (ert-x): Require. (mailcap-tests-path): Use ert-resource-file. * test/data/somelib.el: * test/data/somelib2.el: Move from here... * test/src/lread-resources/somelib.el: * test/src/lread-resources/somelib2.el: ...to here. * test/src/lread-tests.el (ert, ert-x): Require. (lread-test-bug26837): Use ert-resource-directory. * test/data/syntax-comments.txt: Move from here.... * test/src/syntax-resources/syntax-comments.txt: ...to here. * test/src/syntax-tests.el (ert-x): Require. (syntax-comments, syntax-br-comments, syntax-pps-comments): Use ert-resource-file. * test/data/xref/file1.txt: * test/data/xref/file2.txt: Move from here... * test/lisp/progmodes/xref-resources/file1.txt: * test/lisp/progmodes/xref-resources/file2.txt: ...to here. * test/lisp/progmodes/xref-tests.el (ert, ert-x): Require. (xref-tests-data-dir): Use ert-resource-directory.
* Use lexical-binding in most progmodes testsStefan Kangas2020-04-281-1/+1
| | | | | | | | | | | | | | | * test/lisp/progmodes/etags-tests.el: * test/lisp/progmodes/f90-tests.el: * test/lisp/progmodes/ps-mode-tests.el: * test/lisp/progmodes/python-tests.el: * test/lisp/progmodes/ruby-mode-tests.el: * test/lisp/progmodes/subword-tests.el: * test/lisp/progmodes/tcl-tests.el: * test/lisp/progmodes/xref-tests.el: Use lexical-binding. * test/lisp/progmodes/python-tests.el (python-tests-visible-string) (python-tests-look-at-1, python-tests-look-at-2) (python-shell-calculate-process-environment-2): Silence byte-compiler.
* Update copyright year to 2020Paul Eggert2020-01-011-1/+1
| | | | Run "TZ=UTC0 admin/update-copyright $(git ls-files)".
* Rename xref-collect-references and xref-collect-matchesDmitry Gutov2019-12-291-13/+14
| | | | | | | | | | | * lisp/progmodes/xref.el (xref-references-in-directory): Rename from xref-collect-references. Update the sole caller. (xref-matches-in-directory): Rename from xref-collect-matches. Update all callers (all of them are in the /tests/ dir). * test/lisp/progmodes/xref-tests.el (xref-tests-data-dir): Don't use the EMACS_TEST_DIRECTORY env var. It doesn't work when running interactively.
* Update copyright year to 2019Paul Eggert2019-01-011-1/+1
| | | | Run 'TZ=UTC0 admin/update-copyright $(git ls-files)'.
* Update copyright year to 2018Paul Eggert2018-01-011-1/+1
| | | | Run admin/update-copyright.
* Prefer HTTPS to FTP and HTTP in documentationPaul Eggert2017-09-131-1/+1
| | | | | | | | | | | | | Most of this change is to boilerplate commentary such as license URLs. This change was prompted by ftp://ftp.gnu.org's going-away party, planned for November. Change these FTP URLs to https://ftp.gnu.org instead. Make similar changes for URLs to other organizations moving away from FTP. Also, change HTTP to HTTPS for URLs to gnu.org and fsf.org when this works, as this will further help defend against man-in-the-middle attacks (for this part I omitted the MS-DOS and MS-Windows sources and the test tarballs to keep the workload down). HTTPS is not fully working to lists.gnu.org so I left those URLs alone for now.
* Merge from origin/emacs-25Paul Eggert2017-01-011-1/+1
| | | | | 2e2a806 Fix copyright years by hand 5badc81 Update copyright year to 2017
* Port xref-tests to master branchPaul Eggert2016-05-061-0/+91
Also, add a test to make this problem less likely in the future. * test/Makefile.in (check-no-automated-subdir): New rule. (check, check-expensive, check-maybe): Depend on it. * test/automated/data/xref/file1.txt: Rename to ... * test/data/xref/file1.txt: ... here. * test/automated/data/xref/file2.txt: Rename to ... * test/data/xref/file2.txt: ... here. * test/automated/xref-tests.el: Rename to ... * test/lisp/progmodes/xref-tests.el: ... here. (xref-tests-data-dir): Use EMACS_TEST_DIRECTORY.