Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
circuitpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
circuitpython
Commits
23ccb3e1
Commit
23ccb3e1
authored
Feb 25, 2017
by
Krzysztof Blazewicz
Committed by
Damien George
Feb 27, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tools/gen-cpydiff.py: configurable CPython and micropython executables
parent
ae116c24
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
3 deletions
+13
-3
tools/gen-cpydiff.py
tools/gen-cpydiff.py
+13
-3
No files found.
tools/gen-cpydiff.py
View file @
23ccb3e1
...
...
@@ -33,8 +33,18 @@ import time
import
re
from
collections
import
namedtuple
# Micropython supports syntax of CPython 3.4 with some features from 3.5, and
# such version should be used to test for differences. If your default python3
# executable is of lower version, you can point MICROPY_CPYTHON3 environment var
# to the correct executable.
if
os
.
name
==
'nt'
:
CPYTHON3
=
os
.
getenv
(
'MICROPY_CPYTHON3'
,
'python3.exe'
)
MICROPYTHON
=
os
.
getenv
(
'MICROPY_MICROPYTHON'
,
'../windows/micropython.exe'
)
else
:
CPYTHON3
=
os
.
getenv
(
'MICROPY_CPYTHON3'
,
'python3'
)
MICROPYTHON
=
os
.
getenv
(
'MICROPY_MICROPYTHON'
,
'../unix/micropython'
)
TESTPATH
=
'../tests/cpydiff/'
UPYPATH
=
'../unix/micropython'
DOCPATH
=
'../docs/genrst/'
INDEXTEMPLATE
=
'../docs/differences/index_template.txt'
INDEX
=
'index.rst'
...
...
@@ -84,10 +94,10 @@ def run_tests(tests):
input_cpy
=
f
.
read
()
input_upy
=
uimports
(
input_cpy
)
process
=
subprocess
.
Popen
(
'python'
,
shell
=
True
,
stdout
=
subprocess
.
PIPE
,
stdin
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
PIPE
)
process
=
subprocess
.
Popen
(
CPYTHON3
,
shell
=
True
,
stdout
=
subprocess
.
PIPE
,
stdin
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
PIPE
)
output_cpy
=
[
com
.
decode
(
'utf8'
)
for
com
in
process
.
communicate
(
input_cpy
)]
process
=
subprocess
.
Popen
(
UPYPATH
,
shell
=
True
,
stdout
=
subprocess
.
PIPE
,
stdin
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
PIPE
)
process
=
subprocess
.
Popen
(
MICROPYTHON
,
shell
=
True
,
stdout
=
subprocess
.
PIPE
,
stdin
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
PIPE
)
output_upy
=
[
com
.
decode
(
'utf8'
)
for
com
in
process
.
communicate
(
input_upy
)]
if
output_cpy
[
0
]
==
output_upy
[
0
]
and
output_cpy
[
1
]
==
output_upy
[
1
]:
...
...
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