Skip to content

Commit 2d3e3f9

Browse files
committed
Merge pull request #45 from brson/next
Write tests for rust_install::component
2 parents 58eaae3 + 77b300c commit 2d3e3f9

32 files changed

+4393
-3388
lines changed

.appveyor.cargo-config.toml

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
[target.x86_64-pc-windows-msvc.openssl]
2+
rustc-link-search = ['native=C:\OpenSSL\openssl-1.0.2d-vs2015\lib64']
3+
rustc-link-lib = ['static=ssleay32MT', 'static=libeay32MT', 'gdi32', 'user32']
4+
include = 'C:\OpenSSL\openssl-1.0.2d-vs2015\include'
5+
6+
[target.i686-pc-windows-msvc.openssl]
7+
rustc-link-search = ['native=C:\OpenSSL\openssl-1.0.2d-vs2015\lib']
8+
rustc-link-lib = ['static=ssleay32MT', 'static=libeay32MT', 'gdi32', 'user32']
9+
include = 'C:\OpenSSL\openssl-1.0.2d-vs2015\include'
10+
11+
[target.x86_64-pc-windows-gnu.openssl]
12+
rustc-link-search = ['native=C:\msys64\mingw64\lib']
13+
rustc-link-lib = ['static=ssl', 'static=crypto', 'gdi32', 'user32']
14+
include = 'C:\msys64\mingw64\include'
15+
16+
[target.i686-pc-windows-gnu.openssl]
17+
rustc-link-search = ['native=C:\msys64\mingw32\lib']
18+
rustc-link-lib = ['static=ssl', 'static=crypto', 'gdi32', 'user32']
19+
include = 'C:\msys64\mingw32\include'

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
/target
33
/Cargo.lock
44
/rust-install/target
5+
/rust-install/Cargo.lock

.travis.yml

+2
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ script:
5757
find "target/release/" -maxdepth 1 -type f -exec sh -c 'sha256sum -b "{}" | cut -d\ -f1 > "{}.sha256"' \;;
5858
fi
5959
- cargo test --verbose
60+
- cargo test -p rust-install --verbose
61+
- cargo test -p rust-manifest --verbose
6062
- tests/cli.sh
6163

6264
after_success:

appveyor.yml

+18-33
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
environment:
22
matrix:
33
- TARGET: x86_64-pc-windows-msvc
4-
BITS: 64
54
- TARGET: i686-pc-windows-msvc
6-
BITS: 32
75
- TARGET: x86_64-pc-windows-gnu
86
BITS: 64
97
- TARGET: i686-pc-windows-gnu
@@ -16,66 +14,53 @@ install:
1614
Start-FileDownload "https://static.rust-lang.org/dist/rust-nightly-${env:TARGET}.exe" -FileName "rust-nightly.exe"
1715
.\rust-nightly.exe /VERYSILENT /NORESTART /DIR="C:\rust" | Out-Null
1816
$env:PATH="$env:PATH;C:\rust\bin"
19-
20-
# OpenSSL must be linked statically
21-
$env:OPENSSL_STATIC="1"
22-
17+
18+
New-Item .cargo -type directory
19+
Copy-Item .appveyor.cargo-config.toml .cargo/config
20+
2321
# For -gnu builds
2422
if ($env:TARGET -match "-gnu$") {
2523
$env:PATH="$env:PATH;C:\msys64\mingw${env:BITS}\bin"
26-
$env:OPENSSL_INCLUDE_DIR="C:\msys64\mingw${env:BITS}\include"
27-
$env:OPENSSL_LIB_DIR="C:\msys64\mingw${env:BITS}\lib"
28-
$env:OPENSSL_LIBS="crypto:ssl"
2924
}
30-
25+
3126
# For -msvc builds
3227
if ($env:TARGET -match "-msvc$") {
33-
# Install OpenSSL
3428
Start-FileDownload "http://www.npcglib.org/~stathis/downloads/openssl-1.0.2d-vs2015.7z" -FileName "openssl.7z"
35-
7z x openssl.7z -o"C:\OpenSSL"
36-
37-
$env:OPENSSL_INCLUDE_DIR="C:\OpenSSL\openssl-1.0.2d-vs2015\include"
38-
if ($env:BITS -eq "32") {
39-
$env:OPENSSL_LIB_DIR="C:\OpenSSL\openssl-1.0.2d-vs2015\lib"
40-
} else {
41-
$env:OPENSSL_LIB_DIR="C:\OpenSSL\openssl-1.0.2d-vs2015\lib64"
42-
}
43-
$env:OPENSSL_LIBS="ssleay32MT:libeay32MT"
29+
7z x openssl.7z -o"C:\OpenSSL" | Out-Null
4430
}
45-
31+
4632
# Print version info
4733
rustc -vV
4834
cargo -vV
49-
35+
5036
# Configure git
5137
git config --global user.email "diggsey@googlemail.com"
5238
git config --global user.name "Diggory Blake (via Appveyor CI)"
5339
git config --global push.default simple
5440
55-
build_script:
56-
- ps: |
57-
if ($env:TARGET -match "-gnu$") {
58-
cargo rustc --release --bin multirust-rs -- -C link-args="-lgdi32 -luser32"
59-
}
60-
if ($env:TARGET -match "-msvc$") {
61-
cargo rustc --release --bin multirust-rs -- -C link-args="gdi32.lib user32.lib"
62-
}
63-
# Generate hashes
64-
Get-FileHash .\target\release\* | ForEach-Object {[io.file]::WriteAllText($_.Path + ".sha256", $_.Hash.ToLower() + "`n")}
41+
build: false
6542
test_script:
43+
- cargo build --release
44+
- cargo test
45+
- cargo test -p rust-install
46+
- cargo test -p rust-manifest
6647
- tests\cli.bat
6748
notifications:
6849
- provider: Webhook
6950
url: https://webhooks.gitter.im/e/9907ad94eb7a5ff291c3
7051
on_success:
7152
- ps: |
7253
if (!$env:APPVEYOR_PULL_REQUEST_NUMBER) {
54+
cargo build --release
55+
# Generate hashes
56+
Get-FileHash .\target\release\* | ForEach-Object {[io.file]::WriteAllText($_.Path + ".sha256", $_.Hash.ToLower() + "`n")}
57+
7358
if ($env:APPVEYOR_REPO_BRANCH -eq "master") {
7459
$bin = "binaries\$env:TARGET"
7560
} else {
7661
$bin = "binaries\$env:APPVEYOR_REPO_BRANCH\$env:TARGET"
7762
}
78-
63+
7964
cmd /c "git config --global credential.helper store 2>&1"
8065
Add-Content "$env:USERPROFILE\.git-credentials" "https://$($env:access_token):x-oauth-basic@github.com`n"
8166
cmd /c "git submodule init 2>&1"

rust-install/Cargo.toml

+2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ ole32-sys = "0.2.0"
2121
tar = "0.3.1"
2222
flate2 = "0.2.9"
2323
rust-manifest = { version = "0.0.1", path = "../rust-manifest" }
24+
tempdir = "0.3.4"
25+
walkdir = "0.1.5"
2426

2527
[target.x86_64-pc-windows-gnu.dependencies]
2628
winapi = "0.2.4"

0 commit comments

Comments
 (0)