Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gevent
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gevent
Commits
ea2e00b5
Commit
ea2e00b5
authored
Oct 30, 2012
by
Denis Bilenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
util/wintest.py: support --python option and 'dist' command
parent
fc064fc1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
6 deletions
+38
-6
util/wintest.py
util/wintest.py
+38
-6
No files found.
util/wintest.py
View file @
ea2e00b5
...
...
@@ -4,20 +4,25 @@ import os
import
optparse
def
system
(
cmd
):
def
system
(
cmd
,
exit
=
True
):
sys
.
stderr
.
write
(
'+ %s
\
n
'
%
cmd
)
if
os
.
system
(
cmd
):
sys
.
exit
(
'%r failed'
%
cmd
)
return
0
retcode
=
os
.
system
(
cmd
)
if
retcode
:
if
exit
:
sys
.
exit
(
'%r failed'
%
cmd
)
return
retcode
parser
=
optparse
.
OptionParser
()
parser
.
add_option
(
'--host'
)
parser
.
add_option
(
'--username'
,
default
=
'Administrator'
)
parser
.
add_option
(
'--source'
)
parser
.
add_option
(
'--dist'
,
action
=
'store_true'
)
parser
.
add_option
(
'--python'
,
default
=
'27'
)
options
,
args
=
parser
.
parse_args
()
if
args
[
0
:
1
]
==
[
'test'
]:
def
prepare
():
source_name
=
args
[
1
]
tar_name
=
source_name
.
rsplit
(
'.'
,
1
)[
0
]
dir_name
=
tar_name
.
rsplit
(
'.'
,
1
)[
0
]
...
...
@@ -25,10 +30,22 @@ if args[0:1] == ['test']:
system
(
'gzip -d %s && tar -xf %s'
%
(
source_name
,
tar_name
))
os
.
chdir
(
dir_name
)
os
.
environ
.
setdefault
(
'VS90COMNTOOLS'
,
'C:
\
\
Program Files (x86)
\
\
Microsoft Visual Studio 10.0
\
\
Common7
\
Tools
\
\
'
)
if args[0:1] == ['
test
']:
prepare()
system('
%
s
setup
.
py
build
' % sys.executable)
os.chdir('
greentest
')
os.environ['
PYTHONPATH
'] = '
.;..;..
/
..
'
system('
%
s
testrunner
.
py
--
expected
..
/
known_failures
.
txt
' % sys.executable)
elif args[0:1] == ['
dist
']:
prepare()
success = 0
for command in ['
bdist_egg
', '
bdist_wininst
', '
bdist_msi
']:
cmd = sys.executable + '
setup
.
py
' + command
if not system(cmd, exit=False):
success += 1
if not success:
sys.exit('
bdist_egg
bdist_wininst
and
bdist_msi
all
failed
')
elif not args:
assert options.host
if not options.source:
...
...
@@ -39,7 +56,22 @@ elif not args:
options.script_path = os.path.abspath(__file__)
options.script_name = os.path.basename(__file__)
if options.python.isdigit():
options.python = '
C
:
/
Python
' + options.python + '
/
python
.
exe
'
tar_name = options.source_name.rsplit('
.
', 1)[0]
dir_name = tar_name.rsplit('
.
', 1)[0]
options.dir_name = dir_name
system('
scp
%
(
source
)
s
%
(
script_path
)
s
%
(
username
)
s
@%
(
host
)
s
:
' % options.__dict__)
system('
ssh
%
(
username
)
s
@%
(
host
)
s
C
:
/
Python27
/
python
.
exe
-
u
%
(
script_name
)
s
test
%
(
source_name
)
s
' % options.__dict__)
if options.dist:
system('
ssh
%
(
username
)
s
@%
(
host
)
s
%
(
python
)
s
-
u
%
(
script_name
)
s
dist
%
(
source_name
)
s
' % options.__dict__)
try:
os.mkdir('
dist
')
except OSError:
pass
system('
scp
-
r
%
(
username
)
s
@%
(
host
)
s
:
%
(
dir_name
)
s
/
dist
/
dist
' % options.__dict__)
else:
system('
ssh
%
(
username
)
s
@%
(
host
)
s
C
:
/
Python27
/
python
.
exe
-
u
%
(
script_name
)
s
test
%
(
source_name
)
s
' % options.__dict__)
else:
sys.exit('
Invalid
args
:
%
r' % (args, ))
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment