Implemented user defined relative date ranges (#4534)

Fixes #4512
* Added additional time range options for user defined seasons
  * Relative start (e.g. 3 months ago)
  * Duration after start / Duration before end (e.g. 2 months)
  * Year to Date end, defining the end as the closest day with todays
    day and month after start
* Refactored Season.h/cpp and SeasonParser.h/cpp for better testability
  * Kept Season, Phase, SeasonEvent, SeasonOffset, SeasonLength in
    Season.h/cpp
  * Moved all UI related classes to SeasonDialogs.h/cpp
  * Renamed SeasonParser.h/cpp to Seasons.h/cpp, moved class Seasons
    there
* Replaced deprecated Qt classes
  * Replaced QRegExp by QRegularExpression in SeasonParser
  * Rewrote parsing seasons.xml to use QXmlStreamReader instead of
    QXmlSimpleReader
* Unittesting
  * Added a simple way to implement and execute (make check) unittests
    in Golden Cheetahs source tree based on Qt Test
    (https://doc.qt.io/qt-6/qttest-index.html), tested on Linux and
    Windows
  * Implemented unittests for classes (mostly before refactoring)
    * Season
    * SeasonParser
    * SeasonOffset
This commit is contained in:
Joachim Kohlhammer
2024-09-27 16:25:03 +02:00
committed by GitHub
parent 60f9033617
commit 9242f724db
39 changed files with 2699 additions and 1282 deletions

View File

@@ -0,0 +1,23 @@
GC_UNITTESTS = active
########################################
include(../src/gcconfig.pri)
GC_SRC_DIR = ../../src
GC_OBJECTS_DIR = $$GC_SRC_DIR/$(OBJECTS_DIR)
INCLUDEPATH += $$GC_SRC_DIR
win32 {
PLATFORM_EXT = obj
} else {
PLATFORM_EXT = o
}
CONFIG += testcase
CONFIG += no_testcase_installs
CONFIG += c++11
for(obj, GC_OBJS) {
LIBS += $${GC_OBJECTS_DIR}/$${obj}.$${PLATFORM_EXT}
}