2020-10-25 16:52:46 +00:00
|
|
|
try {
|
2020-11-01 02:28:18 +00:00
|
|
|
$binDir = '..\..\Bin'
|
|
|
|
$pluginsDir = $binDir + '\plugins'
|
|
|
|
$pluginsSaveDir = $binDir + '\plugins_save'
|
|
|
|
|
|
|
|
if (Test-Path -Path $pluginsDir -PathType Container)
|
2020-10-25 16:52:46 +00:00
|
|
|
{
|
2020-11-01 02:28:18 +00:00
|
|
|
if (Test-Path -Path $pluginsSaveDir -PathType Container)
|
2020-10-25 16:52:46 +00:00
|
|
|
{
|
|
|
|
"Backup for plugins directory already exists"
|
|
|
|
exit -1
|
|
|
|
}
|
|
|
|
"Backing up plugin directory ..."
|
2020-11-01 02:28:18 +00:00
|
|
|
Move-Item $pluginsDir $pluginsSaveDir
|
2020-10-25 16:52:46 +00:00
|
|
|
}
|
|
|
|
"Installing Lua plugin for testing ..."
|
2020-11-01 02:28:18 +00:00
|
|
|
Copy-Item -Path .\plugins -Destination $binDir -Recurse
|
2020-10-25 16:52:46 +00:00
|
|
|
|
|
|
|
"Testing ..."
|
2020-11-01 02:28:18 +00:00
|
|
|
Invoke-Expression ($binDir + "\notepad++.exe | Out-Null")
|
2020-10-25 16:52:46 +00:00
|
|
|
|
2020-11-01 02:28:18 +00:00
|
|
|
if (Test-Path -Path $pluginsSaveDir -PathType Container)
|
2020-10-25 16:52:46 +00:00
|
|
|
{
|
|
|
|
"Removing Lua plugin ..."
|
2020-11-01 02:28:18 +00:00
|
|
|
Remove-Item -Path $pluginsDir -Recurse -Force
|
2020-10-25 16:52:46 +00:00
|
|
|
"Restoring plugin directory ..."
|
2020-11-01 02:28:18 +00:00
|
|
|
Move-Item $pluginsSaveDir $pluginsDir
|
2020-10-25 16:52:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
$expectedRes = Get-Content .\verifyUrlDetection_1a.expected.result
|
|
|
|
$generatedRes = Get-Content .\verifyUrlDetection_1a.result
|
|
|
|
|
|
|
|
if (Compare-Object -ReferenceObject $expectedRes -DifferenceObject $generatedRes)
|
|
|
|
{
|
|
|
|
"Unexpected test results for verifyUrlDetection_1a"
|
|
|
|
exit -1
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
Remove-Item .\verifyUrlDetection_1a.result
|
|
|
|
$expectedRes = Get-Content .\verifyUrlDetection_1b.expected.result
|
|
|
|
$generatedRes = Get-Content .\verifyUrlDetection_1b.result
|
|
|
|
if (Compare-Object -ReferenceObject $expectedRes -DifferenceObject $generatedRes)
|
|
|
|
{
|
|
|
|
"Unexpected test results for verifyUrlDetection_1b"
|
|
|
|
exit -1
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
Remove-Item .\verifyUrlDetection_1b.result
|
|
|
|
"URL detection test OK"
|
|
|
|
exit 0
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
catch
|
|
|
|
{
|
|
|
|
"Unexpected behavior while URL detection test"
|
|
|
|
exit -1
|
|
|
|
}
|
|
|
|
|