Commit Graph

1200 Commits

Author SHA1 Message Date
Martchus 3a06641bb9 Improve docs for `DateTimeExpression` 2022-08-13 14:07:57 +02:00
Martchus 5fe03c23a2 Rename `DateTimeParts::Millisecond` to `…::SubSecond`
We're currently just tracking whether the second has a fraction so this is
more fitting.
2022-08-13 14:07:37 +02:00
Martchus f20d596785 Add `DateTimeExpression` to keep track of parsed timestamp parts
The existing timestamp parsers already internally keep track what parts
have been parsed via an index variable. This change exposes this
information as it can sometimes be useful to know what parts were actually
present in the timestamp.
2022-08-12 20:45:06 +02:00
Martchus fea69428d1 Apply cmake-format 2022-08-11 23:29:37 +02:00
Martchus aa4be0ef70 Fix build errors with CMake 3.24.0
See note in comment; concrete example of build error (when building
syncthingtray against qtforkawesome built with CMake 3.24.0):

```
CMake Error at plasmoid/lib/CMakeLists.txt:15 (find_package):
  Found package configuration file:

    /usr/share/qtquickforkawesome-git/cmake/qtquickforkawesome-gitConfig.cmake

  but it set qtquickforkawesome-git_FOUND to FALSE so package
  "qtquickforkawesome-git" is considered to be NOT FOUND.  Reason given by
  package:

  The following imported targets are referenced, but are missing:
  qtforkawesome-git
```
2022-08-09 20:51:42 +02:00
Martchus 0c6fa07b53 Add `Argument::addSubArguments()` and improve related documentation 2022-08-06 19:14:02 +02:00
Martchus d2873e451d Bump minor version 2022-08-06 19:05:02 +02:00
Martchus a1aef36c83 Add `checkFlagEnum()` and tests for `flagenumclass.h` 2022-07-29 22:01:51 +02:00
Martchus 82f835546e Bump minor version 2022-07-29 22:01:16 +02:00
Martchus fe6ad81340 Fix copy helper for large data sizes on 32-bit platforms
On 32-bit platforms `std::size_t` is just 4 bytes big which is not enough
to handle large data sizes. Using `std::streamsize` would likely be most
appropriate but switching signdness is likely not the best idea for
compatibility and it would mean a comparison with different signdness
because the buffer size is still `std::size_t`. So using `std::uint64_t`
now.
2022-07-14 00:30:40 +02:00
Martchus 7db3cfc274 Bump patch version 2022-07-14 00:25:59 +02:00
Martchus 639018285d Fix typos 2022-06-26 11:48:44 +02:00
Martchus 8f4ca38c69 Update documentation of argument parser 2022-06-26 11:45:13 +02:00
Martchus 3c769fa242 Add greedy-flag for argument parser
This is useful if one needs to pass subsequent arguments as-is to another
nested argument parser.
2022-06-26 11:24:36 +02:00
Martchus 08194f5d32 Bump minor version 2022-06-26 11:19:03 +02:00
Martchus 3444e4bbb1 Improve argument parser tests
* Use auto
* Use `CPPUNIT_ASSERT_EQUAL` with `std::string_view` instead of `strcmp`
  for better error messages in case of a failure
* Avoid instantiating an `std::string` in checks using `std::string_view`
  instead
2022-06-26 11:18:36 +02:00
Martchus b1b811c57f Apply clang-format 2022-06-26 11:04:23 +02:00
Martchus 9e036a3f72 Allow enabling virtual terminal processing under Windows
* or disable use of ANSI-escape codes if not possible
* See https://github.com/Martchus/syncthingtray/issues/132
2022-06-07 16:46:54 +02:00
Martchus cf510f0397 Use macros from cstdlib instead of hard-coding exit codes 2022-05-21 12:37:36 +02:00
Martchus c931e2d928 Fix missing `#pragma GCC diagnostic push` 2022-05-21 12:13:01 +02:00
Martchus 7555e6854b Add test helper to use std::optional via CPPUNIT_ASSERT_EQUAL 2022-05-15 02:18:07 +02:00
Martchus c1152ca062 Ignore warning about possible null pointer dereferences appearing with GCC 12
Not sure why this warning is occurring but it is likely incorrect
2022-05-12 20:31:05 +02:00
Martchus f46855b130 Bump patch version 2022-05-12 20:09:06 +02:00
Martchus 24709861e2 Add stalebot config 2022-04-12 01:02:00 +02:00
Martchus c1e93738b6 Fix condition for avoiding `-static` flag
There's no `LINUX`; I suppose `UNIX` is specific enough as well.
2022-04-05 22:10:16 +02:00
Martchus 910432df4c Add copyright notice 2022-04-05 20:09:16 +02:00
Martchus 58c3506ca0 Add opt-out for enforcing static linkage (when generally aiming for static linkage) 2022-04-03 00:51:33 +02:00
Martchus 28a35e9673 Remove project name from headers dir if it already starts with it
This is useful if the repo contains headers in a directory called like the
project itself and should not have any effect on other projects.
2022-03-22 22:02:50 +01:00
Martchus f88ca7d16d Silence warning about type conversion in test helper
It is a possibly lossy conversion but good enough for a test helper.
2022-03-20 16:56:11 +01:00
Martchus 052f8d2bd2 Add helper to make native path from internal representaton 2022-03-17 22:31:11 +01:00
Martchus d4cf030ed9 Clarify that license is "GPL-2-or-later" 2022-03-15 21:29:10 +01:00
Martchus 3d59664021 Add `std::string_view` overloads to certain I/O functions 2022-03-04 21:04:22 +01:00
Martchus 77c353fb6c Add `TickType` and integer overloads to chrono utilities 2022-02-15 23:01:25 +01:00
Martchus a8fddad804 Add WorkingCopyMode::Cleanup 2022-01-08 23:35:01 +01:00
Martchus ef37ae437c Fix compile error with Clang related to diagnostic pragma
Fix
```
pragma diagnostic pop could not pop, no matching push
```

The GCC documentation says "If a pop has no matching push, the
command-line options are restored." but that's apparently not working here.
2021-12-20 22:46:38 +01:00
Martchus f81607be82 Possibly avoid ambiguous function call in conversion tests
This might avoid
```
/Users/oldfaithful/Local/tageditor/cpp-utilities/tests/conversiontests.cpp:29:15: error: call to 'swapOrder' is ambiguous static_assert(swapOrder(0xABCDEF1234567890ul) == 0x9078563412EFCDABul, "swapOrder(uint64)");
```

reported by https://github.com/Martchus/cpp-utilities/issues/22
2021-12-12 22:58:01 +01:00
Martchus b30028984a Ignore warning about possible null pointer dereference 2021-12-11 23:58:51 +01:00
Martchus 3b0ed313bc Avoid warning about using uninitialized variable 2021-12-11 23:58:51 +01:00
Martchus 6c7e8ae735 Avoid warning about out of bounds array access 2021-12-11 23:58:51 +01:00
Martchus 4f89aa3b53 Bump patch version 2021-12-11 23:58:51 +01:00
Martchus f20ea87f32 Fix using arguments in `configure_test_target` 2021-11-02 17:49:28 +01:00
Martchus 9cbff29c9e Fix passing application path when invoking tests
We need to pass the application's path here; not the path of the test
itself.
2021-11-02 17:48:09 +01:00
Martchus 11574209b3 Add experimental support for generating coverage report via gcc/gcov/lcov 2021-11-01 18:20:51 +01:00
Martchus 37c2b920d0 Remove obsolete check when configuring coverage with Clang
Building shared and static libraries at the same time has been removed as
of version 5 so this message would never be printed and it is not clear
anymore what the actual problem was.
2021-11-01 14:10:22 +01:00
Martchus 5563776061 Expose test name (created via `TestTarget.cmake`) for fixing downstream bug
This allows to set test properties in other projects as needed to fix
https://github.com/Martchus/syncthingtray/issues/116.
2021-10-12 23:38:54 +02:00
Martchus 5509caff89 Remove unused `META_CONFIG_PREFIX`
This variable was never actually used. I suppose I've been adding it for
places where the config should be added as a prefix. However, this would be
inconsistent and now would also mean a confusing overlap with the
namespacing feature. So let's just remove it.
2021-10-03 23:11:14 +02:00
Martchus 072b7b5136 Apply cmake-format 2021-10-03 23:06:20 +02:00
Martchus 347e283e8b
Merge pull request #21 from hrittich/upstream-patches
Fix namespace for file names
2021-10-03 19:48:57 +02:00
Hannah Rittich b8eee6d9d6 Fix namespace for file names 2021-10-03 02:13:27 +02:00
Martchus 2fc54ecdaa
Merge pull request #20 from hrittich/tmp
Allow configuration name as prefix
2021-10-02 21:58:07 +02:00