Commit graph

23 commits

Author SHA1 Message Date
Thomas Lauf
70a1082224 Use local man pages in tests
We need to set the value of `MANPATH` to the local man pages when running helper function 'run_cmd_wait_nofail'.
Use the already set Timewarrior environment for this.

Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
2023-04-14 13:50:35 +02:00
Thomas Lauf
14bed139f6 Update copyrights
Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
2023-04-04 22:44:44 +02:00
Thomas Lauf
25ff673521 Beautify tests
- Replace unused return variables with '_'
- Use 'expected' and 'actual' for test values
- Add whitespace

Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
2022-11-25 16:54:10 +01:00
Thomas Lauf
3d3faafcba Compare output of 'timew help start' to 'man timew-start'
The command timew help should redirect to the man tool.
Instead of testing that the header of the output matches some reg ex,
test that the outputs of `timew help` and `man` are equal

Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
2022-11-25 16:52:39 +01:00
Thomas Lauf
d8b7080dcb Compare output of command help with unknown argument with corresponding output of man command
The error message may be different depending on the man tool used.
Therefore, instead of hard-coding it into the test, ensure it is the same as produced by the man command

Closes #512

Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
2022-11-25 16:50:29 +01:00
Thomas Lauf
b189ccb020 Replace roff man pages with asciidoctor
This replaces the generation of man pages on project setup
by a on-demand generation via asciidoctor.
An exception are the man pages for the commands `day`, `month`, and `week`
which are simply redirects to the man page `timew-chart.1`. Those are now
static files in the Timewarrior repository.

A CMake find module to detect asciidoctor was added.
If asciidoctor is found, the targets `doc`, `man1`, and `man7` are created.
Those targets are also added to the default build target.

If asciidoctor is not available, the target `doc` is available, but it only
emits a message to install asciidoctor first.

Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
2021-02-21 20:58:30 +01:00
Tomas Babej
e5870380a4
doc: Update copyright to 2021 2021-01-02 02:52:39 -05:00
Thomas Lauf
ad58309159 Update Copyright
Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
2020-04-19 12:41:23 +02:00
Shaun Ruffell
b5df2a2aa5 CmdHelp: Return error if man command fails
I feel this is expected behavior, but also eliminates the following compile time
warning on one of my systems:

  warning: ignoring return value of ‘int system(const char*)’, declared with
    attribute warn_unused_result [-Wunused-result]

Signed-off-by: Shaun Ruffell <sruffell@sruffell.net>
2020-03-01 21:02:43 +01:00
Thomas Lauf
34a152c794 Replace assertRegexpMatches with assertRegex
- #259

Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
2019-12-11 10:20:33 +01:00
Thomas Lauf
9dd8257cc0 Replace assertEquals with assertEqual
- #259

Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
2019-12-11 10:20:33 +01:00
Thomas Lauf
7fa7ca5f04 Remove vim annotations
Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
2019-12-11 10:20:33 +01:00
Thomas Lauf
f53e1cef6d Switch to python 3
- #259

Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
2019-12-11 10:20:32 +01:00
Shaun Ruffell
a021e8402f Ignore stderr output in TestHelp.test_help_with_command_should_show_man_page 2019-11-19 19:45:18 +01:00
Thomas Lauf
cd098289f5 Add assertion for stderr
Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
2019-08-26 12:53:03 +02:00
Thomas Lauf
8b5a701eeb Require python2 not python2.7 for tests
Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
2019-06-29 01:31:08 +02:00
Thomas Lauf
712b4b78b2 Revert "Run test with available python"
This reverts commit 6b89e122

Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
2019-06-24 21:10:57 +02:00
Thomas Lauf
6b89e12287 Run test with available python
- do not enforce python 2.7

Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
2019-06-22 21:21:11 +02:00
Thomas Lauf
6e855cc998 Drop internal help for man pages
Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
2019-06-21 23:32:11 +02:00
Thomas Lauf
037550b791 '-h' should show help
Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
2019-05-18 18:40:26 +02:00
Thomas Lauf
6bb4f981cb Merge branch '212-fix-help-handling' of git://github.com/sruffell/timewarrior into sruffell-212-fix-help-handling 2019-05-07 22:08:23 +02:00
Thomas Lauf
08d2a0e15a Add tests for command help
Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
2019-05-07 21:12:22 +02:00
Shaun Ruffell
c76d004897 #212: "--help" should show help, not considered to be a tag.
This change makes any instance of '--help' on the command line to be made the
command for this particular invocation.
2019-04-07 16:48:24 -05:00