|
| 1 | +REM Copyright 2015 Brian Smith. |
| 2 | +REM Copyright 2016 Cory Benfield. |
| 3 | +REM |
| 4 | +REM Permission to use, copy, modify, and/or distribute this software for any |
| 5 | +REM purpose with or without fee is hereby granted, provided that the above |
| 6 | +REM copyright notice and this permission notice appear in all copies. |
| 7 | +REM |
| 8 | +REM THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHORS DISCLAIM ALL WARRANTIES |
| 9 | +REM WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF |
| 10 | +REM MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR |
| 11 | +REM ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |
| 12 | +REM WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
| 13 | +REM ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
| 14 | + |
| 15 | +echo on |
| 16 | +SetLocal EnableDelayedExpansion |
| 17 | + |
| 18 | +REM This is the recommended way to choose the toolchain version, according to |
| 19 | +REM Appveyor's documentation. |
| 20 | +SET PATH=C:\Program Files (x86)\MSBuild\%TOOLCHAIN_VERSION%\Bin;%PATH% |
| 21 | + |
| 22 | +set VCVARSALL="C:\Program Files (x86)\Microsoft Visual Studio %TOOLCHAIN_VERSION%\VC\vcvarsall.bat" |
| 23 | + |
| 24 | +if [%Platform%] NEQ [x64] goto win32 |
| 25 | +set TARGET_ARCH=x86_64 |
| 26 | +set TARGET_PROGRAM_FILES=%ProgramFiles% |
| 27 | +call %VCVARSALL% amd64 |
| 28 | +if %ERRORLEVEL% NEQ 0 exit 1 |
| 29 | +goto download |
| 30 | + |
| 31 | +:win32 |
| 32 | +echo on |
| 33 | +if [%Platform%] NEQ [Win32] exit 1 |
| 34 | +set TARGET_ARCH=i686 |
| 35 | +set TARGET_PROGRAM_FILES=%ProgramFiles(x86)% |
| 36 | +call %VCVARSALL% amd64_x86 |
| 37 | +if %ERRORLEVEL% NEQ 0 exit 1 |
| 38 | +goto download |
| 39 | + |
| 40 | +:download |
| 41 | +REM vcvarsall turns echo off |
| 42 | +echo on |
| 43 | + |
| 44 | +REM Install Rust |
| 45 | +set RUST_URL=https://static.rust-lang.org/dist/rust-%RUST%-%TARGET_ARCH%-pc-windows-msvc.msi |
| 46 | +echo Downloading %RUST_URL%... |
| 47 | +mkdir build |
| 48 | +powershell -Command "(New-Object Net.WebClient).DownloadFile('%RUST_URL%', 'build\rust-%RUST%-%TARGET_ARCH%-pc-windows-msvc.msi')" |
| 49 | +if %ERRORLEVEL% NEQ 0 ( |
| 50 | + echo ...downloading failed. |
| 51 | + exit 1 |
| 52 | +) |
| 53 | + |
| 54 | +start /wait msiexec /i build\rust-%RUST%-%TARGET_ARCH%-pc-windows-msvc.msi INSTALLDIR="%TARGET_PROGRAM_FILES%\Rust %RUST%" /quiet /qn /norestart |
| 55 | +if %ERRORLEVEL% NEQ 0 exit 1 |
| 56 | + |
| 57 | +set PATH="%PYTHON%";"%PYTHON%\Scripts";"%TARGET_PROGRAM_FILES%\Rust %RUST%\bin";%PATH% |
| 58 | + |
| 59 | +link /? |
| 60 | +cl /? |
| 61 | +rustc --version |
| 62 | +cargo --version |
| 63 | + |
| 64 | +python -m pip install -U setuptools pip |
| 65 | +if %ERRORLEVEL% NEQ 0 exit 1 |
| 66 | + |
| 67 | +python -m pip install -r test_requirements.txt |
| 68 | +if %ERRORLEVEL% NEQ 0 exit 1 |
| 69 | + |
| 70 | +python -m pip install . |
| 71 | +if %ERRORLEVEL% NEQ 0 exit 1 |
| 72 | + |
| 73 | +py.test test/ |
| 74 | +if %ERRORLEVEL% NEQ 0 exit 1 |
0 commit comments