HEX
Server: nginx/1.18.0
System: Linux mail.dakarash.co.id 5.15.0-164-generic #174-Ubuntu SMP Fri Nov 14 20:25:16 UTC 2025 x86_64
User: www-data (33)
PHP: 8.1.2-1ubuntu2.23
Disabled: NONE
Upload Files
File: //home/django/libpff/runtests.ps1
# Script that runs the tests
#
# Version: 20220103

$ExitSuccess = 0
$ExitFailure = 1
$ExitIgnore = 77

Set-Location -Path "tests"

$Result = ${ExitSuccess}

$Lines = Get-Content "Makefile.am"
$InTests = $FALSE

Foreach (${Line} in ${Lines})
{
	If (${InTests})
	{
		If (-Not ${Line})
		{
			${InTests} = $FALSE

			Continue
		}
		${Line} = ${Line}.TrimStart()

		If (${Line}.EndsWith(" \"))
		{
			${Line} = ${Line}.Substring(0, ${Line}.Length - 2)
		}
		If (-Not (${Line}.EndsWith(".sh")))
		{
			Continue
		}
		${Line} = ${Line}.Substring(0, ${Line}.Length - 3)
		${Line} = ".\${Line}.ps1"

		Try
		{
			Invoke-Expression ${Line}
		}
		Catch
		{
			$LastExitCode = ${ExitIgnore}
		}
		If (${LastExitCode} -eq ${ExitFailure})
		{
			$Result = ${ExitFailure}
			Write-Host "FAIL" -foreground Red -nonewline
		}
		ElseIf (${LastExitCode} -eq ${ExitIgnore})
		{
			Write-Host "SKIP" -foreground Cyan -nonewline
		}
		Else
		{
			Write-Host "PASS" -foreground Green -nonewline
		}
		Write-Host ": ${Line}"
	}
	ElseIf (${Line}.StartsWith("TESTS = "))
	{
		${InTests} = $TRUE
	}
}

Set-Location -Path ".."

Exit ${Result}