1*890232f2SAndroid Build Coastguard Worker#!/bin/sh 2*890232f2SAndroid Build Coastguard Worker# 3*890232f2SAndroid Build Coastguard Worker# Copyright 2016 Google Inc. All rights reserved. 4*890232f2SAndroid Build Coastguard Worker# 5*890232f2SAndroid Build Coastguard Worker# Licensed under the Apache License, Version 2.0 (the "License"); 6*890232f2SAndroid Build Coastguard Worker# you may not use this file except in compliance with the License. 7*890232f2SAndroid Build Coastguard Worker# You may obtain a copy of the License at 8*890232f2SAndroid Build Coastguard Worker# 9*890232f2SAndroid Build Coastguard Worker# http://www.apache.org/licenses/LICENSE-2.0 10*890232f2SAndroid Build Coastguard Worker# 11*890232f2SAndroid Build Coastguard Worker# Unless required by applicable law or agreed to in writing, software 12*890232f2SAndroid Build Coastguard Worker# distributed under the License is distributed on an "AS IS" BASIS, 13*890232f2SAndroid Build Coastguard Worker# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14*890232f2SAndroid Build Coastguard Worker# See the License for the specific language governing permissions and 15*890232f2SAndroid Build Coastguard Worker# limitations under the License. 16*890232f2SAndroid Build Coastguard Worker 17*890232f2SAndroid Build Coastguard Workerpushd "$(dirname $0)" >/dev/null 18*890232f2SAndroid Build Coastguard Worker 19*890232f2SAndroid Build Coastguard Workercommand -v dart >/dev/null 2>&1 || { echo >&2 "Dart tests require dart to be in path but it's not installed. Aborting."; exit 1; } 20*890232f2SAndroid Build Coastguard Worker# output required files to the dart folder so that pub will be able to 21*890232f2SAndroid Build Coastguard Worker# distribute them and more people can more easily run the dart tests 22*890232f2SAndroid Build Coastguard Worker../flatc --dart --gen-object-api -I include_test -o ../dart/test monster_test.fbs 23*890232f2SAndroid Build Coastguard Workercp monsterdata_test.mon ../dart/test 24*890232f2SAndroid Build Coastguard Workercp monster_test.fbs ../dart/test 25*890232f2SAndroid Build Coastguard Worker 26*890232f2SAndroid Build Coastguard Workercd ../dart 27*890232f2SAndroid Build Coastguard Worker 28*890232f2SAndroid Build Coastguard Worker../flatc --dart --gen-object-api -o ./test ./test/list_of_enums.fbs 29*890232f2SAndroid Build Coastguard Worker../flatc --dart --gen-object-api -o ./test ./test/bool_structs.fbs 30*890232f2SAndroid Build Coastguard Worker 31*890232f2SAndroid Build Coastguard Worker# update packages 32*890232f2SAndroid Build Coastguard Workerdart pub get 33*890232f2SAndroid Build Coastguard Worker# Execute the sample. 34*890232f2SAndroid Build Coastguard Workerdart test 35