- 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>
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>
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>
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>
- 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>
- 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>
- 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>
- 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>
- 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>
- 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>
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>
- 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>
This test uses libfiu to create random failures in fputs and the write system
calls to verify out-of-space errors on the filesystem do not corrupt the
database.
Related to #155
Introduce AtomicFile and a test of this module to the code.
AtomicFile is like File, except all writes go to temporary files until
the class method finalize_all () is called and the temporary files are
copied over the real files. If any writes fail, like when there is no
more space on the filesystem, none of the files in the database will be
modified.
Since we need version 1.00 of libfiu, I have only added it to the debian
testing container, which includes libfiu-1.00 in the default repository.
Related to #155
Since the recent switch to python3, I've been noticing that some of the tests
have been aborting with the following error when I use LANG=en_US instead of
LANG=en_US.UTF-8:
UnicodeEncodeError: 'latin-1' codec can't encode character '\u0455' in position 57: ordinal not in range(256)
Arguably, I should run with a unicode locale while running the test, but it
*looks* to me like the original ѕ was not intended.
When some of the individual tests fail to run, the `make test` target would
still pass since test/problems would not return an error which could hide the
fact that there are problems in the test.
With this change, if you do not have the python dateutil package, you will now
get output like:
'test_totals.t' failed to run any tests.
Passed: 975
Failed: 1
Unexpected successes: 0
Skipped: 0
Expected failures: 0
Runtime: 4.83 seconds
Or, if you do not have UTF-8 encoding set in your language you will get
something like:
'track.t' failed to run all tests.
'stop.t' failed to run all tests.
'start.t' failed to run all tests.
'test_totals.t' failed to run all tests.
Passed: 941
Failed: 50
Unexpected successes: 0
Skipped: 0
Expected failures: 0
Runtime: 4.55 seconds