~dobey/ubuntu/oneiric/ubuntu-sso-client/release-133

« back to all changes in this revision

Viewing changes to run-tests.bat

  • Committer: Sebastien Bacher
  • Date: 2011-07-25 19:22:29 UTC
  • mfrom: (32.2.3 ubuntu-sso-client)
  • Revision ID: seb128@ubuntu.com-20110725192229-r2kxv3bo1mvk5fj7
* New upstream release.
  - Support new CreateCollection API as well (LP: #805244)
* cleanup leftover from the dh_python2 transition, 
  thanks to Stefano Rivera

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
@ECHO off
17
17
:: We could have Python 2.6 or 2.7 on Windows. In order to check availability,
18
18
:: we should first check for 2.7, and run the tests, otherwise fall back to 2.6.
19
 
SET PYTHONPATH=""
 
19
SET PYTHONEXEPATH=""
20
20
:: This is very annoying; FOR /F will work differently depending on the output
21
21
:: of reg which is not consistent between OS versions (XP, 7). We must choose
22
22
:: the tokens according to OS version.
25
25
IF %ERRORLEVEL% == 0 SET PYTHONPATHTOKENS=4
26
26
ECHO Checking if python 2.7 is in the system
27
27
:: Look for python 2.7
28
 
FOR /F "tokens=%PYTHONPATHTOKENS%" %%A IN ('REG QUERY HKLM\Software\Python\PythonCore\2.7\InstallPath /ve') DO @SET PYTHONPATH=%%A
29
 
IF NOT %PYTHONPATH% == "" GOTO :PYTHONPRESENT
 
28
FOR /F "tokens=%PYTHONPATHTOKENS%" %%A IN ('REG QUERY HKLM\Software\Python\PythonCore\2.7\InstallPath /ve') DO @SET PYTHONEXEPATH=%%A
 
29
IF NOT %PYTHONEXEPATH% == "" GOTO :PYTHONPRESENT
30
30
ECHO Checking if python 2.6 is in the system
31
31
:: we do not have python 2.7 in the system, try to find 2.6
32
 
FOR /F "tokens=%PYTHONPATHTOKENS%" %%A IN ('REG QUERY HKLM\Software\Python\PythonCore\2.6\InstallPath /ve') DO @SET PYTHONPATH=%%A
33
 
IF NOT %PYTHONPATH% == "" GOTO :PYTHONPRESENT
 
32
FOR /F "tokens=%PYTHONPATHTOKENS%" %%A IN ('REG QUERY HKLM\Software\Python\PythonCore\2.6\InstallPath /ve') DO @SET PYTHONEXEPATH=%%A
 
33
IF NOT %PYTHONEXEPATH% == "" GOTO :PYTHONPRESENT
34
34
 
35
35
:: we do not have python (2.6 or 2.7) this could hapen in the case  that the
36
36
:: user installed the 32version in a 64 machine, let check if the software was installed in the wow key
37
37
 
38
38
:: Look for python 2.7 in WoW64
39
39
ECHO Checking if python 2.7 32 is in the system
40
 
FOR /F "tokens=%PYTHONPATHTOKENS%" %%A IN ('REG QUERY HKLM\Software\Wow6432Node\Python\PythonCore\2.7\InstallPath /ve') DO @SET PYTHONPATH=%%A
41
 
IF NOT %PYTHONPATH% == "" GOTO :PYTHONPRESENT
 
40
FOR /F "tokens=%PYTHONPATHTOKENS%" %%A IN ('REG QUERY HKLM\Software\Wow6432Node\Python\PythonCore\2.7\InstallPath /ve') DO @SET PYTHONEXEPATH=%%A
 
41
IF NOT %PYTHONEXEPATH% == "" GOTO :PYTHONPRESENT
42
42
ECHO Checking if python 2.6 32 is in the system
43
43
:: we do not have python 2.7 in the system, try to find 2.6
44
 
FOR /F "tokens=%PYTHONPATHTOKENS%" %%A IN ('REG QUERY HKLM\Software\Wow6432Node\Python\PythonCore\2.6\InstallPath /ve') DO @SET PYTHONPATH=%%A
45
 
IF NOT %PYTHONPATH% == "" GOTO :PYTHONPRESENT
 
44
FOR /F "tokens=%PYTHONPATHTOKENS%" %%A IN ('REG QUERY HKLM\Software\Wow6432Node\Python\PythonCore\2.6\InstallPath /ve') DO @SET PYTHONEXEPATH=%%A
 
45
IF NOT %PYTHONEXEPATH% == "" GOTO :PYTHONPRESENT
46
46
 
47
47
ECHO Please ensure you have python installed
48
48
GOTO :END
49
49
 
50
50
 
51
51
:PYTHONPRESENT
52
 
ECHO Python found, executing the tests...
 
52
ECHO Python found, building auto-generated modules...
 
53
:: call setup.py build so that the qt uic is called
 
54
::START "Build code" /D%CD% /WAIT "%PYTHONEXEPATH%\python.exe" setup.py build
 
55
"%PYTHONEXEPATH%\python.exe" setup.py build
 
56
ECHO Running tests
53
57
:: execute the tests with a number of ignored linux only modules
54
 
"%PYTHONPATH%\python.exe" "%PYTHONPATH%\Scripts\u1trial" -c ubuntu_sso -i "test_gui.py, test_linux.py, test_txsecrets.py"
55
 
"%PYTHONPATH%\python.exe" "%PYTHONPATH%\Scripts\u1lint" ubuntu_sso
 
58
"%PYTHONEXEPATH%\python.exe" "%PYTHONEXEPATH%\Scripts\u1trial" -c ubuntu_sso -i "test_gui.py, test_linux.py, test_txsecrets.py" --reactor=qt4 --gui
 
59
:: Clean the build from the setupt.py
 
60
ECHO Cleaning the generated code before running the style checks...
 
61
"%PYTHONEXEPATH%\python.exe" setup.py clean
 
62
ECHO Performing style checks...
 
63
"%PYTHONEXEPATH%\python.exe" "%PYTHONEXEPATH%\Scripts\u1lint" ubuntu_sso
56
64
:: test for style if we can, if pep8 is not present, move to the end
57
 
IF EXIST "%PYTHONPATH%Scripts\pep8.exe"
58
 
"%PYTHONPATH%\Scripts\pep8.exe" --repeat ubuntu_sso
 
65
IF EXIST "%PYTHONEXEPATH%\Scripts\pep8.exe"
 
66
"%PYTHONEXEPATH%\Scripts\pep8.exe" --repeat ubuntu_sso
59
67
ELSE
60
68
ECHO Style checks were not done
61
69
:: Delete the temp folders
62
70
RMDIR /s /q _trial_temp
63
71
RMDIR /s /q .coverage
64
 
:END
 
 
b'\\ No newline at end of file'
 
72
:END