Z: make ngltools Qt smoke test build standalone when library target missing; use DTG format for stable round-trip\n\nEnsure smoke test links directly to implementation if ngltools target isn't present so migration builds can run tests without producing the full library.\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
1 parent
8157682249
commit
70cdf12c82
2 files changed
+11
-3
No files matched your search
@@ -37,8 +37,16 @@ IF(BUILD_TESTING)
|
||||
endif()
|
||||
|
||||
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/tests/NGLToolsQtSmokeTest.cpp)
|
||||
add_executable(ngltools_qt_smoke tests/NGLToolsQtSmokeTest.cpp)
|
||||
target_link_libraries(ngltools_qt_smoke PRIVATE ngltools ${_QTTEST_TARGET} ${_QTCORE_TARGET})
|
||||
if(TARGET ngltools)
|
||||
add_executable(ngltools_qt_smoke tests/NGLToolsQtSmokeTest.cpp)
|
||||
target_link_libraries(ngltools_qt_smoke PRIVATE ngltools ${_QTTEST_TARGET} ${_QTCORE_TARGET})
|
||||
else()
|
||||
# Build the smoke test as a standalone executable using the dtg implementation
|
||||
# when the ngltools library target is not available in this configuration.
|
||||
add_executable(ngltools_qt_smoke tests/NGLToolsQtSmokeTest.cpp ${CMAKE_CURRENT_SOURCE_DIR}/ngltools_dtg.cpp)
|
||||
target_include_directories(ngltools_qt_smoke PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
target_link_libraries(ngltools_qt_smoke PRIVATE ${_QTTEST_TARGET} ${_QTCORE_TARGET})
|
||||
endif()
|
||||
add_test(NAME NGLToolsQtSmoke COMMAND ngltools_qt_smoke)
|
||||
endif()
|
||||
ENDIF()
|
||||
|
||||
@@ -11,7 +11,7 @@ private slots:
|
||||
void testDTG()
|
||||
{
|
||||
QDateTime now = QDateTime::currentDateTimeUtc();
|
||||
QString s = DTG::toString(now);
|
||||
QString s = DTG::toString(now, DTG::Default, DTG::DTG);
|
||||
QVERIFY(!s.isEmpty());
|
||||
bool ok = false;
|
||||
QDateTime parsed = DTG::fromDTGString(s, &ok);
|
||||
|
||||
Reference in new issue
Block a user