@@ -7,11 +7,13 @@ $ErrorActionPreference = 'Stop'
7
7
$FirebirdConfiguration = @ {
8
8
FB30_Default = @ {
9
9
Download = ' https://www.dropbox.com/s/x46uy7e5zrtsnux/fb30.7z?dl=1' ;
10
- Start = ' .\firebird.exe -a' ;
10
+ Executable = ' .\firebird.exe' ;
11
+ Args = @ (' -a' );
11
12
};
12
13
FB25_SC = @ {
13
14
Download = ' https://www.dropbox.com/s/ayzjnxjx20vb7s5/fb25.7z?dl=1' ;
14
- Start = ' .\bin\fb_inet_server.exe -a -m' ;
15
+ Executable = ' .\bin\fb_inet_server.exe' ;
16
+ Args = @ (' -a' , ' -m' );
15
17
};
16
18
}
17
19
@@ -20,6 +22,9 @@ $testsBaseDir = "$baseDir\src\FirebirdSql.Data.FirebirdClient.Tests"
20
22
$testsNETDir = " $testsBaseDir \bin\$Configuration \net452"
21
23
$testsCOREDir = " $testsBaseDir \bin\$Configuration \netcoreapp2.0"
22
24
25
+ $startDir = $null
26
+ $firebirdProcess = $null
27
+
23
28
if ($env: tests_firebird_dir ) {
24
29
$firebirdDir = $env: tests_firebird_dir
25
30
}
@@ -37,18 +42,18 @@ function Check-ExitCode($command) {
37
42
}
38
43
39
44
function Prepare () {
45
+ $script :startDir = $pwd
40
46
$selectedConfiguration = $FirebirdConfiguration [$FirebirdSelection ]
41
47
$fbDownload = $selectedConfiguration.Download
42
- $fbStart = $selectedConfiguration.Start
43
48
$fbDownloadName = $fbDownload -Replace ' .+/([^/]+)\?dl=1' , ' $1'
44
49
if (Test-Path $firebirdDir ) {
45
50
rm - Force - Recurse $firebirdDir
46
51
}
47
52
mkdir $firebirdDir | Out-Null
48
53
cd $firebirdDir
49
- echo " Downloading: $fbDownload "
54
+ echo " Downloading $fbDownload "
50
55
(New-Object System.Net.WebClient).DownloadFile($fbDownload , (Join-Path (pwd) $fbDownloadName ))
51
- echo " Extracting: $fbDownloadName "
56
+ echo " Extracting $fbDownloadName "
52
57
7z x $fbDownloadName | Out-Null
53
58
cp - Recurse - Force .\embedded\* $testsNETDir
54
59
cp - Recurse - Force .\embedded\* $testsCOREDir
@@ -59,8 +64,16 @@ function Prepare() {
59
64
60
65
ni firebird.log - ItemType File | Out-Null
61
66
62
- echo " Starting: $fbStart "
63
- iex $fbStart
67
+ echo " Starting Firebird"
68
+ $script :firebirdProcess = Start-Process - FilePath $selectedConfiguration.Executable - ArgumentList $selectedConfiguration.Args - PassThru
69
+ }
70
+
71
+ function Cleanup () {
72
+ cd $script :startDir
73
+ $process = $script :firebirdProcess
74
+ $process.Kill ()
75
+ $process.WaitForExit ()
76
+ rm - Force - Recurse $firebirdDir
64
77
}
65
78
66
79
function Tests-FirebirdClient () {
@@ -93,6 +106,11 @@ function Tests-EFCore() {
93
106
}
94
107
95
108
Prepare
96
- Tests- FirebirdClient
97
- Tests- EF
98
- Tests- EFCore
109
+ try {
110
+ Tests- FirebirdClient
111
+ Tests- EF
112
+ Tests- EFCore
113
+ }
114
+ finally {
115
+ Cleanup
116
+ }
0 commit comments