From 560e48926cd27c3647f486f23dc26eef11e63afa Mon Sep 17 00:00:00 2001 From: "Franc[e]sco" Date: Tue, 19 Feb 2019 15:46:49 +0100 Subject: [PATCH] add windows test suite downloader --- test/download_suite | 2 +- test/download_suite.ps1 | 19 +++++++++++++++++++ test/suite_url | 1 + 3 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 test/download_suite.ps1 create mode 100644 test/suite_url diff --git a/test/download_suite b/test/download_suite index 3a4e72c..661f970 100755 --- a/test/download_suite +++ b/test/download_suite @@ -9,7 +9,7 @@ fi olddir="$(pwd)" cd "$wdir" || exit $? -url="https://github.com/Francesco149/oppai-ng/releases/download/2.3.2/test_suite_2019-02-19.tar.gz" +url="$(cat ./suite_url)" if [ $(find test_suite 2>/dev/null | tail -n +2 | wc -l) = "0" ]; then curl -LO "$url" || exit $? diff --git a/test/download_suite.ps1 b/test/download_suite.ps1 new file mode 100644 index 0000000..fb8d824 --- /dev/null +++ b/test/download_suite.ps1 @@ -0,0 +1,19 @@ +# you must allow script execution by running +# 'Set-ExecutionPolicy RemoteSigned' in an admin powershell +# 7zip is also required (choco install 7zip and add it to path) + +$url = Get-Content .\suite_url -Raw +$dir = Split-Path -Parent $MyInvocation.MyCommand.Definition +Push-Location "$dir" + +if ((Test-Path .\test_suite) -and (Get-ChildItem .\test_suite | Measure-Object).Count -gt 0) { + Write-Host "using existing test_suite" +} else { + # my windows 7 install doesn't support Tls3 + [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 + (New-Object System.Net.WebClient).DownloadFile($url, "$dir\test_suite.tar.gz") + &7z x .\test_suite.tar.gz + &7z x .\test_suite.tar +} + +Pop-Location diff --git a/test/suite_url b/test/suite_url new file mode 100644 index 0000000..efb32e3 --- /dev/null +++ b/test/suite_url @@ -0,0 +1 @@ +https://github.com/Francesco149/oppai-ng/releases/download/2.3.2/test_suite_2019-02-19.tar.gz