Christian Grasser c5477ee21c Add Github CI build
- add first version of GH CI build
- fix merge issue for lexilla.mak
- fix clang compiler issue:
       ..\lexers\LexObjC.cxx(50,20): warning : unused function 'IsADigit' [-Wunused-function] [D:\a\notepad-plus-plus\notepad-plus-plus\lexilla\src\Lexilla.vcxproj]
- fix functionlist unittest run for github
- make functionList unittest compatible with newer powershell 7

Fix #12177, close #14291
2023-11-02 12:16:31 +01:00

68 lines
1.4 KiB
PowerShell

$testRoot = ".\"
Get-ChildItem -Path $testRoot -Attribute Directory -Name |
Foreach-Object {
$dirName = (Get-Item $testRoot$_).Name
$langName = $dirName
$sw = [Diagnostics.Stopwatch]::StartNew()
$result = & ".\unitTest.ps1" $dirName $langName
$sw.Stop()
"Test: " + $sw.Elapsed.TotalMilliseconds + " ms"
if ($result -eq 0)
{
"$dirName ... OK"
}
elseif ($result -eq 1)
{
"$dirName ... unitTest file not found. Test skipped."
}
elseif ($result -eq -1)
{
"$dirName ... KO"
"result = $result"
"There are some problems in your $dirName.xml"
exit -1
}
elseif ($result -eq -2)
{
"Exception!"
exit -1
}
else
{
"It should not happen - check your script."
exit -1
}
# Check all Sub-directories for other unit-tests
Get-ChildItem -Path $testRoot\$dirName -Attribute Directory -Name |
Foreach-Object {
$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)
{
"$dirName-$subDirName ... OK"
}
elseif ($subResult -eq 1)
{
"$dirName-$subDirName ... unitTest file not found. Test skipped."
}
else
{
"$dirName-$subDirName ... KO"
""
"There are some problems in your $dirName.xml"
exit -1
}
}
}
""
"All tests are passed."
exit 0