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