skia2/bin/sysopen
Hal Canary ba1602896d SkQP: new docker test code
`tools/skqp/docker_run_apk.sh` executes SkQP tests in an emulator

`tools/skqp/run_apk.sh` is used by `docker_run_apk.sh` and
`tools/skqp/test_apk.sh` to factor out common code.

Also: `bin/sysopen` now pipes output to `/dev/null` and doesn't block.

TODO: harmonize with test code executed by bots in `infra/skqp/`.

No-Try: true
Change-Id: Ia212a84565ff52279a845e20372a0ad7cc0726a4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/209401
Reviewed-by: Hal Canary <halcanary@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2019-04-19 18:50:03 +00:00

26 lines
549 B
Python
Executable File

#! /usr/bin/env python2
# Copyright 2017 Google Inc.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import subprocess
import sys
def spawn(cmd):
with open(os.devnull, 'w') as o:
subprocess.Popen(cmd, stdout=o, stderr=o)
def sysopen(arg):
plat = sys.platform
if plat.startswith('darwin'):
spawn(["open", arg])
elif plat.startswith('win'):
os.startfile(arg)
else:
spawn(["xdg-open", arg])
if __name__ == '__main__':
for a in sys.argv[1:]:
sysopen(a)