~nataliabidart/ubuntuone-control-panel/stable-3-0-update-2.99.5

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
:: Copyright 2011-12 Canonical Ltd.
::
:: This program is free software: you can redistribute it and/or modify it
:: under the terms of the GNU General Public License version 3, as published
:: by the Free Software Foundation.
::
:: This program is distributed in the hope that it will be useful, but
:: WITHOUT ANY WARRANTY; without even the implied warranties of
:: MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
:: PURPOSE.  See the GNU General Public License for more details.
::
:: You should have received a copy of the GNU General Public License along
:: with this program.  If not, see <http://www.gnu.org/licenses/>.

:: call setup.py build so that the qt uic is called

@ECHO off

SET MODULE="ubuntuone"
SET PYTHONEXEPATH="C:\Python27"
SET IGNORE_PATHS="ubuntuone\controlpanel\gui\gtk, ubuntuone\controlpanel\dbustests"
SET IGNORE_MODULES="test_linux.py, test_libsoup.py"

:: throw the first parameter away if is /skip-lint,
:: the way we do this is to ensure that /skip-lint
:: is the first parameter and copy all the rest in a loop
:: the main reason for that is that %* is not affected
:: by SHIFT, that is, it allways have all passed parameters

SET PARAMS=%*
SET SKIPLINT=0
IF "%1" == "/skip-lint" (
    SET SKIPLINT=1
    GOTO :CLEANPARAMS
)ELSE (
    GOTO :CONTINUEBATCH) 
:CLEANPARAMS

SHIFT
SET PARAMS=%1
:GETREST
SHIFT
if [%1]==[] (
    GOTO CONTINUEBATCH)
SET PARAMS=%PARAMS% %1
GOTO GETREST
:CONTINUEBATCH


"%PYTHONEXEPATH%\python.exe" setup.py build
ECHO Running tests
:: execute the tests with a number of ignored linux only modules
"%PYTHONEXEPATH%\python.exe" "%PYTHONEXEPATH%\Scripts\u1trial" --reactor=qt4 --gui -p %IGNORE_PATHS% -i %IGNORE_MODULES% %PARAMS% %MODULE%
:: Clean the build from the setupt.py
ECHO Cleaning the generated code
"%PYTHONEXEPATH%\python.exe" setup.py clean

IF %SKIPLINT% == 1 GOTO :CLEAN
ECHO Performing style checks...
"%PYTHONEXEPATH%\python.exe" "%PYTHONEXEPATH%\Scripts\u1lint" --ignore ubuntuone\controlpanel\gui\qt\ui "%MODULE%"
"%PYTHONEXEPATH%\Scripts\pep8.exe" --exclude ".svn,CVS,.bzr,.hg,.git,*_ui.py,*_rc.py" --repeat . bin\*
:CLEAN
:: Delete the temp folders
RMDIR /s /q _trial_temp