#!/usr/bin/env bash # Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file # for details. All rights reserved. Use of this source code is governed by a # BSD-style license that can be found in the LICENSE file. # This script is meant to be run inside the src directory of a Dartium # (or Chromium) checkout, with android_tools installed in third_party. # It expects ContentShell to have been built for ARM android, using the # ninja build system. # It expects one or more android devices to be connected by USB to the machine. set -v set -x cd src ninja -C out/Release forwarder2 export PATH=$PATH:third_party/android_tools/sdk/platform-tools/\ :third_party/android_tools/sdk/tools/ ./build/android/adb_reverse_forwarder.py --all-devices \ 8081 8081 8082 8082 8083 8083 8084 8084 & global FORWARDER_PID := $BgPid sleep 15 ./dart/tools/test.py -m release -a arm --progress=line --report --time \ --failure-summary --write-debug-log --local_ip=localhost \ --test_server_port=8083 --test_server_cross_origin_port=8084 \ --test_driver_port=8081 --test_driver_error_port=8082 \ -r ContentShellOnAndroid --drt=$1 global EXIT_CODE := $Status kill -9 $FORWARDER_PID exit $EXIT_CODE (CommandList children: [ (C {(set)} {(-v)}) (C {(set)} {(-x)}) (C {(cd)} {(src)}) (C {(ninja)} {(-C)} {(out/Release)} {(forwarder2)}) (C {(export)} {(Lit_VarLike "PATH=") ($ VSub_Name "$PATH") (Lit_Other ":") (third_party/android_tools/sdk/platform-tools/) (Lit_Other ":") (third_party/android_tools/sdk/tools/) } ) (Sentence child: (C {(./build/android/adb_reverse_forwarder.py)} {(--all-devices)} {(8081)} {(8081)} {(8082)} {(8082)} {(8083)} {(8083)} {(8084)} {(8084)} ) terminator: ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:FORWARDER_PID) op: Equal rhs: {($ VSub_Bang "$!")} spids: [83] ) ] spids: [83] ) (C {(sleep)} {(15)}) (C {(./dart/tools/test.py)} {(-m)} {(release)} {(-a)} {(arm)} {(--progress) (Lit_Other "=") (line)} {(--report)} {(--time)} {(--failure-summary)} {(--write-debug-log)} {(--local_ip) (Lit_Other "=") (localhost)} {(--test_server_port) (Lit_Other "=") (8083)} {(--test_server_cross_origin_port) (Lit_Other "=") (8084)} {(--test_driver_port) (Lit_Other "=") (8081)} {(--test_driver_error_port) (Lit_Other "=") (8082)} {(-r)} {(ContentShellOnAndroid)} {(--drt) (Lit_Other "=") ($ VSub_Number "$1")} ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:EXIT_CODE) op: Equal rhs: {($ VSub_QMark "$?")} spids: [148] ) ] spids: [148] ) (C {(kill)} {(-9)} {($ VSub_Name "$FORWARDER_PID")}) (C {(exit)} {($ VSub_Name "$EXIT_CODE")}) ] )