11param (
22 [Parameter (Mandatory = $True )]$Configuration ,
3- [Parameter (Mandatory = $True )]$FbDownload ,
4- [Parameter (Mandatory = $True )]$FbStart )
3+ [Parameter (Mandatory = $True )]$FirebirdSelection )
54
65$ErrorActionPreference = ' Stop'
76
7+ $FirebirdConfiguration = @ {
8+ FB30_Default = @ {
9+ Download = ' https://www.dropbox.com/s/x46uy7e5zrtsnux/fb30.7z?dl=1' ;
10+ Start = ' .\firebird.exe -a' ;
11+ };
12+ FB25_SC = @ {
13+ Download = ' https://www.dropbox.com/s/ayzjnxjx20vb7s5/fb25.7z?dl=1' ;
14+ Start = ' .\bin\fb_inet_server.exe -a -m' ;
15+ };
16+ }
17+
818$baseDir = Split-Path - Parent $PSCommandPath
919$testsBaseDir = " $baseDir \src\FirebirdSql.Data.FirebirdClient.Tests"
1020$testsNETDir = " $testsBaseDir \bin\$Configuration \net452"
1121$testsCOREDir = " $testsBaseDir \bin\$Configuration \netcoreapp2.0"
1222
23+ if ($env: tests_firebird_dir ) {
24+ $firebirdDir = $env: tests_firebird_dir
25+ }
26+ else {
27+ $firebirdDir = ' I:\Downloads\fb_tests'
28+ }
29+
1330function Check-ExitCode ($command ) {
1431 & $command
1532 $exitCode = $LASTEXITCODE
@@ -20,20 +37,30 @@ function Check-ExitCode($command) {
2037}
2138
2239function Prepare () {
23- $fbDownloadName = $FbDownload -Replace ' .+/([^/]+)\?dl=1' , ' $1'
24- mkdir $env: tests_firebird_dir | Out-Null
25- cd $env: tests_firebird_dir
26- (New-Object System.Net.WebClient).DownloadFile($FbDownload , (Join-Path (pwd) $fbDownloadName ))
40+ $selectedConfiguration = $FirebirdConfiguration [$FirebirdSelection ]
41+ $fbDownload = $selectedConfiguration.Download
42+ $fbStart = $selectedConfiguration.Start
43+ $fbDownloadName = $fbDownload -Replace ' .+/([^/]+)\?dl=1' , ' $1'
44+ if (Test-Path $firebirdDir ) {
45+ rm - Force - Recurse $firebirdDir
46+ }
47+ mkdir $firebirdDir | Out-Null
48+ cd $firebirdDir
49+ echo " Downloading: $fbDownload "
50+ (New-Object System.Net.WebClient).DownloadFile($fbDownload , (Join-Path (pwd) $fbDownloadName ))
51+ echo " Extracting: $fbDownloadName "
2752 7z x $fbDownloadName | Out-Null
2853 cp - Recurse - Force .\embedded\* $testsNETDir
2954 cp - Recurse - Force .\embedded\* $testsCOREDir
3055 rmdir - Recurse .\embedded
3156 rm $fbDownloadName
3257 mv .\server\* .
3358 rmdir .\server
34-
35- iex $FbStart
59+
3660 ni firebird.log - ItemType File | Out-Null
61+
62+ echo " Starting: $fbStart "
63+ iex $fbStart
3764}
3865
3966function Tests-FirebirdClient () {
0 commit comments