Commit Graph

856 Commits

Author SHA1 Message Date
Martchus dd41762b70 Add testDirPath() for finding directories with test files
The same as testFilePath(), just for directories.
2020-09-23 22:49:33 +02:00
Martchus 0b267c7959 Avoid duplicating the "lib" prefix
if the target name already starts with "lib"
2020-09-23 22:48:28 +02:00
Martchus a26f3d7e1a Avoid instantiating an std::string for find and replace parameters
This overloads should allow passing an std::string_view or C-string to
findAndReplace() without instantiating an std::string.
2020-09-19 15:40:32 +02:00
Martchus 26b6ef0486 Avoid 'not a git repository (or any of the parent directories)' during configuration
Try to append the Git revision only if the source directory is actually a
Git checkout.
2020-09-12 22:24:45 +02:00
Martchus 6f6c2e607f Reformat CMakeLists.txt with cmake-format 0.6.11 2020-08-11 23:13:09 +02:00
Martchus 60d9a80b6a Improve icon generation
* Remove PNG_ICON_CROP
    * Not sure how that was supposed to be useful because even for projects
      without PNG_ICON_NO_CROP it does not make much sense
* Test multiple sizes to determine the PNG path automatically
* Locate PNG in basic config so the path is also automatically determined
  for the macOS bundle as well
* Log status message when ffmpeg/png2icns are not available
* Format CMake code more nicely
2020-08-11 23:12:17 +02:00
Martchus 7dab98b257 Use a higher resolution for Windows icons for better High-DPI support 2020-08-05 18:21:52 +02:00
Martchus b363498f53 Allow specifying return type in joinStrings()
for joining an std::string from an std::vector<std::string_view>.
2020-07-25 22:53:46 +02:00
Martchus 84011c2768 Apply CMake format 2020-07-07 12:14:05 +02:00
Martchus 07e5752af8 Provide "End" phrases within phraseString() 2020-07-07 12:13:31 +02:00
Martchus d0076e24a7 Get rid of WINDOWS_EXT completely as it is now no longer used 2020-07-04 15:21:55 +02:00
Martchus 534aaf0b4d Fix 'OriginalFilename' in Windows RC file
Rely on generator expressions to get the correct filename. This has never
worked because WINDOWS_EXT was usually only set after WindowsResources has
been included.
2020-07-04 15:21:20 +02:00
Martchus 47850ace49 Remove leftovers from _run target
See c66420b1dc
2020-07-04 15:14:14 +02:00
Martchus b03332f37a Add "SOVERSION" as suffix to shared libraries for mingw-w64 targets
* Also enable the "lib" prefix which CMake would add by default again; it
  has only been removed to preserve compatibility with qmake when switching
  from qmake to CMake
* None of these changes are enabled by default to preserve compatibility
2020-07-04 14:43:26 +02:00
Martchus 6ed057b932 Add BinaryWriter::write overload for std::string_view 2020-06-26 22:06:44 +02:00
Martchus 63b5fb9c14 Add PROJECT_VARNAME and PROJECT_VARNAME_UPPER to config header 2020-06-23 02:06:29 +02:00
Martchus 942044ea30 Make cache variable doc string compatible with Qt Creator
The double quotes need to be removed from the doc string. Otherwise, Qt
Creator creates a line like
```
set("EXCLUDE_TESTS_FROM_ALL" "OFF" CACHE "BOOL" "specifies whether to exclude tests from the "all" target (enabled by default)" FORCE)
```
in its `qtcsettings.cmake` which doesn't work because the escaping is
missing.
2020-06-22 22:29:21 +02:00
Martchus f24f09f79a Fix setting test properties for coverage when special target name configured 2020-06-22 22:26:17 +02:00
Martchus 9d59ab5c29 Fix Traits::IsSpecializationOf for references
This check is also supposed to work for references so use the same approach
as for ignoring cv qualifiers.
2020-06-17 21:41:00 +02:00
Martchus 74b010cbb9 Make manually added test targets as part of the check target 2020-06-16 01:09:39 +02:00
Martchus 940593429a Allow ArgumentParserTests to pass when working dir present within testfiles dir 2020-06-16 01:03:39 +02:00
Martchus a9453483a7 Allow adding test targets manually 2020-06-15 22:28:19 +02:00
Martchus 52722be407 Add test helper execHelperAppInSearchPath() 2020-06-10 18:42:50 +02:00
Martchus 2ecc0adceb Add TODO for AdvancedIniFile 2020-06-04 20:49:25 +02:00
Martchus 5dbcd1b391 Update README.md 2020-06-04 20:49:02 +02:00
Martchus 668b149647 Initialize AdvancedIniFile::Field by default with IniFileFieldFlags::HasValue
The case that there's no equal sign is rather odd so don't make it the default.
2020-05-01 13:58:44 +02:00
Martchus 26b0d2d97c Avoid some test classes to show up in the documentation 2020-05-01 13:47:06 +02:00
Martchus 43550b6d55 Add AdvancedIniFile for better preserving certain aspects like comments 2020-05-01 13:47:06 +02:00
Martchus fe5dc5e6a7 Apply cmake-format 0.6.10 2020-04-27 22:59:06 +02:00
Martchus 1c6315a078 Add opt-outs for additional linker flags to achieve a fully statically linked build
See https://github.com/Martchus/syncthingtray/issues/64
2020-04-27 22:55:06 +02:00
Martchus 32780ed6a6 Support formatting ISO timestamps via DateTime::toString() with option to omit defaults
Omitting components are also allowed when parsing ISO timestamps so it makes sense to
have something similar in the other direction as well.

Note that the idea comes from ID3v2.4.0 which stores timestamps in a subset of ISO 8601
similarily to what this library supports and it allows to omit default components as
well.
2020-04-26 21:38:02 +02:00
Martchus c834f8923d Allow omitting month and day when parsing ISO date
This leaves only the year as mandatory component (other components
can already be omitted).
2020-04-24 22:15:49 +02:00
Martchus 73470d0b65 Fix DateTime::fromDateAndTime() for the day 0001-01-01 2020-04-24 21:55:45 +02:00
Martchus 3fe1ea64cf Improve documentation of some test utilities 2020-04-13 23:35:22 +02:00
Martchus 5340a8b6ec Fix wording in README
Before it sounded like the library would *use* (and not provide) these
features.
2020-04-13 01:12:29 +02:00
Martchus 34170b83f1 Apply clang-format 2020-04-13 01:10:33 +02:00
Martchus 06e29dd751 test utils: Use /proc/self/exe to find srcdirref, at least where supported
So it also works if e.g. chdir() is called before instantiating
the TestApplication.
2020-04-11 22:12:49 +02:00
Martchus 4b67736adf Add DateTime::toIsoStringWithCustomDelimiters() 2020-04-11 21:51:52 +02:00
Martchus 9fe7053869 Print "Executing test" via cppunit.h
Otherwise it is a bit annoying if one just wants to instantiate
a TestApplication for looking up test files.
2020-04-11 21:50:55 +02:00
Martchus e1313c77a0 Add test for fileName() without parent directories 2020-04-11 21:44:07 +02:00
Martchus 53b4cbd8e9 Make fake Qt arguments operations 2020-04-05 21:40:01 +02:00
Martchus 08bfdeed5e Document missing features / caveats of IniFile class 2020-03-15 01:01:34 +01:00
Martchus 6273b42643 Fix remaining hard-coded install dirs
See https://github.com/Martchus/cpp-utilities/issues/17#issuecomment-596420331
2020-03-09 10:45:20 +01:00
Martchus e241d718ce Apply cmake-format 2020-03-05 19:05:33 +01:00
Martchus e94d42f19c Support passing absolute path to CMAKE_INSTALL_BINDIR/LIBDIR
Same as b2a2773 but for CMAKE_INSTALL_BINDIR and CMAKE_INSTALL_LIBDIR.
2020-03-05 14:52:52 +01:00
Martchus a7564b8dde Add TESTUTILS_ASSERT_LIKE_FLAGS to pass regex flags 2020-03-02 18:24:06 +01:00
Martchus bf8e0db87f Construct tuple in in string builder directly 2020-03-02 18:23:38 +01:00
Martchus 8744cf95ef Ensure no copy is made when using argsToString()
It seems that std::make_tuple() is using __decay_and_strip so
the arguments get copied. Using the std::tuple c'tor directly
instead.

When using the %-operator it is already taken care that strings
are stored as pointers and not by value.
2020-02-18 19:29:23 +01:00
Martchus c7c5352325 Use a universal reference to implement dereferenceMaybe() 2020-02-18 19:20:24 +01:00
Martchus 0733f0705d Check one more parent level for LICENSE file
Hack to fix license auto-detection for Plasmoid
2020-02-14 22:30:10 +01:00