fix test-declaration in CMake-Files

This commit is contained in:
jkriege2 2024-01-23 11:51:50 +01:00
parent 326bb3650a
commit a7e723d836
4 changed files with 9 additions and 4 deletions

View File

@ -72,6 +72,7 @@ if(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
add_subdirectory(doc)
if (JKQtPlotter_BUILD_TESTS)
include(CTest)
add_subdirectory(tests)
endif()

View File

@ -288,6 +288,10 @@ for:
echo == RUNNING UNIT TESTS FOR JKQtPlotter CMAKE BUILD ===============================================
cd $APPVEYOR_BUILD_FOLDER
cd build
ls *.
ls -l *.*
ls -l Testing/*
ls -l Testing/*.*
ctest --version
ctest --print-labels --build-config "$CONFIGURATION"
ctest --build-config "$CONFIGURATION" -VV --output-on-failure --output-junit test-results.xml
@ -334,7 +338,7 @@ for:
artifacts:
- path: 'build/CMakeFiles/*.log'
- path: '$APPVEYOR_BUILD_FOLDER/build/CMakeFiles/*.log'
name: logs
- path: 'build/Testing/**/*.xml'
- path: '$APPVEYOR_BUILD_FOLDER/build/Testing/**/*.xml'
name: test_results

View File

@ -10,7 +10,7 @@ else()
message( STATUS ".. - Precompiled Header: OFF")
endif()
message( STATUS "............................................................................." )
include(CTest)
enable_testing()
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Test REQUIRED)

View File

@ -20,7 +20,7 @@ target_sources(${EXENAME}
# Installation
install(TARGETS ${EXENAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
add_test(NAME ${TEST_NAME} COMMAND ${EXENAME})
add_test(NAME ${TEST_NAME} COMMAND COMMAND $<TARGET_FILE:${EXENAME}>)
#Installation of Qt DLLs on Windows
jkqtplotter_deployqt(${EXENAME})