mirror of
https://github.com/esp8266/Arduino.git
synced 2025-06-13 13:01:55 +03:00
Fix Python3 errors for device tests (#6670)
* Fix Python3 errors for device tests The Python3 migration didn't include fixes for local scripts in the device test tree. Fatal build and run Python errors fixed. The last update to xunitmerge is ~5 years ago, so it looks to be unsupported now. Use a local copy of the two components to allow patching to work with Python3. The serial test seems to send garbage chars (non-ASCII/etc.), so use a codepage 437 which supports all 255 chars. Fixes: #6660 * Run tests at 160MHz (req'd for some SSL connections) * Fix debuglevel options for builder * Fix Python3 interpreter path in xunitmerge * Remove virtualenv on "make clean" * Add appropriate attribution, license to xunitmerge Add like to the original sources with the author's license to the copied/fixed xunitmerge files.
This commit is contained in:
committed by
GitHub
parent
1e17dddd89
commit
41ba21613d
@ -1,3 +1,5 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
from mock_decorators import setup, teardown
|
||||
from flask import Flask, request
|
||||
from threading import Thread
|
||||
@ -21,7 +23,7 @@ def setup_tcpsrv(e):
|
||||
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||
for port in range(8266, 8285 + 1):
|
||||
try:
|
||||
print >>sys.stderr, 'trying port', port
|
||||
print ('trying port %d' %port, file=sys.stderr)
|
||||
server_address = ("0.0.0.0", port)
|
||||
sock.bind(server_address)
|
||||
sock.listen(1)
|
||||
@ -31,17 +33,17 @@ def setup_tcpsrv(e):
|
||||
print >>sys.stderr, 'busy'
|
||||
if not running:
|
||||
return
|
||||
print >>sys.stderr, 'starting up on %s port %s' % server_address
|
||||
print >>sys.stderr, 'waiting for connections'
|
||||
print ('starting up on %s port %s' % server_address, file=sys.stderr)
|
||||
print ( 'waiting for connections', file=sys.stderr)
|
||||
while running:
|
||||
print >>sys.stderr, 'loop'
|
||||
print ('loop', file=sys.stderr)
|
||||
readable, writable, errored = select.select([sock], [], [], 1.0)
|
||||
if readable:
|
||||
connection, client_address = sock.accept()
|
||||
try:
|
||||
print >>sys.stderr, 'client connected:', client_address
|
||||
print('client connected: %s' % str(client_address), file=sys.stderr)
|
||||
finally:
|
||||
print >>sys.stderr, 'close'
|
||||
print ('close', file=sys.stderr)
|
||||
connection.shutdown(socket.SHUT_RDWR)
|
||||
connection.close()
|
||||
|
||||
@ -54,7 +56,7 @@ def teardown_tcpsrv(e):
|
||||
global thread
|
||||
global running
|
||||
|
||||
print >>sys.stderr, 'closing'
|
||||
print ('closing', file=sys.stderr)
|
||||
running = False
|
||||
thread.join()
|
||||
return 0
|
||||
|
Reference in New Issue
Block a user