Skip to content

Commit

Permalink
applied changes required from review
Browse files Browse the repository at this point in the history
  • Loading branch information
kreuzberger authored and ursfassler committed Aug 1, 2024
1 parent 1bdf975 commit 7c0526f
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 49 deletions.
1 change: 0 additions & 1 deletion run-linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
60 changes: 20 additions & 40 deletions run-windows.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand Down
9 changes: 1 addition & 8 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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})

Expand All @@ -32,13 +32,6 @@ function(cuke_set_environment environment)
set(RUNPATH "$<IF:$<PLATFORM_ID:Windows>,PATH,LD_LIBRARY_PATH>")
list(APPEND environment "$<IF:$<PLATFORM_ID:Windows>,PATH,LD_LIBRARY_PATH>=path_list_prepend:$<SHELL_PATH:${CUKE_ENV_RUNPATH}>")
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:$<SHELL_PATH:${CUKE_ENV_BINPATH}>")
endif()

set(${environment} ${${environment}} PARENT_SCOPE)
endfunction()

Expand Down

0 comments on commit 7c0526f

Please sign in to comment.