b6799fed19
Revisions updated by `dart tools/rev_sdk_deps.dart`. crypto (https://github.com/dart-lang/crypto/compare/c954015..f059196): f059196 2024-02-08 Kevin Moore Test dart2wasm (dart-lang/crypto#162) dartdoc (https://github.com/dart-lang/dartdoc/compare/457c34e..f152c01): f152c013 2024-02-08 Sam Rawlins Tidy spacing in templates (dart-lang/dartdoc#3652) d0c53b9f 2024-02-07 Sam Rawlins Change all late final Iterable fields to Lists (dart-lang/dartdoc#3649) 8c9c7790 2024-02-06 Sam Rawlins Remove unnecessary ExtensionTarget mixin (dart-lang/dartdoc#3648) d2f90c5a 2024-02-06 Sam Rawlins Fix the 'serve testing-package' task to generate docs (dart-lang/dartdoc#3647) ecosystem (https://github.com/dart-lang/ecosystem/compare/7d8ec47..3e4f286): 3e4f286 2024-02-08 Moritz Add ignore flag for `publish.yaml` (dart-lang/ecosystem#237) lints (https://github.com/dart-lang/lints/compare/90a61e4..ead7708): ead7708 2024-02-08 Devon Carew add library_annotations; remove package_prefixed_library_names (dart-lang/lints#179) native (https://github.com/dart-lang/native/compare/876f9a1..cb9bd7e): cb9bd7ef 2024-02-09 Daco Harkes Build hook spec (dart-lang/native#955) sse (https://github.com/dart-lang/sse/compare/e483b14..af7d8d0): af7d8d0 2024-02-09 Ilya Yanok Make `SseConnection` extend `StreamChannelMixin<String>` (dart-lang/sse#102) Change-Id: I2e85dbfae00eea8de7b6f7efce1993bf00e243f0 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352046 Reviewed-by: Konstantin Shcheglov <scheglov@google.com> Commit-Queue: Devon Carew <devoncarew@google.com> Auto-Submit: Devon Carew <devoncarew@google.com>
54 lines
1.5 KiB
Dart
54 lines
1.5 KiB
Dart
// Copyright (c) 2022, 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.
|
|
|
|
@TestOn('linux')
|
|
library;
|
|
|
|
import 'package:dartdev/src/processes.dart';
|
|
import 'package:test/test.dart';
|
|
|
|
import '../utils.dart';
|
|
|
|
void main() {
|
|
group('process listing', () {
|
|
test('linux', () {
|
|
var results = ProcessInfo.getProcessInfo();
|
|
|
|
expect(results, isNotNull);
|
|
expect(results, isNotEmpty);
|
|
|
|
for (var process in results!) {
|
|
expect(process.memoryMb, greaterThan(0));
|
|
expect(process.cpuPercent, greaterThanOrEqualTo(0.0));
|
|
expect(process.elapsedTime, isNotEmpty);
|
|
if (!(process.commandLine.startsWith('dart') ||
|
|
process.commandLine.contains('snapshot'))) {
|
|
print("Expected ${process.commandLine} to start with 'dart' or"
|
|
" contain 'snapshot'.");
|
|
expect(true, false);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
group('info linux', () {
|
|
late TestProject p;
|
|
|
|
test('shows process info', () async {
|
|
p = project(mainSrc: 'void main() {}');
|
|
final runResult = await p.run(['info']);
|
|
|
|
expect(runResult.stderr, isEmpty);
|
|
expect(runResult.exitCode, 0);
|
|
|
|
var output = runResult.stdout as String;
|
|
|
|
expect(output, contains('providing this information'));
|
|
expect(output, contains('## Process info'));
|
|
expect(output, contains('Memory |'));
|
|
expect(output, contains('| dart '));
|
|
});
|
|
}, timeout: longTimeout);
|
|
}
|