Open asashour opened 2 years ago
https://dart-review.googlesource.com/c/sdk/+/241002
The reason is because the difference in Platform.script
.
IntelliJ executes dart run test test\a.dart
, which would build package executable, in which Platform.script
points to something like:
file:///C:/Users/<username>/AppData/Local/Temp/dart_test.b2af0f8/test.dart_1.dill
But Visual Source Code executes dart run test\a.dart
, in which Platform.script
would be the path in SDK checkout sources.
The mentioned CL fixes the issue.
I'm not sure how you're running the tests from IntelliJ, but when I run them IntelliJ runs
<pathToSdk>/bin/dart --enable-asserts <pathToSdkCheckout>/pkg/analysis_server/test/src/services/correction/fix/remove_annotation_test.dart
I use the Run
command on either the editor tab or the Project view's context menu. I never use the test runner.
Interesting.
Using root folder as pkg/analysis_server
or (sdk
with enabled Dart).
I run it without special configuration from
or from the menu
It seems it is detected as tests
I might have had to create a run configuration manually, or it might not have been detected as tests at the time. It's been years, so I don't remember exactly how I got into the current state.
I guess someone else can also verify the behavior.
For me, the current way is to use the proposed https://dart-review.googlesource.com/c/sdk/+/241002
Most of
analysis_server
tests for example are runnable/debuggable, but once the test references package import, there is an error.The test successfully runs from the command line
dart run ......\remove_annotation_test.dart
(withouttest
afterrun
), or from Visual Studio Code.So, I am not sure if this is an IntelliJ issue, a configuration issue to use
dart run file.dart
somehow from the IDE, or something else.Example test:
https://github.com/dart-lang/sdk/blob/3d27f5cb79245720363d1b1c44d467b99e8f1d49/pkg/analysis_server/test/src/services/correction/fix/remove_annotation_test.dart#L28-L31
I think I followed the instructions of how to build, and am able to build the SDK.
IntelliJ IDEA 2021.3.3 (Community Edition)
with updated dependencies, and with Dart SDKedge
.