Commit graph

616 commits

Author SHA1 Message Date
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
Thomas Lauf
d99872eb90 Finish implementation of 'continue by tag'
- This adds the last bits to the PR started by Christian Roesch:
- Some code formatting
- Specifying both id(s) and tag(s) is an error
- Clear range for tag filter: The range is meant to set the new interval's range, not the filter's
- Added tests
- Overhauled test using relative times and testing exported intervals instead of command line output
- Closes #241

Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
2020-07-02 19:59:47 +02:00
Christian Rösch
3def4b10c4 Refactor code as suggested and add tests. 2020-07-01 16:16:58 +02:00
Christian Rösch
f3280966e0 Allow continue by tag. 2020-07-01 16:16:58 +02:00
Thomas Lauf
6db29f1df5 Move overlap resolution from CmdContinue to function autoAdjust
- Only an open interval can truncate another open interval.
  Otherwise the `:adjust` hint has to be applied

Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
2020-07-01 08:12:04 +02:00
Thomas Lauf
63f230013a Detect whether a date is meant as range
- Add DatetimeParser::parse_range: If a date contains no time, it is assumed to be a fixed range, else an open range starting at given datetime
- Add tests for summary with named dates 'yesterday' and 'today'
- Remove closing of filter in CmdSummary.cpp
- Closes #333

Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
2020-06-28 20:52:43 +02:00
Thomas Lauf
2906f36830 Add test for command summary with :all hint
Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
2020-06-22 22:21:27 +02:00
Thomas Lauf
7e11fde992 Remove template.t from test folder
- This file was development only, now any other test file can serve as template for new tests
- Closes #303

Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
2020-05-22 09:16:08 +02:00
Thomas Lauf
c71eeb6dfd Add DOM-query for ids
- Closes #126

Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
2020-05-10 21:44:30 +02:00
Thomas Lauf
a508dd21ea Get and use filter from CLI when processing DOM references
- Closes #188

Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
2020-05-10 21:44:30 +02:00
Thomas Lauf
6e5236d472 Add DOM query dom.tracked.tags
Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
2020-05-10 21:44:30 +02:00
Thomas Lauf
5c234c95f9 Move test setup to the test methods
Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
2020-05-10 21:44:30 +02:00
Thomas Lauf
ad58309159 Update Copyright
Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
2020-04-19 12:41:23 +02:00
Thomas Lauf
41c50e009c Add test for export with tag filter
Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
2020-03-06 16:13:00 +01:00
Shaun Ruffell
42872f5168 test: Add test for filtering non-contiguous intervals
Related to #293

Signed-off-by: Shaun Ruffell <sruffell@sruffell.net>
2020-03-06 16:10:19 +01:00
Thomas Lauf
bf87509329 Handle case of empty interval, fix tests
Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
2020-03-03 22:24:45 +01:00
Thomas Lauf
368d033ce5 Rename atomic to AtomicFileTest
- Avoid possible clash with lib atomic on macOS, e.g. in /Library/Developer/CommandLineTools/usr/include/c++/v1/memory:668

Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
2020-03-02 21:42:53 +01:00
Thomas Lauf
551964eb15 Fix check for libfiu usage
- on macOS, use "otool -L" instead of "ldd"

Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
2020-03-01 21:08:32 +01: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
9ae84426d9 Upgrade pip
Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
2020-03-01 20:33:41 +01:00
Thomas Lauf
fa4371d30c Return exit code of ./problems, not the last command, on macOS
Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
2020-03-01 20:33:40 +01:00
Thomas Lauf
6b75a5f92d Set bufsize to '-1' so we use io.DEFAULT_BUFFER_SIZE
- Removes RuntimeWarning: line buffering (buffering=1) isn't supported in binary mode, the default buffer size will be used

Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
2020-02-23 19:26:29 +01:00
Thomas Lauf
72f13b859f Remove obsolete code
Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
2020-02-23 19:03:54 +01:00
Thomas Lauf
cb7240fe1a Linebreak after <"""> in multiline doc-comments
Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
2020-02-23 19:03:54 +01:00
Thomas Lauf
457e73f772 Remove unnecessary input
- ":yes" hint already takes care of that

Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
2020-02-23 19:03:54 +01:00
Thomas Lauf
bb73c293ef Remove line breaks
Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
2020-02-23 19:03:54 +01:00