From 7c0526f3ee48ae671521d5946f7bf2ff80a6b57c Mon Sep 17 00:00:00 2001 From: Joerg Kreuzberger Date: Mon, 15 Apr 2024 22:09:06 +0200 Subject: [PATCH] applied changes required from review --- run-linux.sh | 1 - run-windows.ps1 | 60 +++++++++++++++----------------------------- tests/CMakeLists.txt | 9 +------ 3 files changed, 21 insertions(+), 49 deletions(-) diff --git a/run-linux.sh b/run-linux.sh index c57ef7c0..7f0c1730 100755 --- a/run-linux.sh +++ b/run-linux.sh @@ -11,7 +11,6 @@ cmake -E chdir build cmake \ -DCUKE_ENABLE_BOOST_TEST=on \ -DCUKE_ENABLE_GTEST=on \ -DCUKE_ENABLE_QT_6=on \ - -DCUKE_ENABLE_QT_5=off \ -DCUKE_ENABLE_EXAMPLES=on \ -DCUKE_TESTS_UNIT=on \ -DCUKE_CODE_COVERAGE=on \ diff --git a/run-windows.ps1 b/run-windows.ps1 index 2deee63b..199a19eb 100755 --- a/run-windows.ps1 +++ b/run-windows.ps1 @@ -50,8 +50,7 @@ $cmake_params += "-DCMAKE_CXX_STANDARD=${cpp_standard}" $cmake_params += "-DCUKE_ENABLE_BOOST_TEST=OFF" $cmake_params += "-DCUKE_ENABLE_GTEST=ON" -$cmake_params += "-DCUKE_ENABLE_QT_6=OFF" -$cmake_params += "-DCUKE_ENABLE_QT_5=ON" +$cmake_params += "-DCUKE_ENABLE_QT_6=ON" $cmake_params += "-DCUKE_ENABLE_EXAMPLES=ON" $cmake_params += "-DCUKE_TESTS_UNIT=ON" $cmake_params += "-DCUKE_CODE_COVERAGE=OFF" @@ -72,51 +71,32 @@ Invoke-CMake "--build","build","--config","Release","--target","RUN_TESTS" $CalcTests = @("build\examples\Calc\Release\GTestCalculatorSteps.exe", "build\examples\Calc\Release\BoostCalculatorSteps.exe", -"build\examples\Calc\Release\FuncArgsCalculatorSteps.exe") - -If ((Get-Command "qmake.exe" -ErrorAction SilentlyContinue) -ne $null) -{ - $CalcTests += "build\examples\Calc\Release\QtTestCalculatorSteps.exe" -} +"build\examples\Calc\Release\FuncArgsCalculatorSteps.exe", +"build\examples\Calc\Release\QtTestCalculatorSteps.exe") For ($i=0; $i -lt $CalcTests.Length; $i++) { - If (Test-Path -path $CalcTests[$i] -PathType Leaf) { - Write-Host "Start Test $($CalcTests[$i])" -f Green - Start-Process -NoNewWindow $CalcTests[$i] - Start-Sleep -Seconds 1.0 - Set-Location -Path 'examples/Calc' - Start-Process cucumber -NoNewWindow -Wait - set-Location -Path $PSScriptRoot - } Else { - Write-Host "Skipping $($CalcTests[$i]): file not exisiting" -f Yellow - } + Write-Host "Start Test $($CalcTests[$i])" -f Green + Start-Process -NoNewWindow $CalcTests[$i] + Start-Sleep -Seconds 1.0 + Set-Location -Path 'examples/Calc' + Start-Process cucumber -NoNewWindow -Wait + set-Location -Path $PSScriptRoot } # # Execute QtCalc examples # -If ((Get-Command "qmake.exe" -ErrorAction SilentlyContinue) -eq $null) -{ - Write-Host "Qt not found in PATH, skipping QtCalc Tests" -f Yellow -} -Else -{ - $QtCalcTests = @("build\examples\CalcQt\Release\GTestCalculatorQtSteps.exe", - "build\examples\CalcQt\Release\QtTestCalculatorQtSteps.exe", - "build\examples\CalcQt\Release\BoostCalculatorQtSteps.exe") - - For ($i=0; $i -lt $QtCalcTests.Length; $i++) { - If (Test-Path -path $QtCalcTests[$i] -PathType Leaf) { - Write-Host "Start Test $($QtCalcTests[$i])" -f Green - Start-Process -NoNewWindow $QtCalcTests[$i] - Start-Sleep -Seconds 1.0 - Set-Location -Path 'examples/CalcQt' - Start-Process cucumber -NoNewWindow -Wait - set-Location -Path $PSScriptRoot - } Else { - Write-Host "Skipping $($QtCalcTests[$i]): file not exisiting" -f Yellow - } - } +$QtCalcTests = @("build\examples\CalcQt\Release\GTestCalculatorQtSteps.exe", +"build\examples\CalcQt\Release\QtTestCalculatorQtSteps.exe", +"build\examples\CalcQt\Release\BoostCalculatorQtSteps.exe") + +For ($i=0; $i -lt $QtCalcTests.Length; $i++) { + Write-Host "Start Test $($QtCalcTests[$i])" -f Green + Start-Process -NoNewWindow $QtCalcTests[$i] + Start-Sleep -Seconds 1.0 + Set-Location -Path 'examples/CalcQt' + Start-Process cucumber -NoNewWindow -Wait + set-Location -Path $PSScriptRoot } Invoke-CMake "--build","build","--config","Release","--target","INSTALL" diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 5f4fcf62..cceda78c 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -14,7 +14,7 @@ target_include_directories(utils INTERFACE function(cuke_set_environment environment) set(options) set(oneValueArgs ) - set(multiValueArgs RUNPATH BINPATH) + set(multiValueArgs RUNPATH) cmake_parse_arguments(CUKE_ENV "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) @@ -32,13 +32,6 @@ function(cuke_set_environment environment) set(RUNPATH "$,PATH,LD_LIBRARY_PATH>") list(APPEND environment "$,PATH,LD_LIBRARY_PATH>=path_list_prepend:$") endif() - if( NOT "${CUKE_ENV_BINPATH}" STREQUAL "") - if(WIN32) - string(REPLACE ";" "\;" CUKE_ENV_BINPATH "${CUKE_ENV_BINPATH}") - endif() - list(APPEND environment "PATH=path_list_prepend:$") - endif() - set(${environment} ${${environment}} PARENT_SCOPE) endfunction()