Skip to content

Running SDK tests through VS Code fails with Top-level main() function takes arguments #60437

@sigurdm

Description

@sigurdm

The test issue noted above seems to be specific to using stdout.write in tests (see dart-lang/test#1749), other tests seem to work.

However, I found some other issues trying to run SDK tests through VS Code, such as:

Failed to load "D:/Dev/Google/dart-sdk/sdk/pkg/vm_service/test\add_breakpoint_rpc_kernel_test.dart": Top-level main() function takes arguments.
package:test_core/src/runner/plugin/platform_helpers.dart 93:23  deserializeSuite.<fn>
dart:async/zone.dart 1538:47                                     _rootRunUnary
dart:async/zone.dart 1429:19                                     _CustomZone.runUnary
dart:async/zone.dart 1329:7                                      _CustomZone.runUnaryGuarded

Which happens because the main function is declared as:

void main([args = const <String>[]]) => runIsolateTests(

@jakemac53 I'm not sure why it has the parameter defined like this, but should this be supported by dart test?

Originally posted by @DanTup in #56220

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-pkgUsed for miscellaneous pkg/ packages not associated with specific area- teams.type-test

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions