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
=== modified file 'run-tests.bat'
--- run-tests.bat 2011-12-01 12:27:33 +0000
+++ run-tests.bat 2012-01-31 16:35:32 +0000
@@ -14,56 +14,112 @@
14:: You should have received a copy of the GNU General Public License along14:: You should have received a copy of the GNU General Public License along
15:: with this program. If not, see <http://www.gnu.org/licenses/>.15:: with this program. If not, see <http://www.gnu.org/licenses/>.
16@ECHO off16@ECHO off
17
17:: We could have Python 2.6 or 2.7 on Windows. In order to check availability,18:: We could have Python 2.6 or 2.7 on Windows. In order to check availability,
18:: we should first check for 2.7, and run the tests, otherwise fall back to 2.6.19:: we should first check for 2.7, and run the tests, otherwise fall back to 2.6.
20SET REGQUERY27="REG QUERY HKLM\Software\Python\PythonCore\2.7\InstallPath /ve"
21SET REGQUERY2732="REG QUERY HKLM\Software\Wow6432Node\Python\PythonCore\2.7\InstallPath /ve"
22SET REGQUERY26="REG QUERY HKLM\Software\Python\PythonCore\2.6\InstallPath /ve"
23SET REGQUERY2632="REG QUERY HKLM\Software\Wow6432Node\Python\PythonCore\2.6\InstallPath /ve"
19SET PYTHONEXEPATH=""24SET PYTHONEXEPATH=""
25
20:: This is very annoying; FOR /F will work differently depending on the output26:: This is very annoying; FOR /F will work differently depending on the output
21:: of reg which is not consistent between OS versions (XP, 7). We must choose27:: of reg which is not consistent between OS versions (XP, 7). We must choose
22:: the tokens according to OS version.28:: the tokens according to OS version.
23SET PYTHONPATHTOKENS=329SET PYTHONPATHTOKENS=3
24VER | FIND "XP" > nul30VER | FIND "XP" > nul
25IF %ERRORLEVEL% == 0 SET PYTHONPATHTOKENS=431IF %ERRORLEVEL% == 0 (
32 SET PYTHONPATHTOKENS=4)
33
26ECHO Checking if python 2.7 is in the system34ECHO Checking if python 2.7 is in the system
35
27:: Look for python 2.736:: Look for python 2.7
28FOR /F "tokens=%PYTHONPATHTOKENS%" %%A IN ('REG QUERY HKLM\Software\Python\PythonCore\2.7\InstallPath /ve') DO @SET PYTHONEXEPATH=%%A37FOR /F "tokens=%PYTHONPATHTOKENS%" %%A IN ('%REGQUERY27%') DO @SET PYTHONEXEPATH=%%A
29IF NOT %PYTHONEXEPATH% == "" GOTO :PYTHONPRESENT38IF NOT %PYTHONEXEPATH% == "" (
39 GOTO :PYTHONPRESENT)
40
30ECHO Checking if python 2.6 is in the system41ECHO Checking if python 2.6 is in the system
31:: we do not have python 2.7 in the system, try to find 2.642:: we do not have python 2.7 in the system, try to find 2.6
32FOR /F "tokens=%PYTHONPATHTOKENS%" %%A IN ('REG QUERY HKLM\Software\Python\PythonCore\2.6\InstallPath /ve') DO @SET PYTHONEXEPATH=%%A43FOR /F "tokens=%PYTHONPATHTOKENS%" %%A IN ('%REGQUERY26%') DO @SET PYTHONEXEPATH=%%A
33IF NOT %PYTHONEXEPATH% == "" GOTO :PYTHONPRESENT44
45IF NOT %PYTHONEXEPATH% == "" (
46 GOTO :PYTHONPRESENT)
3447
35:: we do not have python (2.6 or 2.7) this could hapen in the case that the48:: we do not have python (2.6 or 2.7) this could hapen in the case that the
36:: user installed the 32version in a 64 machine, let check if the software was installed in the wow key49:: user installed the 32version in a 64 machine, let check if the software was installed in the wow key
3750
38:: Look for python 2.7 in WoW6451:: Look for python 2.7 in WoW64
39ECHO Checking if python 2.7 32 is in the system52ECHO Checking if python 2.7 32 is in the system
40FOR /F "tokens=%PYTHONPATHTOKENS%" %%A IN ('REG QUERY HKLM\Software\Wow6432Node\Python\PythonCore\2.7\InstallPath /ve') DO @SET PYTHONEXEPATH=%%A53FOR /F "tokens=%PYTHONPATHTOKENS%" %%A IN ('%REGQUERY2732%') DO @SET PYTHONEXEPATH=%%A
41IF NOT %PYTHONEXEPATH% == "" GOTO :PYTHONPRESENT54
55IF NOT %PYTHONEXEPATH% == "" (
56 GOTO :PYTHONPRESENT)
57
42ECHO Checking if python 2.6 32 is in the system58ECHO Checking if python 2.6 32 is in the system
43:: we do not have python 2.7 in the system, try to find 2.659:: we do not have python 2.7 in the system, try to find 2.6
44FOR /F "tokens=%PYTHONPATHTOKENS%" %%A IN ('REG QUERY HKLM\Software\Wow6432Node\Python\PythonCore\2.6\InstallPath /ve') DO @SET PYTHONEXEPATH=%%A60FOR /F "tokens=%PYTHONPATHTOKENS%" %%A IN ('%REGQUERY2632%') DO @SET PYTHONEXEPATH=%%A
45IF NOT %PYTHONEXEPATH% == "" GOTO :PYTHONPRESENT61IF NOT %PYTHONEXEPATH% == "" (
62 GOTO :PYTHONPRESENT)
4663
47ECHO Please ensure you have python installed64ECHO Please ensure you have python installed
48GOTO :END65GOTO :END
4966
50:PYTHONPRESENT67: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
75SET PARAMS=%*
76SET SKIPLINT=0
77IF "%1" == "/skip-lint" (
78 SET SKIPLINT=1
79 GOTO :CLEANPARAMS
80)ELSE (
81 GOTO :CONTINUEBATCH)
82:CLEANPARAMS
83
84SHIFT
85SET PARAMS=%1
86:GETREST
87SHIFT
88if [%1]==[] (
89 GOTO CONTINUEBATCH)
90SET PARAMS=%PARAMS% %1
91GOTO GETREST
92:CONTINUEBATCH
93
94ECHO 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
99ECHO 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
51:: Clean the build from the setup.py104:: Clean the build from the setup.py
52ECHO Cleaning the generated code before running the style checks...105ECHO Cleaning the generated code before running the style checks...
106
53"%PYTHONEXEPATH%\python.exe" setup.py clean107"%PYTHONEXEPATH%\python.exe" setup.py clean
108
109IF %SKIPLINT% == 1 (
110 ECHO Skipping style checks
111 GOTO :CLEAN)
112
54ECHO Performing style checks...113ECHO Performing style checks...
55set USE_PYFLAKES=1114set USE_PYFLAKES=1
56"%PYTHONEXEPATH%\python.exe" "%PYTHONEXEPATH%\Scripts\u1lint" ubuntuone_installer115"%PYTHONEXEPATH%\python.exe" "%PYTHONEXEPATH%\Scripts\u1lint" ubuntuone_installer
57:: test for style if we can, if pep8 is not present, move to the end116:: test for style if we can, if pep8 is not present, move to the end
58IF EXIST "%PYTHONEXEPATH%\Scripts\pep8.exe" "%PYTHONEXEPATH%\Scripts\pep8.exe" --repeat --exclude="*_ui.py,*_rc.py" .117IF EXIST "%PYTHONEXEPATH%\Scripts\pep8.exe" (
118 "%PYTHONEXEPATH%\Scripts\pep8.exe" --repeat --exclude="*_ui.py,*_rc.py" .
119
120:CLEAN
59:: Delete the temp folders121:: Delete the temp folders
60RMDIR /s /q _trial_temp122RMDIR /s /q _trial_temp
61RMDIR /s /q .coverage123RMDIR /s /q .coverage
62:END124:END
63ECHO Python found, building auto-generated modules...125
64:: call setup.py build so that the qt uic is called
65::START "Build code" /D%CD% /WAIT "%PYTHONEXEPATH%\python.exe" setup.py build
66"%PYTHONEXEPATH%\python.exe" setup.py build
67ECHO Running tests
68:: execute the tests with a number of ignored linux only modules
69"%PYTHONEXEPATH%\python.exe" "%PYTHONEXEPATH%\Scripts\u1trial" -i "test_linux.py" --gui --reactor=qt4 -c ubuntuone_installer

Subscribers

People subscribed via source and target branches