Integrate unit-tests for function list into appveyor CI

- run unitTestLauncher.ps1 on win32 debug builds (release is not possible due to missing scintilla crypto signing)
- SciLexer.dll needs to be taken from an official build, because boost is required for functionlist to be functional
- slightly optimized test script, added timing traces

It's for #8762

Close #8816
This commit is contained in:
Christian Grasser 2020-08-26 10:01:51 +02:00 committed by Don HO
parent 399452167f
commit 648e6eb891
2 changed files with 40 additions and 20 deletions

View File

@ -1,12 +1,15 @@
$testRoot = ".\" $testRoot = ".\"
Get-ChildItem $testRoot -Filter *.* | Get-ChildItem -Path $testRoot -Attribute Directory |
Foreach-Object { Foreach-Object {
if ((Get-Item $testRoot$_) -is [System.IO.DirectoryInfo])
{
$dirName = (Get-Item $testRoot$_).Name $dirName = (Get-Item $testRoot$_).Name
$langName = $dirName $langName = $dirName
$sw = [Diagnostics.Stopwatch]::StartNew()
$result = &.\unitTest.ps1 $dirName $langName $result = &.\unitTest.ps1 $dirName $langName
$sw.Stop()
"Test: " + $sw.Elapsed.TotalMilliseconds + " ms"
if ($result -eq 0) if ($result -eq 0)
{ {
@ -14,7 +17,7 @@ Foreach-Object {
} }
elseif ($result -eq 1) elseif ($result -eq 1)
{ {
"$dirName ... unitTest file not found. Test skipt." "$dirName ... unitTest file not found. Test skipped."
} }
else else
{ {
@ -25,20 +28,21 @@ Foreach-Object {
} }
# Check all Sub-directories for other unit-tests # Check all Sub-directories for other unit-tests
Get-ChildItem $testRoot$dirName -Filter *.* | Get-ChildItem -Path $testRoot\$dirName -Attribute Directory |
Foreach-Object { Foreach-Object {
if ((Get-Item $testRoot$dirName\$_) -is [System.IO.DirectoryInfo])
{
$subDirName = (Get-Item $testRoot$dirName\$_).Name
$subResult = &.\unitTest.ps1 $langName\$subDirName $langName
$subDirName = (Get-Item $testRoot$dirName\$_).Name
$sw = [Diagnostics.Stopwatch]::StartNew()
$subResult = &.\unitTest.ps1 $langName\$subDirName $langName
$sw.Stop()
"Test:" + $sw.Elapsed.TotalMilliseconds + " ms"
if ($subResult -eq 0) if ($subResult -eq 0)
{ {
"$dirName-$subDirName ... OK" "$dirName-$subDirName ... OK"
} }
elseif ($subResult -eq 1) elseif ($subResult -eq 1)
{ {
"$dirName-$subDirName ... unitTest file not found. Test skipt." "$dirName-$subDirName ... unitTest file not found. Test skipped."
} }
else else
{ {
@ -48,8 +52,6 @@ Foreach-Object {
exit -1 exit -1
} }
} }
}
}
} }
"" ""
"All tests are passed." "All tests are passed."

View File

@ -45,6 +45,8 @@ after_build:
- ps: >- - ps: >-
$nppFileName = "Notepad++.$env:PLATFORM_INPUT.$env:CONFIGURATION.exe" $nppFileName = "Notepad++.$env:PLATFORM_INPUT.$env:CONFIGURATION.exe"
Push-AppveyorArtifact "scintilla\bin\SciLexer.dll" -FileName "SciLexer.$env:PLATFORM.$env:CONFIGURATION.dll"
if ($env:PLATFORM_INPUT -eq "x64" -and $env:CONFIGURATION -eq "Unicode Release") { if ($env:PLATFORM_INPUT -eq "x64" -and $env:CONFIGURATION -eq "Unicode Release") {
Push-AppveyorArtifact "PowerEditor\bin64\Notepad++.exe" -FileName "$nppFileName" Push-AppveyorArtifact "PowerEditor\bin64\Notepad++.exe" -FileName "$nppFileName"
} }
@ -59,6 +61,22 @@ after_build:
if ($env:PLATFORM_INPUT -eq "Win32" -and $env:CONFIGURATION -eq "Unicode Debug") { if ($env:PLATFORM_INPUT -eq "Win32" -and $env:CONFIGURATION -eq "Unicode Debug") {
Push-AppveyorArtifact "PowerEditor\visual.net\Unicode Debug\Notepad++.exe" -FileName "$nppFileName" Push-AppveyorArtifact "PowerEditor\visual.net\Unicode Debug\Notepad++.exe" -FileName "$nppFileName"
Start-FileDownload 'https://github.com/notepad-plus-plus/notepad-plus-plus/releases/download/v7.8.9/npp.7.8.9.bin.minimalist.7z'
7z x -y npp.7.8.9.bin.minimalist.7z | Out-Null
#take SciLexer.dll from downloaded version due to dependency of the functionlist tests on a version build with boost regex
#what is not the case for the dll build on appveyor CI (would either need a very time consuming boost build or usage of nuget packages)
Copy-Item "$env:APPVEYOR_BUILD_FOLDER\SciLexer.dll" -Destination "$env:APPVEYOR_BUILD_FOLDER\PowerEditor\bin"
Copy-Item "$env:APPVEYOR_BUILD_FOLDER\PowerEditor\visual.net\Unicode Debug\Notepad++.exe" -Destination "$env:APPVEYOR_BUILD_FOLDER\PowerEditor\bin"
Copy-Item "$env:APPVEYOR_BUILD_FOLDER\PowerEditor\src\langs.model.xml" -Destination "$env:APPVEYOR_BUILD_FOLDER\PowerEditor\bin"
Copy-Item "$env:APPVEYOR_BUILD_FOLDER\PowerEditor\src\stylers.model.xml" -Destination "$env:APPVEYOR_BUILD_FOLDER\PowerEditor\bin"
Copy-Item "$env:APPVEYOR_BUILD_FOLDER\PowerEditor\src\shortcuts.xml" -Destination "$env:APPVEYOR_BUILD_FOLDER\PowerEditor\bin"
Copy-Item "$env:APPVEYOR_BUILD_FOLDER\PowerEditor\src\functionList.xml" -Destination "$env:APPVEYOR_BUILD_FOLDER\PowerEditor\bin"
Copy-Item "$env:APPVEYOR_BUILD_FOLDER\PowerEditor\src\contextMenu.xml" -Destination "$env:APPVEYOR_BUILD_FOLDER\PowerEditor\bin"
cd .\PowerEditor\Test\FunctionList\
.\unitTestLauncher.ps1
.\unitTestLauncher.ps1
#ATTENTION: current working dir is no longer at APPVEYOR_BUILD_FOLDER
} }
if ($env:PLATFORM_INPUT -eq "mingw") { if ($env:PLATFORM_INPUT -eq "mingw") {
@ -66,4 +84,4 @@ after_build:
Push-AppveyorArtifact "PowerEditor\bin\NotepadPP.exe_dynamic" -FileName "$nppFileName_dynamic" Push-AppveyorArtifact "PowerEditor\bin\NotepadPP.exe_dynamic" -FileName "$nppFileName_dynamic"
} }
Push-AppveyorArtifact "scintilla\bin\SciLexer.dll" -FileName "SciLexer.$env:PLATFORM.$env:CONFIGURATION.dll"