Files
sdk/pkg/expect/lib/config.dart
T
Martin Kustermann ddc236ba64 [vm] Add @pragma('vm:keep-name') annotation
This allows us to keep symbol names for classes/methods/fields - even if
obfuscation is enabled, but has no other effect on tree shaker / ...

For go/dart-ama

TEST=vm/dart/keep_name_pragma_test

Change-Id: I66c0fc32217d9180f821658bae463f2c1d7fb1af
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/309740
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
Auto-Submit: Martin Kustermann <kustermann@google.com>
2023-06-16 10:22:23 +00:00

38 lines
1.4 KiB
Dart

// Copyright (c) 2012, 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.
/// Access to the runner configuration this test is running in.
///
/// Provides queries against and properties of the current configuration
/// that a test is being compiled and executed in.
///
/// This library is separate from `expect.dart` because it uses
/// `fromEnvironment` constants that cannot be precompiled,
/// and we precompile `expect.dart`.
library expect_config;
import 'package:smith/smith.dart';
final Configuration _configuration = Configuration.parse(
const String.fromEnvironment("test_runner.configuration"),
<String, dynamic>{});
String configAsString = _configuration.toString();
bool get isDart2jsConfiguration => _configuration.compiler == Compiler.dart2js;
bool get isDart2WasmConfiguration =>
_configuration.compiler == Compiler.dart2wasm;
bool get isDdcConfiguration => _configuration.compiler == Compiler.ddc;
bool get isVmJitConfiguration => _configuration.compiler == Compiler.dartk;
bool get isVmAotConfiguration => _configuration.compiler == Compiler.dartkp;
bool get isVmConfiguration => isVmJitConfiguration || isVmAotConfiguration;
bool get isWebConfiguration =>
isDart2jsConfiguration || isDart2WasmConfiguration || isDdcConfiguration;