Revert "Travis running tests" (#291)

This commit is contained in:
sheinz 2016-11-21 11:39:13 +02:00 committed by GitHub
parent 6481f71ce0
commit 438a7582bf
8 changed files with 7 additions and 270 deletions

View file

@ -39,12 +39,6 @@ If not specified device `/dev/ttyUSB1` is used.
`--no-flash` or `-n` - Do not flash the test firmware before running tests.
`--flash` or `-f` - Flash device directly with esptool instead of using
`make flash` command. Can be used to flash binaries without esp-open-rtos
environment.
`--flash-cmd` or `-c` - Flash command for esptool. Used together with `--flash`.
`--list` or `-l` - Display list of the available test cases on the device.
### Example

View file

@ -44,9 +44,9 @@ def main():
verbose = args.verbose
if not args.no_flash:
flash(args.aport, args)
flash_image(args.aport)
if args.type != 'solo':
flash(args.bport, args)
flash_image(args.bport)
env = TestEnvironment(args.aport, TestEnvironment.A)
env_b = None
@ -279,34 +279,11 @@ def get_testdir():
Return the 'tests' directory in the source tree
(assuming the test_runner.py script is in that directory.
"""
res = os.path.dirname(__file__)
res = os.path.dirname(__name__)
return "." if res == "" else res
def flash(serial_port, args):
if args.flash:
esptool_flash(serial_port, args.flash_cmd)
else:
make_flash(serial_port)
def esptool_flash(serial_port, params):
env = dict(os.environ)
verbose_print("Flashing test image to %s..." % serial_port)
try:
stdout = sys.stdout if verbose else None
cmd = ["esptool.py", "-p", serial_port]
cmd.extend(params.split(' '))
cmd = [x for x in cmd if x] # remove empty elements
subprocess.check_call(cmd, cwd=get_testdir(), stdout=stdout,
stderr=subprocess.STDOUT, env=env)
except subprocess.CalledProcessError as e:
raise TestRunnerError("'esptool.py flash serial=%s' failed with exit code %d" %
(serial_port, e.returncode))
verbose_print("Flashing successful.")
def make_flash(serial_port):
def flash_image(serial_port):
# Bit hacky: rather than calling esptool directly,
# just use the Makefile flash target with the correct ESPPORT argument
env = dict(os.environ)
@ -352,17 +329,6 @@ def parse_args():
action='store_true',
default=False)
parser.add_argument(
'--flash', '-f',
help='Flash device directly with esptool',
action='store_true',
default=False)
parser.add_argument(
'--flash-cmd', '-c',
help='Flash command for esptool',
default='write_flash 0x2000 ./firmware/tests.bin')
parser.add_argument(
'--verbose', '-v',
help='Verbose test runner debugging output',