Merge lp:~mandel/ubuntuone-windows-installer/skip-lint into lp:ubuntuone-windows-installer

Proposed by Manuel de la Peña
Status: Merged
Approved by: Manuel de la Peña
Approved revision: 105
Merged at revision: 105
Proposed branch: lp:~mandel/ubuntuone-windows-installer/skip-lint
Merge into: lp:ubuntuone-windows-installer
Diff against target: 133 lines (+73/-17)
1 file modified
run-tests.bat (+73/-17)
To merge this branch: bzr merge lp:~mandel/ubuntuone-windows-installer/skip-lint
Reviewer Review Type Date Requested Status
Roberto Alsina (community) Approve
Review via email: mp+90899@code.launchpad.net

Commit message

Adds the /skip-lint flag so that the lint tests are not done and allows to pass extra params to u1trial.

Description of the change

Adds the /skip-lint flag so that the lint tests are not done and allows to pass extra params to u1trial.

To post a comment you must log in.
Revision history for this message
Roberto Alsina (ralsina) wrote :

+1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'run-tests.bat'
2--- run-tests.bat 2011-12-01 12:27:33 +0000
3+++ run-tests.bat 2012-01-31 16:35:32 +0000
4@@ -14,56 +14,112 @@
5 :: You should have received a copy of the GNU General Public License along
6 :: with this program. If not, see <http://www.gnu.org/licenses/>.
7 @ECHO off
8+
9 :: We could have Python 2.6 or 2.7 on Windows. In order to check availability,
10 :: we should first check for 2.7, and run the tests, otherwise fall back to 2.6.
11+SET REGQUERY27="REG QUERY HKLM\Software\Python\PythonCore\2.7\InstallPath /ve"
12+SET REGQUERY2732="REG QUERY HKLM\Software\Wow6432Node\Python\PythonCore\2.7\InstallPath /ve"
13+SET REGQUERY26="REG QUERY HKLM\Software\Python\PythonCore\2.6\InstallPath /ve"
14+SET REGQUERY2632="REG QUERY HKLM\Software\Wow6432Node\Python\PythonCore\2.6\InstallPath /ve"
15 SET PYTHONEXEPATH=""
16+
17 :: This is very annoying; FOR /F will work differently depending on the output
18 :: of reg which is not consistent between OS versions (XP, 7). We must choose
19 :: the tokens according to OS version.
20 SET PYTHONPATHTOKENS=3
21 VER | FIND "XP" > nul
22-IF %ERRORLEVEL% == 0 SET PYTHONPATHTOKENS=4
23+IF %ERRORLEVEL% == 0 (
24+ SET PYTHONPATHTOKENS=4)
25+
26 ECHO Checking if python 2.7 is in the system
27+
28 :: Look for python 2.7
29-FOR /F "tokens=%PYTHONPATHTOKENS%" %%A IN ('REG QUERY HKLM\Software\Python\PythonCore\2.7\InstallPath /ve') DO @SET PYTHONEXEPATH=%%A
30-IF NOT %PYTHONEXEPATH% == "" GOTO :PYTHONPRESENT
31+FOR /F "tokens=%PYTHONPATHTOKENS%" %%A IN ('%REGQUERY27%') DO @SET PYTHONEXEPATH=%%A
32+IF NOT %PYTHONEXEPATH% == "" (
33+ GOTO :PYTHONPRESENT)
34+
35 ECHO Checking if python 2.6 is in the system
36 :: we do not have python 2.7 in the system, try to find 2.6
37-FOR /F "tokens=%PYTHONPATHTOKENS%" %%A IN ('REG QUERY HKLM\Software\Python\PythonCore\2.6\InstallPath /ve') DO @SET PYTHONEXEPATH=%%A
38-IF NOT %PYTHONEXEPATH% == "" GOTO :PYTHONPRESENT
39+FOR /F "tokens=%PYTHONPATHTOKENS%" %%A IN ('%REGQUERY26%') DO @SET PYTHONEXEPATH=%%A
40+
41+IF NOT %PYTHONEXEPATH% == "" (
42+ GOTO :PYTHONPRESENT)
43
44 :: we do not have python (2.6 or 2.7) this could hapen in the case that the
45 :: user installed the 32version in a 64 machine, let check if the software was installed in the wow key
46
47 :: Look for python 2.7 in WoW64
48 ECHO Checking if python 2.7 32 is in the system
49-FOR /F "tokens=%PYTHONPATHTOKENS%" %%A IN ('REG QUERY HKLM\Software\Wow6432Node\Python\PythonCore\2.7\InstallPath /ve') DO @SET PYTHONEXEPATH=%%A
50-IF NOT %PYTHONEXEPATH% == "" GOTO :PYTHONPRESENT
51+FOR /F "tokens=%PYTHONPATHTOKENS%" %%A IN ('%REGQUERY2732%') DO @SET PYTHONEXEPATH=%%A
52+
53+IF NOT %PYTHONEXEPATH% == "" (
54+ GOTO :PYTHONPRESENT)
55+
56 ECHO Checking if python 2.6 32 is in the system
57 :: we do not have python 2.7 in the system, try to find 2.6
58-FOR /F "tokens=%PYTHONPATHTOKENS%" %%A IN ('REG QUERY HKLM\Software\Wow6432Node\Python\PythonCore\2.6\InstallPath /ve') DO @SET PYTHONEXEPATH=%%A
59-IF NOT %PYTHONEXEPATH% == "" GOTO :PYTHONPRESENT
60+FOR /F "tokens=%PYTHONPATHTOKENS%" %%A IN ('%REGQUERY2632%') DO @SET PYTHONEXEPATH=%%A
61+IF NOT %PYTHONEXEPATH% == "" (
62+ GOTO :PYTHONPRESENT)
63
64 ECHO Please ensure you have python installed
65 GOTO :END
66
67 :PYTHONPRESENT
68+
69+:: throw the first parameter away if is /skip-lint,
70+:: the way we do this is to ensure that /skip-lint
71+:: is the first parameter and copy all the rest in a loop
72+:: the main reason for that is that %* is not affected
73+:: by SHIFT, that is, it allways have all passed parameters
74+
75+SET PARAMS=%*
76+SET SKIPLINT=0
77+IF "%1" == "/skip-lint" (
78+ SET SKIPLINT=1
79+ GOTO :CLEANPARAMS
80+)ELSE (
81+ GOTO :CONTINUEBATCH)
82+:CLEANPARAMS
83+
84+SHIFT
85+SET PARAMS=%1
86+:GETREST
87+SHIFT
88+if [%1]==[] (
89+ GOTO CONTINUEBATCH)
90+SET PARAMS=%PARAMS% %1
91+GOTO GETREST
92+:CONTINUEBATCH
93+
94+ECHO Python found, building auto-generated modules...
95+:: call setup.py build so that the qt uic is called
96+::START "Build code" /D%CD% /WAIT "%PYTHONEXEPATH%\python.exe" setup.py build
97+"%PYTHONEXEPATH%\python.exe" setup.py build
98+
99+ECHO Running tests
100+
101+:: execute the tests with a number of ignored linux only modules
102+"%PYTHONEXEPATH%\python.exe" "%PYTHONEXEPATH%\Scripts\u1trial" -i "test_linux.py" --gui --reactor=qt4 -c %PARAMS% ubuntuone_installer
103+
104 :: Clean the build from the setup.py
105 ECHO Cleaning the generated code before running the style checks...
106+
107 "%PYTHONEXEPATH%\python.exe" setup.py clean
108+
109+IF %SKIPLINT% == 1 (
110+ ECHO Skipping style checks
111+ GOTO :CLEAN)
112+
113 ECHO Performing style checks...
114 set USE_PYFLAKES=1
115 "%PYTHONEXEPATH%\python.exe" "%PYTHONEXEPATH%\Scripts\u1lint" ubuntuone_installer
116 :: test for style if we can, if pep8 is not present, move to the end
117-IF EXIST "%PYTHONEXEPATH%\Scripts\pep8.exe" "%PYTHONEXEPATH%\Scripts\pep8.exe" --repeat --exclude="*_ui.py,*_rc.py" .
118+IF EXIST "%PYTHONEXEPATH%\Scripts\pep8.exe" (
119+ "%PYTHONEXEPATH%\Scripts\pep8.exe" --repeat --exclude="*_ui.py,*_rc.py" .
120+
121+:CLEAN
122 :: Delete the temp folders
123 RMDIR /s /q _trial_temp
124 RMDIR /s /q .coverage
125 :END
126-ECHO Python found, building auto-generated modules...
127-:: call setup.py build so that the qt uic is called
128-::START "Build code" /D%CD% /WAIT "%PYTHONEXEPATH%\python.exe" setup.py build
129-"%PYTHONEXEPATH%\python.exe" setup.py build
130-ECHO Running tests
131-:: execute the tests with a number of ignored linux only modules
132-"%PYTHONEXEPATH%\python.exe" "%PYTHONEXEPATH%\Scripts\u1trial" -i "test_linux.py" --gui --reactor=qt4 -c ubuntuone_installer
133+

Subscribers

People subscribed via source and target branches