Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,26 @@ install:
- cmd: "setlocal & SET PATH=%PYTHON%;c:\\Python27\\Scripts;%PATH% & pip2 wheel numpy & endlocal"
- cmd: "setlocal & SET PATH=%PYTHON%;c:\\Python27\\Scripts;%PATH% & pip2 install nose numpy psutil mock & endlocal"
- cmd: "setlocal & SET PATH=%PYTHON%;c:\\Python27\\Scripts;%PATH% & pip2 install git+https://github.com/3drobotics/dronekit-sitl-runner.git & endlocal"

- cmd: choco install innosetup
- cmd: cd windows & droneapiWinBuild.bat
- ps: |
Invoke-WebRequest "http://firmware.diydrones.com/Tools/MAVProxy/MAVProxySetup-latest.exe" -OutFile MAVProxySetup-latest.exe
.\MAVProxySetup-latest.exe /VERYSILENT /LOG=setup-mavproxy.log
while (!(Test-Path "setup-mavproxy.log")) { Start-Sleep 1 }
while(!(Select-String -path 'setup-mavproxy.log' -pattern 'Log closed' -quiet)){ Start-Sleep 1 };
rm ~\AppData\Local\MAVProxy\mavinit.scr
- ps: |
$setup = gi .\windows\Output\DroneKitsetup-*.exe
& $setup /VERYSILENT /LOG=setup-dronekit.log
while (!(Test-Path "setup-dronekit.log")) { Start-Sleep 1 }
while(!(Select-String -path 'setup-dronekit.log' -pattern 'Log closed' -quiet)){ Start-Sleep 1};

build_script:
- cmd: "setlocal & SET PATH=%PYTHON%;c:\\Python27\\Scripts;c:\\Program Files (x86)\\MAVProxy;%PATH% & python -m tests.sitl & endlocal"
- cmd: 'setlocal & python setup.py install & endlocal'
- cmd: "setlocal & SET PATH=%PYTHON%;c:\\Python27\\Scripts;%PATH% & nosetests tests\\web & endlocal"
- cmd: "setlocal & SET PATH=%PYTHON%;c:\\Python27\\Scripts;%PATH% & nosetests tests\\unit & endlocal"
- cmd: "setlocal & SET PATH=%PYTHON%;c:\\Python27\\Scripts;%PATH% & python -m tests.sitl & endlocal"
clone_depth: 10
test: 'off'
branches:
Expand Down
13 changes: 12 additions & 1 deletion tests/sitl/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,18 @@ def lets_run_a_test(name):
timeout = 5*60

try:
p = Popen([sys.executable, '-m', 'MAVProxy.mavproxy', '--logfile=' + tempfile.mkstemp()[1], '--master=tcp:127.0.0.1:5760'],
if sys.platform == 'win32':
try:
# Try to find installed Python MAVProxy module.
import imp
imp.find_module('MAVProxy')
mavprog = [sys.executable, '-m', 'MAVProxy.mavproxy']
except:
# Uses mavproxy.exe instead.
mavprog = ['mavproxy']
else:
mavprog = [sys.executable, '-m', 'MAVProxy.mavproxy']
p = Popen(mavprog + ['--logfile=' + tempfile.mkstemp()[1], '--master=tcp:127.0.0.1:5760'],
cwd=testpath, env=newenv, stdin=PIPE, stdout=PIPE,
stderr=PIPE if not mavproxy_verbose else None)
bg.append(p)
Expand Down
27 changes: 24 additions & 3 deletions windows/droneapiWinBuild.bat
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,29 @@ for /f "tokens=*" %%a in (
set VERSION=%%a
)

rem -----Get protobuf and unzip-----
C:\python27\scripts\pip.exe install --download .\ protobuf
rem get the protobuf fullname
for /f "tokens=*" %%a in (
'dir /B protobuf-*'
) do (
set PROTOBUFFULL=%%a
)

rem -----Build the Installer-----
"C:\Program Files (x86)\Inno Setup 5\ISCC.exe" /dMyAppVersion=%VERSION% -compile droneapi_installer.iss
rem Use 7zip to unzip files. Works for both 32 and 64 bit versions
"C:\Program Files\7-zip\7z.exe" x -y %PROTOBUFFULL%
"C:\Program Files\7-zip\7z.exe" x -y .\dist\protobuf*
"C:\Program Files (x86)\7-zip\7z.exe" x -y %PROTOBUFFULL%
"C:\Program Files (x86)\7-zip\7z.exe" x -y .\dist\protobuf*

rem get the protobuf fullname
for /f "tokens=*" %%a in (
'dir /A:D /B protobuf-*'
) do (
set PROTOBUFDIR=%%a
)
xcopy /E /Y %PROTOBUFDIR%\google .\google\

pause

rem -----Build the Installer-----
"C:\Program Files (x86)\Inno Setup 5\ISCC.exe" /dMyAppVersion=%VERSION% droneapi_installer.iss
2 changes: 2 additions & 0 deletions windows/droneapi_installer.iss
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ Name: "english"; MessagesFile: "compiler:Default.isl"
[Files]
Source: "..\droneapi\*"; DestDir: "{code:GetMAVProxyPath}\droneapi"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "..\examples\*"; DestDir: "{code:GetMAVProxyPath}\examples"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "google\*"; DestDir: "{code:GetMAVProxyPath}\google"; Flags: ignoreversion recursesubdirs createallsubdirs

; NOTE: Don't use "Flags: ignoreversion" on any shared system files

; Check if MAVProxy is installed (if so, get the install path)
Expand Down