11sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__),
'test_scripts/test/')))
13from common
import catch_sigterm, wait_for_sigterm
18 Executes the test-scripts with required environment variables. It acts like
19 /usr/bin/env, but provides some extra functionality to dynamically set up
20 the environment variables.
25 os.environ[
'SRC_ROOT'] = os.path.abspath(os.path.join(os.path.dirname(__file__),
'../../../'))
28 os.environ[
'FUCHSIA_IMAGES_ROOT'] = os.path.join(os.environ[
'SRC_ROOT'],
'fuchsia/images/')
30 assert platform.system() ==
'Linux',
'Unsupported OS ' + platform.system()
31 os.environ[
'FUCHSIA_SDK_ROOT'] = os.path.join(os.environ[
'SRC_ROOT'],
'fuchsia/sdk/linux/')
32 os.environ[
'FUCHSIA_GN_SDK_ROOT'] = os.path.join(
33 os.environ[
'SRC_ROOT'],
'flutter/tools/fuchsia/gn-sdk/src'
36 if os.getenv(
'DOWNLOAD_FUCHSIA_SDK') ==
'True':
37 sdk_path = os.environ[
'FUCHSIA_SDK_PATH']
38 assert sdk_path.endswith(
'/linux-amd64/core.tar.gz')
39 assert not sdk_path.startswith(
'/')
40 os.environ[
'FUCHSIA_SDK_OVERRIDE'
41 ] =
'gs://fuchsia-artifacts/' + sdk_path[:-
len(
'/linux-amd64/core.tar.gz')]
43 with subprocess.Popen(sys.argv[1:])
as proc:
49 return proc.returncode
52if __name__ ==
'__main__':