Files
sdk/pkg/dartdev/test/sdk_test.dart
T
asiva df266b8a44 [Reland] [dartdev] Use an AOT snapshot for dds
This change enables use of an AOT snapshot for dds execution.

TEST=ci

Change-Id: I1eba2913a4160dee5de663622aa9106dd1d83c04
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/327710
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2023-09-26 18:27:02 +00:00

55 lines
1.2 KiB
Dart

// 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:io';
import 'package:dartdev/src/sdk.dart';
import 'package:test/test.dart';
void main() {
group('Sdk', _sdk);
group('Runtime', _runtime);
}
void _sdk() {
test('sdkPath', () {
expectDirectoryExists(Sdk().sdkPath);
});
test('dart binary', () {
expectFileExists(Sdk().dart);
});
test('analysis_server snapshot', () {
expectFileExists(Sdk().analysisServerSnapshot);
});
test('dds snapshot', () {
expectSnapshotExists(Sdk().ddsAotSnapshot, Sdk().ddsSnapshot);
});
test('dart2js snapshot', () {
expectFileExists(Sdk().dart2jsSnapshot);
});
}
void _runtime() {
test('channel', () {
final runtime = Runtime.runtime;
expect(runtime.channel, isNotEmpty);
});
}
void expectFileExists(String path) {
expect(File(path).existsSync(), isTrue);
}
void expectSnapshotExists(String aotpath, String jitpath) {
expect(File(aotpath).existsSync() || File(jitpath).existsSync(), isTrue);
}
void expectDirectoryExists(String path) {
expect(Directory(path).existsSync(), isTrue);
}