test_runner.dart 849 Bytes
Newer Older
1 2 3 4
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

5
import 'dart:async';
6 7 8
import 'dart:io';

import 'package:args/command_runner.dart';
9 10

import 'package:flutter_devicelab/command/test.dart';
11
import 'package:flutter_devicelab/command/upload_results.dart';
12 13

final CommandRunner<void> runner =
14
    CommandRunner<void>('devicelab_runner', 'DeviceLab test runner for recording test results')
15
      ..addCommand(TestCommand())
16
      ..addCommand(UploadResultsCommand());
17 18

Future<void> main(List<String> rawArgs) async {
19
  unawaited(runner.run(rawArgs).catchError((dynamic error) {
20 21 22 23
    stderr.writeln('$error\n');
    stderr.writeln('Usage:\n');
    stderr.writeln(runner.usage);
    exit(64); // Exit code 64 indicates a usage error.
24
  }));
25
}