summaryrefslogtreecommitdiff
path: root/test/run
AgeCommit message (Collapse)Author
2025-07-01Print full test name in test frameworkMaxime Coste
computing the indentation is surprisingly costly (close to 8% of the whole test framework runtime), and having the full path to easily copy paste is handy instead of recreating it from the printed tree.
2025-06-26Fix flaky blame-in-diff test and "edit -fifo" in BufCloseFifoJohannes Altmanninger
This test uses ui_out and ui_in to coordinate events. This is brittle[1] because ui_out behavior depends on timing. Since this test doesn't really care about intermediate UI state, express the sequence using BufCloseFifo instead. This hits another issue: inside git blame-jump's BufCloseFifo, we run git blame, which runs another "edit -fifo .. *git*". A special aspect of fifo buffers is that any existing *git* buffer will be reused instead of being recreated[2]. After BufCloseFifo, the fifo watcher destructor will reset the fifo flag, even if BufCloseFifo has recreated the fifo buffer. This breaks invariants and causes the next fifo watcher destructor do fail its assertion. Let's not reset fifo flags in this case. This should be safe because it's the very last thing the fifo watcher does, so it's okay if another one is active now. Alternatively we could reject this kind of recursion, or implement it in a different way (using ScopedSetBool for the flags). Reported-by: Nico Sonack <nsonack@herrhotzenplotz.de> [1]: https://lists.sr.ht/~mawww/kakoune/%3C20241210100417.1150697-1-aclopte@gmail.com%3E [2]: This removes the need to use delete-buffer which also ensures that the buffer remains visible in any client it's already shown.
2025-06-24Fix test runner for tests using assert_eqMaxime Coste
assert_eq got renamed to check_json_eq but the fact this was used by tests in their script file was missed, renamed it back to assert_eq as this function is not necessarily used for json.
2025-06-23Use word-diff when possible when comparing json ui output in testsMaxime Coste
If git is present we can rely on git-diff word support to get a much easier to understand diff.
2024-11-11Remove noisy output from testsJohannes Altmanninger
"ui_out -until-grep" invocations used to redirect the output from grep, usually to /dev/null. Looks like the intention of 60fcc3443 (Change ui_out -until-grep to check for equality the next argument, 2024-11-02) was that grep no longer needs to print output, since we can assert instead which is mildly better. Unfortunately there are two places where -until-grep might not be powerful enough, which is why we capture the output and check it in the test script. For one of them we can use -until-grep with a small change. Not yet sure about the other one. Let's try to use eval instead, so we can silence the output. I realize -until-eval is not great (the nested quoting is ugly) but I guess it's better than the status quo. Alternatively, we could print output only if the [expected] argument is not given, and add >/dev/null to the other invocations.
2024-11-11Simplify ui_out argument parsingJohannes Altmanninger
Tests print a confusing error ./run: line 214: shift: shift count out of range This is because ui_out -until-grep now shifts twice which conflicts with the weird shift at the end of ui_out. It also has a loop, making it possible to do something like "ui_out foo bar baz" to expect three different messages. We don't use this feature anywhere, and it seems just super surprising, given that ui_out now consumes between 1 and 3 arguments each time. Let's get rid of the loop, and always run shift right next to where we actually use the argument. This should make things less brittle.
2024-11-04Change ui_out -until-grep to check for equality the next argumentMaxime Coste
Instead of outputing the matching output, either ignore the output (if not extra argument is given) or match it. Usage is: ui_out -until-grep <pattern> [<expected>]
2024-05-12Fix another case where git tests were hangingMaxime Coste
2024-05-10Fix tests that were failing on alpineMaxime Coste
Ensure perl exists for git blame tests, replace timing sensitive `ui_out -ignore ...` with `ui_out -until '...'`
2024-02-18Remove unused -within-next ui_out switchMaxime Coste
2024-02-18Fix flaky blame-jump-message testJohannes Altmanninger
This test fails occasionally[1] because the order of events and the number of events varies across runs. We should always call draw_status exactly 3 times: [*git*][fifo] [*git*] Commit subject etc. [*git*] Let's check it this way. This seems to work; this time I took the time to run it a couple hundred times and in Cirrus CI. [1] https://builds.sr.ht/~mawww/job/1151239
2024-02-13rc git.kak: fix blame-jump for commits with special charactersJohannes Altmanninger
Commit 53d9b9b67 (Escaping tweak in git.kak, 2024-02-06) broke blame-jump when the commit subject contains a single quote. (Also on unbalanced "{" which is a rare edge case but we already have it in our Git history.) git.kak assumes that filenames don't contain ' or unbalanced {, but we can't really make that assumption about people's names or commit subjects. Unfortunately the escaping here is very messy. We need to pass arbitrary text to callbacks; maybe we should have closures that can capture private temporary registers.
2023-03-14Cleanup and speed up test runnerMaxime Coste
Add a -end-of-line switch to echo command to make it possible to use `echo -end-of-line -to-file <file>` to collect env-vars
2021-12-14Bug: The `enabled` test checks, though they exist are never actually runSidharth Kshatriya
Fix by copying the `enabled` check file, if it exists to where the tests are being run
2021-07-20Prevent overwriting existing file in :write <explicit filename>Maxime Coste
Add a -force (equivalent to w!) switch that enables overwriting.
2021-01-22Support a DEBUGGER env-var to run testsMaxime Coste
Setting it to `gdbserver :12345` makes it easy to debug a test case with the correct setup.
2020-06-10Drain ui-out to avoid deadlock with small pipe buffersMaxime Coste
2020-04-27Display all failing ui_out in tests instead of just the first oneMaxime Coste
2020-04-13Drop trailing EOL in test commandsMaxime Coste
2020-03-14Use %file in the test run script instead of %shMaxime Coste
2019-11-24Fix test/run ui_out diff displayMaxime Coste
2019-10-13test: Allow expect-style UI tests, testing any varJason Felice
2019-10-13test: Clear socket correctly when XDG_RUNTIME_DIR is setJason Felice
2019-06-23Fix tests with new opt-in quotingMaxime Coste
2019-03-12Refactor colorize function away from the test scriptAlex Leferry 2
2019-02-17Fix wording used in test runnerDimitri Merejkowsky
2018-07-19src: Rename `auto_complete` to `autocomplete`Frank LENORMAND
Removing the underscore seems to make the option name more in line with the others (even though some do use a separator, e.g. `disabled_hooks`).
2018-07-15Change autoshowcompl to auto_complete with insert|prompt possible valuesMaxime Coste
2018-07-05test/run: Fix script post hook behaviour changeMaxime Coste
2018-06-28Fix wrong logic for moving filedescriptors leading to closed stdinMaxime Coste
With this fix, tests can now use /dev/null as stdin. Fixes #2165
2018-05-19test/run: Support a "ui-in" file containing json-rpc messagesMaxime Coste
With this "ui-in", tests can execute json-rpc commands from the UI at startup to set a specific UI state.
2018-05-19test/run: Rename "display" expected ui output file as "ui-out"Maxime Coste
2018-02-27Add -lock switch to enter-user-mode commandDelapouite
2018-02-24test: fix run script after changes jump list behaviourMaxime Coste
source the rc file *after* selecting the target text to ensure eventual hooks will not interfere.
2018-02-07test: fix run script use of non standard `\+` in sed regexMaxime Coste
2017-12-03test: fix support for '(' in initial selected textMaxime Coste
2017-06-27Do not allow repeating last insert when we are not in normal modeMaxime Coste
<a-;>. is not accepted anymore. Note that <a-;> are not repeatable currently anyway (That could be fixed, athough not trivial). Fixes #1469
2017-06-15Use more correct `[ -f <file> ]` in test runnerMaxime Coste
2017-02-21Refactor test run scriptMaxime Coste
2016-12-17Fix more uses of echo in the test run scriptMaxime Coste
2016-12-17Use printf instead of echo for displaying modified linesMaxime Coste
Avoid eventual interpretation of escapes in the line.
2016-12-17Respect TMPDIR in test run scriptMaxime Coste
2016-12-16Change the test session name to avoid hitting the unix socket path length limitMaxime Coste
On travis-ci, it seems the combination of a set TMPDIR and long sessions names makes the test framework hit the path lenght limit.
2016-06-20Do not preserve registers by default when exec/eval in a non draft contextMaxime Coste
Fixes #700
2016-05-10Improve test scriptMaxime Coste
2016-05-10Improve test runscript to avoid false positives when an output is not generatedMaxime Coste
2016-05-10preserve diff leading whitespaces when displayin them in the test runnerMaxime Coste
2016-04-27Fix handling of expected to fail testsMaxime Coste
2016-04-27Fix test runner use of sed -rMaxime Coste
2016-03-17Update test run script, was not writing test name in some casesMaxime Coste