notepad-plus-plus-legacy/PowerEditor/Test/FunctionList/unitTestLauncher.ps1
2020-08-26 14:01:05 +02:00

32 lines
804 B
PowerShell

$testRoot = ".\"
Get-ChildItem $testRoot -Filter *.* |
Foreach-Object {
if ((Get-Item $testRoot$_) -is [System.IO.DirectoryInfo])
{
$dirName = (Get-Item $testRoot$_).Name
..\..\bin\notepad++.exe -export=functionList -l"$dirName" $testRoot$_\unitTest | Out-Null
$expectedRes = Get-Content $testRoot$_\unitTest.expected.result
$generatedRes = Get-Content $testRoot$_\unitTest.result.json
if ($generatedRes -eq $expectedRes)
{
Remove-Item $testRoot$_\unitTest.result.json
"$dirName ... OK"
}
else
{
"$dirName ... KO"
""
"There's a (some) problem(s) in your functionList.xml"
exit -1
}
}
}
""
"All tests are passed."
exit 0