Commit graph

691 commits

Author SHA1 Message Date
Thomas Lauf
35dc22c8ef Enter commit hash for release 1.4.3
Set current version to `1.4.3-dev`
Fix test `version.t` to correctly verify version string

Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
2021-05-28 14:29:25 +02:00
Thomas Lauf
0b74e850fb Fix pyenv setup
Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
2021-05-27 22:02:02 +02:00
Thomas Lauf
29d3043f29 Update copyright ranges
Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
2021-05-27 21:11:32 +02:00
Thomas Lauf
379959e017 Optimize imports
Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
2021-05-27 21:11:31 +02:00
Shaun Ruffell
e170e344af test/modify: Remove a few unused variables
I left some unused varaibles in a new test functions after copy-paste.

This addresses @laufts comments on #423.

Signed-off-by: Shaun Ruffell <sruffell@sruffell.net>
2021-05-19 12:22:22 +02:00
Shaun Ruffell
3ea086dcff Allow getTracked to match intervals that intersect with filter
It is not sufficient to stop looking for matching intervals if the
interval start time is before the filter. We really want to make sure
that we pick up any intervals that intersect with the filter.

Fixes bug introduced in (a98bd14 "Simplify getIntervalsById and
getTracked") as part of #423.

Signed-off-by: Shaun Ruffell <sruffell@sruffell.net>
2021-05-19 12:22:22 +02:00
Shaun Ruffell
92697cc1ad test:opensuse1500: Update asciidoctor to 2.0.15
This also installs asciidoctor 2.0.15 explicitly so that if the latest
is changed upstream the update-alternatives line will not break.

Signed-off-by: Shaun Ruffell <sruffell@sruffell.net>
2021-05-16 12:43:49 +02:00
Shaun Ruffell
bba56cc633 getIntervalsById: Only add truly synthetic intervals to synthetic vector
This fixes an error where the latest interval, a non-synthetic interval,
is added to the synthetic array (and marked synthetic) if flatten() is
otherwise not able to convert it to a group of synthetic intervals.

When modify was attempting to edit this interval, it would fail since
synthetic intervals should not be written to the database unless the
database is being flattened and timewarrior believed the interval to be
modified was synthetic.

Closes #422

Signed-off-by: Shaun Ruffell <sruffell@sruffell.net>
2021-05-16 12:43:49 +02:00
Thomas Lauf
4c8ccd99c3 Add Fedora 33 test image
Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
2021-04-10 23:15:30 +02:00
Thomas Lauf
a2507be7ea Add assertion for interval count
Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
2021-04-10 23:04:20 +02:00
Shaun Ruffell
0460656afe Allow tags to be enclosed in double quotes
Closes #159

Signed-off-by: Shaun Ruffell <sruffell@sruffell.net>
2021-04-10 22:52:04 +02:00
Shaun Ruffell
fd6d57dbc2 Use json::{encode|decode} for reading / writing JSON.
The JSON library in libshared has functions to esacpe JSON's special
characters, but they are not used by default.

Closes #416
Related to #261

Signed-off-by: Shaun Ruffell <sruffell@sruffell.net>
2021-04-10 22:52:04 +02:00
Shaun Ruffell
2897379b14 test:summary.t: Single digit week test should use logical or
The bitwise or, `|` had higher precendence than the `>` test. Fixes the
following error:

  not ok 4 - summary.t: Summary should work with :all hint
  # FAIL: AssertionError on file test/summary.t line 213 in test_with_all_hint: 'self.assertIn("""':
  #       '
  # Wk Date       Day ID Tags    Start      End    Time   Total
  # -- ---------- --- -- ---- -------- -------- ------- -------
  # W13 2021-04-04 Sun @3 FOO  10:00:00 11:00:00 1:00:00 1:00:00
  # W14 2021-04-05 Mon @2 BAR  10:00:00 11:00:00 1:00:00 1:00:00
  # W14 2021-04-06 Tue @1 BAZ  10:00:00 11:00:00 1:00:00 1:00:00
  #
  #                                                     3:00:00
  # ' not found in '
  # Wk  Date       Day ID Tags    Start      End    Time   Total
  # --- ---------- --- -- ---- -------- -------- ------- -------
  # W13 2021-04-04 Sun @3 FOO  10:00:00 11:00:00 1:00:00 1:00:00
  # W14 2021-04-05 Mon @2 BAR  10:00:00 11:00:00 1:00:00 1:00:00
  # W14 2021-04-06 Tue @1 BAZ  10:00:00 11:00:00 1:00:00 1:00:00
  #
  #                                                      3:00:00
  #
  # '

Signed-off-by: Shaun Ruffell <sruffell@sruffell.net>
2021-04-10 22:52:04 +02:00
Shaun Ruffell
d92ce2110f test: The tests depend on the documentation.
The help.t test wants to verify that some of the man pages exist.
Therefore we need to make sure the documentation is built, otherwise:

  $ git clean -ffdx .
  $ cmake -DCMAKE_BUILD_TYPE=Debug .
  $ make test

Will fail some of the help.t tests.

Signed-off-by: Shaun Ruffell <sruffell@sruffell.net>
2021-04-10 22:52:04 +02: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
Thomas Lauf
65ef38658b Increase minimal CMake version
Compatibility with CMake < 2.8.12 will be removed from a future version of CMake.
According to our test images all supported distributions have CMake > 3

Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
2021-02-12 10:50:39 +01:00
Thomas Lauf
0fb7a88159 Ensure Ubuntu 16.04 docker image compiles Timewarrior with gcc >6
- libshared now requires C++14

Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
2021-01-26 13:36:54 +01:00
Thomas Lauf
ab240419df Ensure CentOS 7 docker image compiles Timewarrior with gcc >6
- libshared now requires C++14

Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
2021-01-26 13:36:03 +01:00
Thomas Lauf
1a6c30b93a Fix test summary.t for single-digit weeks
If summary is called during a single digit week, the respective column is only 2 characters wide

Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
2021-01-25 13:49:56 +01:00
Tomas Babej
e5870380a4
doc: Update copyright to 2021 2021-01-02 02:52:39 -05:00
Shaun Ruffell
ce021a87e3 test: Thread.isAlive() -> Thread.is_alive()
Python added Thread.is_alive() in 2.6 and removed Thread.isAlive() in
3.9.

This change is needed to run the tests with Python 3.9.

https://bugs.python.org/issue37804
Signed-off-by: Shaun Ruffell <sruffell@sruffell.net>
2020-11-21 15:34:04 +01:00
Thomas Lauf
532d1b4e91 Add test for get dom.tracked.tags with a tag with quotes
Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
2020-10-02 09:20:22 +02:00
Thomas Lauf
dafca6662d Accommodate tests for missing space at end of line
Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
2020-10-02 09:07:32 +02:00
Thomas Lauf
985717e9c8 Deactivate Gentoo Docker image due to its high maintenance costs
- See issue #380 for details

Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
2020-09-04 10:43:13 +02:00
Thomas Lauf
2e4d3266cf Add space
Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
2020-09-03 23:34:29 +02:00
Shaun Ruffell
ae5e44c558 CmdSummary: Show recent intervals that start later in day than first interval with :all
It was possible for `summary` command, when used with the :all hint, to
skip over any intervals that start later than the first interval in the
database.

Signed-off-by: Shaun Ruffell <sruffell@sruffell.net>
2020-09-03 21:56:22 +02:00
Thomas Lauf
86024b1a41 Set upper limit for summary table to now if both filter and latest interval are open
- Closes #378

Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
2020-08-29 19:26:30 +02:00
Thomas Lauf
87c91b1f79 Update copyright
Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
2020-08-29 11:27:50 +02:00
Thomas Lauf
1308a124bb Replace Fedora 28 and Fedora 29 by Fedora 31 and Fedora 32
Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
2020-08-23 12:54:22 +02:00
Thomas Lauf
60c138b959 Adding ubuntu20.04 to the test zoo
Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
2020-08-23 12:27:16 +02:00
Thomas Lauf
ac9998f01c Add docker test images for CentOS 7 and 8
Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
2020-08-22 12:52:40 +02:00
Thomas Lauf
ffe329cd30 Adding centos8 to the test zoo
Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
2020-08-22 11:39:32 +02:00
Thomas Lauf
e451a135e2 Add test for command track with future time
Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
2020-08-21 23:04:03 +02:00
Shaun Ruffell
45eec2f7a0 Add test for command continue with future time
Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
2020-08-21 23:03:53 +02:00
Thomas Lauf
7405d2be96 Drop empty intervals during overlap resolution
- Closes #372

Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
2020-08-21 18:08:13 +02:00
Thomas Lauf
8daf11328d Add starting times to start command
- It seems that recent changes made the `stop` command faster such that these tests aborted with "The end of a date range must be after the start."

Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
2020-08-19 15:41:52 +02:00
Thomas Lauf
990e0772d0 Add tests for stop command
- Stop with no datetime (rare case of e.g. `timew stop :all`)
    - `stop` with tag after `start` without tags
2020-08-19 15:41:34 +02:00
Thomas Lauf
02491f8153 Restore behaviour for adding a new interval with same tag set
- Closes #351

Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
2020-08-14 22:33:16 +02:00
Shaun Ruffell
22dc0efa70 test: Add test to ensure Datafile throws when deleteInterval fails
Signed-off-by: Shaun Ruffell <sruffell@sruffell.net>
2020-08-11 10:39:34 +02:00
Shaun Ruffell
48baa27057 test: Move TempDir to standalone file
I would like to use TempDir for the Datafile test in order to cleanup
any datafiles created as part of the test.

Signed-off-by: Shaun Ruffell <sruffell@sruffell.net>
2020-08-11 10:39:34 +02:00
Shaun Ruffell
eae8746df2 test: Add the timew binary as dependency of test target
If the timew binary changes, we should rebuild it before running
through the python tests.

Signed-off-by: Shaun Ruffell <sruffell@sruffell.net>
2020-08-11 10:39:34 +02:00
Shaun Ruffell
c75d9fefad test: Remove unused variables from DatetimeParser.t
Quiets the following warnings when building the test:

  test/DatetimeParser.t.cpp: In function ‘int main(int, char**)’:
  test/DatetimeParser.t.cpp:163:7: warning: unused variable ‘hm’ [-Wunused-variable]
     int hm  = (12 * 3600) + (34 * 60);      // The time 12:34:00 in seconds.
         ^~
  test/DatetimeParser.t.cpp:164:7: warning: unused variable ‘z’ [-Wunused-variable]
     int z   = 3600;                         // TZ offset.
         ^
  test/DatetimeParser.t.cpp:317:7: warning: unused variable ‘t8a’ [-Wunused-variable]
     int t8a   = (8 * 3600);
         ^~~
  test/DatetimeParser.t.cpp:318:7: warning: unused variable ‘t830a’ [-Wunused-variable]
     int t830a = (8 * 3600) + (30 * 60);
         ^~~~~
  test/DatetimeParser.t.cpp:319:7: warning: unused variable ‘t8p’ [-Wunused-variable]
     int t8p   = (20 * 3600);
         ^~~
  test/DatetimeParser.t.cpp:320:7: warning: unused variable ‘t830p’ [-Wunused-variable]
     int t830p = (20 * 3600) + (30 * 60);
         ^~~~~
  test/DatetimeParser.t.cpp:321:7: warning: unused variable ‘t12p’ [-Wunused-variable]
     int t12p  = (12 * 3600);
         ^~~~
  test/DatetimeParser.t.cpp:322:7: warning: unused variable ‘t1p’ [-Wunused-variable]
     int t1p   = (13 * 3600);
         ^~~
  test/DatetimeParser.t.cpp:325:7: warning: variable ‘adjust’ set but not used [-Wunused-but-set-variable]
     int adjust = (time_now.hour () > 10 || (time_now.hour () == 10 && time_now.minute () > 30)) ? 86400 : 0;
         ^~~~~~

Signed-off-by: Shaun Ruffell <sruffell@sruffell.net>
2020-08-11 10:39:34 +02:00
Shaun Ruffell
b2a8fe6f55 test: Add tests for -1, 0, 1, and 2 'journal.size' settings
Signed-off-by: Shaun Ruffell <sruffell@sruffell.net>
2020-08-10 22:24:52 +02:00
Shaun Ruffell
0a4644bfc7 AtomicFile: Add size() and remove() methods
Signed-off-by: Shaun Ruffell <sruffell@sruffell.net>
2020-08-10 22:24:52 +02:00
Thomas Lauf
6bf708dbeb Use dynamic test data for interval enclosing a month border in delete.t
Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
2020-07-17 13:59:05 +02:00
Thomas Lauf
90b5b1085e Adapt delete.t and move.t as today is now interpreted as a range
Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
2020-07-15 17:22:32 +02:00
Shaun Ruffell
cc82f468e1 CmdStart: Honor the :adjust flag when overwriting a currently open interval
Move the adjustment of a new open interval that is enclosed by the
current open interval into the validation processing, where the other
overlap resolution takes place.

This will allow the start command to honor the :adjust flag when
starting a new interval that predates the current open interval.

Closes #326

Signed-off-by: Shaun Ruffell <sruffell@sruffell.net>
Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
2020-07-12 12:27:31 +02:00
Shaun Ruffell
4aacba47df CmdStart: Do not assume :all hint means now
Signed-off-by: Shaun Ruffell <sruffell@sruffell.net>
2020-07-08 21:28:41 +02:00
Shaun Ruffell
6a52a412ba CmdStart: Do not silently fail if tags match
It was possible previously to start an interval with a filter earlier
than the current filter, and if the tags matched, the command would
report success without actually moving the start time.

Signed-off-by: Shaun Ruffell <sruffell@sruffell.net>
2020-07-08 21:28:41 +02:00
Thomas Lauf
7bc511bc73 Update tests for TagInfoDatabase
- Add tests for JSON output
- Separate different test scenarios
- Optimize JSON output in `TagInfoDatabase::toJson ()`

- Closes #325

Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
2020-07-02 22:42:45 +02:00