forked from libyal/libvshadow
-
Notifications
You must be signed in to change notification settings - Fork 0
/
runtests.ps1
59 lines (51 loc) · 853 Bytes
/
runtests.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# Script that runs the tests
#
# Version: 20160913
$ExitSuccess = 0
$ExitFailure = 1
$ExitIgnore = 77
Set-Location -Path "tests"
Try
{
$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 (${Line}.EndsWith(".sh"))
{
${Line} = ${Line}.Substring(0, ${Line}.Length - 3)
${Line} = ".\${Line}.ps1"
}
Invoke-Expression ${Line}
if (${LastExitCode} -ne ${ExitSuccess})
{
Break
}
}
ElseIf (${Line}.StartsWith("TESTS = "))
{
${InTests} = $TRUE
}
}
}
Catch
{
${LastExitCode} = ${ExitFailure}
}
Finally
{
Set-Location -Path ".."
}
Exit ${LastExitCode}