Commit graph

10677 commits

Author SHA1 Message Date
Fabian Homborg
cdbd0891f7 Remove invocation tests
These are now all performed by littlecheck, so there's no need for the
entire target anymore.
2019-06-25 22:31:45 +02:00
Fabian Homborg
a33c2f0bce Port config tests to littlecheck
This required a bit of thinking.

What we do is we have one test that fakes $HOME, and then we do the
various config tests there.

The fake config we have is reused and we exercise all of the same codepaths.
2019-06-25 22:31:06 +02:00
Fabian Homborg
10949648e7 Port qmark1 test to littlecheck
This one just needs a random home.
2019-06-25 22:31:06 +02:00
Fabian Homborg
5c7b7fd609 Readd bad-switch and directory-redirection tests
Made possible by the power of regex.
2019-06-25 22:30:58 +02:00
Fabian Homborg
b9c1f4b122 Remove ported tests 2019-06-25 21:00:13 +02:00
Fabian Homborg
21667850b3 tests/test.fish: Normalize littlecheck output
This prints a green "ok" with the duration, just like the rest of the
tests.

Note that this clashes a bit with
https://github.com/ridiculousfish/littlecheck/pull/3.

(also don't check for python again and again and again)
2019-06-25 20:57:37 +02:00
Fabian Homborg
9d5620c170 Port most of the invocation tests to littlecheck
This is a bit weird sometimes, e.g. to test the return status (that
fish actually *returns $status*), we use a #RUN line with %fish
invoking %fish, so we can use the substitution.

Still much nicer.

The missing scripts are those that rely on config.
2019-06-25 20:56:29 +02:00
Fabian Homborg
d415350aaf reader: Add delete-or-exit bind function
This is an important binding and should therefore be in C++.
2019-06-25 19:57:00 +02:00
Fabian Homborg
c392a05db0 functions/__fish_anypython: Also try python{3,2}.7
NetBSD!!!!! *shakes fist*
2019-06-25 19:40:22 +02:00
Fabian Homborg
93d9fa4551 tests/test.fish: Run littlecheck with any python
Some operating systems don't have a "python" symlink, so we just run
it with the first python we find.
2019-06-25 19:25:36 +02:00
Fabian Homborg
7778e62bd7 CI: Add python dependencies
Littlecheck needs it.
2019-06-25 19:17:53 +02:00
Fabian Homborg
1bba77e485 Port string tests to littlecheck
`wc -l tests/string.*`
  329 tests/string.err
  422 tests/string.in
  520 tests/string.out
 1271 total

`wc -l tests/checks/string.fish`
 555 tests/checks/string.fish

and it looks nicer. 'nuff said.
2019-06-25 17:26:36 +02:00
Fabian Homborg
77d8487078 string: Also stop printing documentation
Especially as, in this case, the documentation is quite massive.

Caught by porting string's test to littlecheck.

See #3404 - this was already supposed to be included.
2019-06-25 17:26:30 +02:00
Fabian Homborg
60edc9a45d Port argparse tests to littlecheck
This is a nice test (ha!) for how this works and what littlecheck can
do for us.

1. Input is now the actual file, not "Standard Input" anymore. So
any errors mentioning that now include the filename.
2. Regex are really nice for filenames, but especially for line
numbers
3. It's much nicer to have the output where it's created, instead of
needing to follow three files at the same time.
2019-06-25 16:11:24 +02:00
Fabian Homborg
cc1388a78a Upgrade littlecheck to allow whitespace before comments
Necessary for test files that pass fish_indent.
2019-06-25 16:11:24 +02:00
Fabian Homborg
427a18c1ea fish_git_prompt: Add a way to use the informative chars
$__fish_git_prompt_use_informative_chars will use the informative
chars without requiring informative mode (which is really frickin'
slow!).

See #5726.

[ci skip]
2019-06-25 16:11:18 +02:00
Fabian Homborg
caedf01c00 Revert "Latch signal handlers"
This reverts commit 7ed1022cf4.

Fixes #5962.
2019-06-25 11:25:09 +02:00
Fabian Homborg
3bc392a6b3 functions/__fish_print_hostnames: Check getent's status
This previously effectively checked `string split ' '`s return status,
which was false if it didn't split anything. And while that should be
true if getent fails (because it should produce no output), it's also
true if it doesn't print a line with multiple aliases. Which should be
fairly typical.

Instead we use our new-found $pipestatus to check what getent returns,
in the assumption that it'll fail if it doesn't support hosts.

Follow up to 8f7a47547e.

[ci skip]
2019-06-25 08:40:31 +02:00
Fabian Homborg
9cd29e5166 cmake: Add -Wno-redundant-mode
This warns about one bit in env_dispatch, where a comment explains
that the move *is* necessary, on a different libc++.
2019-06-24 22:11:49 +02:00
Fabian Homborg
8f7a47547e functions/__fish_print_hostnames: Don't run getent hosts twice
`getent hosts` is expensive-ish - ~50ms, so we don't want to run it
twice just to figure out it works.

Apparently this works everywhere but CYGWIN and possibly older
OpenBSD, but we don't want to explicitly blacklist those.

[ci skip]
2019-06-24 19:19:31 +02:00
ridiculousfish
27e4d1d62d Revert "Revert "Don't service ioport completions if data is available on stdin""
This reverts commit 005e6f2ab8.

This allows new text entry to take priority over highlighting, improving the
performance of pasting.
2019-06-23 16:45:06 -07:00
ridiculousfish
89fb408eb6 Migrate some job flags into const properties struct
This helps clarify which parts of a job are mutable, and which are constant.
2019-06-23 12:42:44 -07:00
ridiculousfish
5362161343 Call tcsetgrp() in child processes again
25afc9b377 made this unnecessary by
having child processes wait for a signal after fork(), but this change
was later reverted. If we artificially slow down fish (e.g. with a sleep)
after the fork call, we see commands getting backgrounded by mistake.

Put back the tcsetgrp() call.
2019-06-23 12:42:44 -07:00
ridiculousfish
8255c01edb Rename setup_child_process to child_setup_process
Try to name all functions called after fork with "child" prefix.
2019-06-23 12:42:44 -07:00
Shun Sakai
e7b42615c8 Add FFmpeg completions (#5922)
* Add FFmpeg completions

* Fix to use builtin command
2019-06-23 16:40:26 +02:00
Fabian Homborg
e921bd60c3 docs: Build index, tutorial and faq as man pages
This was clearly intended for index, but because it was called "fish"
it was overwritten by the "fish" command man page.

I also added the tutorial and faq. Both of those might not be *ideal*
as man pages (the tutorial makes references to colors that won't show
up), but it's better to provide them than not.

Hat-tip to @wwared

See #5521.

[ci skip]
2019-06-23 16:16:44 +02:00
David Adam
8f3a0dcc8b cmake: harmonise argument to foreach/endforeach
Fixes a warning introduced in 40d91b7e77.
2019-06-23 16:00:40 +08:00
ridiculousfish
40d91b7e77 Allow running test suites independently
This makes test_low_level, test_interactive, test_invocation, and
test_fishscript independent. This allows running a smaller subset of tests.

To prevent all tests running in parallel, we also have new targets
serial_test_low_level, serial_test_interactive, etc. which have the
dependency chain that enforces serial execution.
2019-06-22 14:17:10 -07:00
ridiculousfish
db703c273d Remove some stale comments from Tests.cmake
These comments were used to refer back to the autotools build, but the
autotools build is no more and CMake is now the source of truth.
2019-06-22 13:12:49 -07:00
Fabian Homborg
8bfaf9e7ef Add test for erasing unloaded functions
Not perfect, but better than nothing.
2019-06-22 18:20:54 +02:00
Fabian Homborg
9b54a53758
Prevent not-yet-loaded functions from loaded when erased (#5951)
* Prevent not-yet-loaded functions from loaded when erased

Today, `functions --erase $function` does nothing if the function
hasn't been autoloaded yet.

E.g. run, in an interactive session

    > functions --erase ls
    > type ls

and be amazed that it still shows our default `ls --color=auto`
wrapper function.

This seems counter-intuitive - removing a function ought to remove it,
whether it had been executed before or not.

* doc/changelog
2019-06-22 11:08:36 +02:00
Lily Ballard
fe2ec1e4f8
Merge pull request #5943 from lilyball/string_collect
Add new `string` subcommand `string collect`
2019-06-22 00:30:20 -07:00
infix
ae2c40ebdb Updated DNF auto completion 2019-06-21 09:24:37 -07:00
Fabian Homborg
6c05005f0f docs: Document indexing double-variable-expansion
Fixes #5886.

[ci skip]
2019-06-19 12:56:01 +02:00
Fabian Homborg
370f5356a1 Move "character has no narrow representation" to flog
This was a warning, which is kind of ridiculous, as it's inactionable
error spew.

Fixes #2815.
2019-06-19 12:36:38 +02:00
ridiculousfish
9b9c6e312c Improve the docs from DEBUG_LEVEL to CATEGORY_GLOB
This stuff still isn't documented properly.
2019-06-17 09:07:43 -07:00
yogendra
ad1d81a090 Fix5910 documentation update 2019-06-17 09:01:30 -07:00
Lily Ballard
181e44d331 Invert the flag for string collect
Instead of requiring a flag to enable newline trimming, invert it so the
flag (now `--no-trim-newlines`) disables newline trimming. This way our
default behavior matches that of sh's `"$(cmd)"`.

Also change newline trimming to trim all newlines instead of just one,
again to match sh's behavior.
2019-06-16 16:40:14 -07:00
Lily Ballard
b41e5cbbb7 Add string collect
The `string collect` subcommand behaves quite similarly in practice to
`string split0 -m 0` in that it doesn't split its output, but it also
takes an optional `--trim-newline` flag to trim a single trailing
newline off of the output.

See issue #159.
2019-06-16 15:51:57 -07:00
ridiculousfish
5b5887ea99 Correct capitalization of complete_and_search 2019-06-16 14:38:27 -07:00
ridiculousfish
fcf0593dfb Port printf tests to littlecheck and teach the tester how to run it
This adds support for .check files inside the tests directory. .check
files are tests designed to be run with littlecheck.

Port printf test to littlecheck and remove the printf.in test.
2019-06-16 14:10:41 -07:00
ridiculousfish
476185748f Add littlecheck.py
This will be the new testing tool replacing the diff-based tests.

Imported from https://github.com/ridiculousfish/littlecheck
Version e28281273e54745c7d7aabeeb4b085af477d584b
2019-06-16 13:27:06 -07:00
Lily Ballard
5fd3bf79f5 Don't trim trailing whitespace on .rst files
Our existing .rst files have lines with trailing whitespace in them,
which I can only assume is deliberate, so update the editorconfig to
stop trimming trailing whitespace for these files.
2019-06-15 22:36:07 -07:00
ridiculousfish
360116221a Switch history_t to use owning_lock internally
This removes a lot of tricky manual locking. It also removes the "main
thread" dependency.
2019-06-14 20:49:17 -07:00
yogendra
6bed255a52 Fix Issue 5910 2019-06-14 08:56:42 -07:00
ridiculousfish
1c66d56d3a Add debug categories for reaping processes 2019-06-13 14:29:13 -07:00
Fabian Homborg
b4792bde19 Remove brew completions
Leave a note in place

Fixes #5892.

[ci skip]
2019-06-12 20:42:20 +02:00
Fabian Homborg
77103ddbab Dishonour
[ci skip]
2019-06-12 10:22:46 +02:00
Fabian Homborg
4db7efb569 docs: Fix fish_opt options
This said "--required" when the option is called "--required-val".

Fixes #5931.

[ci skip]
2019-06-11 14:10:39 +02:00
Fabian Homborg
e363552ef0 screen: Include termios for NetBSD
Otherwise it won't build.
2019-06-11 11:34:14 +02:00