Merge lp:~mandel/ubuntu-sso-client/run_tests_windows into lp:ubuntu-sso-client

Proposed by Manuel de la Peña
Status: Merged
Approved by: Manuel de la Peña
Approved revision: 676
Merged at revision: 676
Proposed branch: lp:~mandel/ubuntu-sso-client/run_tests_windows
Merge into: lp:ubuntu-sso-client
Diff against target: 69 lines (+64/-0)
1 file modified
run-tests.bat (+64/-0)
To merge this branch: bzr merge lp:~mandel/ubuntu-sso-client/run_tests_windows
Reviewer Review Type Date Requested Status
Eric Casteleijn (community) Approve
Natalia Bidart (community) Approve
Review via email: mp+52081@code.launchpad.net

Commit message

Added batch to run the tests on windows.

Description of the change

Added batch to run the tests on windows.

To post a comment you must log in.
Revision history for this message
Natalia Bidart (nataliabidart) wrote :

Looks much better now.

review: Approve
Revision history for this message
Eric Casteleijn (thisfred) wrote :

Looks good (well, you know)

review: Approve
Revision history for this message
Manuel de la Peña (mandel) wrote :

> Looks good (well, you know)

hehe :)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'run-tests.bat'
2--- run-tests.bat 1970-01-01 00:00:00 +0000
3+++ run-tests.bat 2011-03-03 15:10:52 +0000
4@@ -0,0 +1,64 @@
5+:: Author: Manuel de la Pena <manuel@canonical.com>
6+::
7+:: Copyright 2010 Canonical Ltd.
8+::
9+:: This program is free software: you can redistribute it and/or modify it
10+:: under the terms of the GNU General Public License version 3, as published
11+:: by the Free Software Foundation.
12+::
13+:: This program is distributed in the hope that it will be useful, but
14+:: WITHOUT ANY WARRANTY; without even the implied warranties of
15+:: MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
16+:: PURPOSE. See the GNU General Public License for more details.
17+::
18+:: You should have received a copy of the GNU General Public License along
19+:: with this program. If not, see <http://www.gnu.org/licenses/>.
20+@ECHO off
21+:: We could have Python 2.6 or 2.7 on Windows. In order to check availability,
22+:: we should first check for 2.7, and run the tests, otherwise fall back to 2.6.
23+SET PYTHONPATH=""
24+:: This is very annoying; FOR /F will work differently depending on the output
25+:: of reg which is not consistent between OS versions (XP, 7). We must choose
26+:: the tokens according to OS version.
27+SET PYTHONPATHTOKENS=3
28+VER | FIND "XP" > nul
29+IF %ERRORLEVEL% == 0 SET PYTHONPATHTOKENS=4
30+ECHO Checking if python 2.7 is in the system
31+:: Look for python 2.7
32+FOR /F "tokens=%PYTHONPATHTOKENS%" %%A IN ('REG QUERY HKLM\Software\Python\PythonCore\2.7\InstallPath /ve') DO @SET PYTHONPATH=%%A
33+IF NOT %PYTHONPATH% == "" GOTO :PYTHONPRESENT
34+ECHO Checking if python 2.6 is in the system
35+:: we do not have python 2.7 in the system, try to find 2.6
36+FOR /F "tokens=%PYTHONPATHTOKENS%" %%A IN ('REG QUERY HKLM\Software\Python\PythonCore\2.6\InstallPath /ve') DO @SET PYTHONPATH=%%A
37+IF NOT %PYTHONPATH% == "" GOTO :PYTHONPRESENT
38+
39+:: we do not have python (2.6 or 2.7) this could hapen in the case that the
40+:: user installed the 32version in a 64 machine, let check if the software was installed in the wow key
41+
42+:: Look for python 2.7 in WoW64
43+ECHO Checking if python 2.7 32 is in the system
44+FOR /F "tokens=%PYTHONPATHTOKENS%" %%A IN ('REG QUERY HKLM\Software\Wow6432Node\Python\PythonCore\2.7\InstallPath /ve') DO @SET PYTHONPATH=%%A
45+IF NOT %PYTHONPATH% == "" GOTO :PYTHONPRESENT
46+ECHO Checking if python 2.6 32 is in the system
47+:: we do not have python 2.7 in the system, try to find 2.6
48+FOR /F "tokens=%PYTHONPATHTOKENS%" %%A IN ('REG QUERY HKLM\Software\Wow6432Node\Python\PythonCore\2.6\InstallPath /ve') DO @SET PYTHONPATH=%%A
49+IF NOT %PYTHONPATH% == "" GOTO :PYTHONPRESENT
50+
51+ECHO Please ensure you have python installed
52+GOTO :END
53+
54+
55+:PYTHONPRESENT
56+ECHO Python found, executing the tests...
57+:: execute the tests with a number of ignored linux only modules
58+"%PYTHONPATH%\python.exe" "%PYTHONPATH%\Scripts\u1trial" -c ubuntu_sso -i "test_gui.py"
59+"%PYTHONPATH%\python.exe" "%PYTHONPATH%\Scripts\u1lint"
60+:: test for style if we can, if pep8 is not present, move to the end
61+IF EXIST "%PYTHONPATH%Scripts\pep8.exe"
62+"%PYTHONPATH%\Scripts\pep8.exe" --repeat ubuntu_sso
63+ELSE
64+ECHO Style checks were not done
65+:: Delete the temp folders
66+RMDIR /s /q _trial_temp
67+RMDIR /s /q .coverage
68+:END
69\ No newline at end of file

Subscribers

People subscribed via source and target branches