blob: 192987ec27a8e150d1c7283f86f46ab77dd71f83 [file] [log] [blame]
// Copyright (c) 2020, 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.
import 'dart:async';
import 'dart:io';
import 'command.dart';
import 'fuchsia_cfv1.dart';
import 'fuchsia_cfv2.dart';
// Sets up and executes commands against a Fuchsia environment.
abstract class FuchsiaEmulator {
// Publishes the packages to the Fuchsia environment.
Future<void> publishPackage(String buildDir, String mode, String arch);
// Tears down the Fuchsia environment.
void stop();
// Returns a command to execute a set of tests against the running Fuchsia
// environment.
VMCommand getTestCommand(String mode, String arch, List<String> arguments);
static final FuchsiaEmulator _instance = _create();
static FuchsiaEmulator _create() {
if (Platform.environment.containsKey('FUCHSIA_CFV2')) {
return FuchsiaEmulatorCFv2();
}
return FuchsiaEmulatorCFv1();
}
static FuchsiaEmulator instance() {
return _instance;
}
}