Commit Graph

571 Commits

Author SHA1 Message Date
Ryan Macnak b374d4265b Revert "[test_runner] Use relative paths in commands."
This reverts commit 1b4a56692b.

Reason for revert: breaks Fuchsia builders

Original change's description:
> [test_runner] Use relative paths in commands.
>
> This makes it easier to copy commands between checkouts or between the bot and local development.
>
> Change-Id: I74bc9dcb83855e295fe40fa4ef81871ccc537d29
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/400180
> Reviewed-by: Alexander Aprelev <aam@google.com>
> Commit-Queue: Ryan Macnak <rmacnak@google.com>

No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Change-Id: I8c7cca1e9c82a5b6e237d0b7611647a6168e6397
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/437123
Reviewed-by: Siva Annamalai <asiva@google.com>
Auto-Submit: Ryan Macnak <rmacnak@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2025-06-25 18:08:07 -07:00
Ryan Macnak 1b4a56692b [test_runner] Use relative paths in commands.
This makes it easier to copy commands between checkouts or between the bot and local development.

Change-Id: I74bc9dcb83855e295fe40fa4ef81871ccc537d29
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/400180
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2025-06-25 15:13:50 -07:00
Alexander Markov 43830ab2ea Test interpreter directly on the VM, without dynamic_module_runner
Also, run pkg/vm_service/ tests against interpreter.

TEST=ci

Change-Id: Ib9c7fc1ed33c5721288e3ba1a3d4999c3e234350
Cq-Include-Trybots: luci.dart.try:vm-aot-dyn-linux-debug-x64-try,vm-aot-dyn-linux-product-x64-try,vm-dyn-linux-debug-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/436500
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2025-06-24 06:00:45 -07:00
Liam Appelbe f95a84da5c [test_runner] Improve timeout deflaking
The usual deflaking logic is to simply rerun the test 5 times, but if the failure was a timeout this can be very expensive. Instead, only rerun timeout failures twice, and use the last successful run time to set a tighter timeout.

Repeat counts and timeouts are now per-test. The name, repeat count, and timeout make a `DeflakeInfo`. This object is constructed in compare_results.dart, and passed to test.py's `--tests` flag. The recipe was already passing the output of compare_results directly to that flag, so no change is needed to the recipies.

Backwards compatibility:

If you want the old behavior of compare_results.dart, use the `--name-only` flag.

test.py only uses this new logic if it detects that the `--tests` flag is JSON (if it starts with a `{`).

Change-Id: I4113b68c54bfb7fd9a5e8fc9dab7a265807f3e77
Bug: https://github.com/dart-lang/sdk/issues/55044
Fixes: https://github.com/dart-lang/sdk/issues/55044
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/435760
Commit-Queue: Liam Appelbe <liama@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2025-06-22 21:19:35 -07:00
asiva 111f9798d2 Add QEMU_LD_PREFIX environment variables so tests that spawn new processes also get the library path setup correctly.
Change-Id: I1232925b037f897ff1fa38503cbe4e32d07cb388
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/435661
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2025-06-18 16:54:25 -07:00
Ryan Macnak ab4f9351b1 Rename vm_platform_strong.dill to vm_platform.dill.
The name has always been annoying because it did not add strong typing. And now there aren't variants of the VM platform to distinguish.

Leave a copy at the old name to not immediately break illegal uses.

TEST=ci
Cq-Include-Trybots: luci.dart.try:flutter-analyze-try,flutter-frontend-try,flutter-linux-try
Change-Id: Ie76fa7f16940aa1ba8d582eb5197f0ae55dc8938
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/429828
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2025-06-16 18:33:38 -07:00
Alexander Markov f9860f9db9 [dyn_modules] Add source positions to bytecode
dart2bytecode can optionally add source position information
(including line starts) to the generated bytecode
(when '--bytecode-options=source-positions' flag is specified).

If bytecode has source positions, they are now shown in stack traces
involving interpreter frames.

TEST=ci

Change-Id: I1ae3326bac21201040be32c712514e71e96f51e2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/433760
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2025-06-10 12:15:25 -07:00
Tess Strickland f8e21c5c94 [pkg/test_runner] Only use .dll for assembled snapshots on Windows.
Use "out.aotsnapshot" as the name for all non-assembled snapshots and
names with the appropriate shared object extension for the host OS for
assembled snapshots.

This ensures the test checks for .dll extensions added in
https://dart-review.googlesource.com/c/sdk/+/428200 only trigger
for assembled snapshots as expected, and not for other formats
(e.g., Windows trybots using sanitizers, which still use direct
to ELF snapshots).

Also fixes incorrect line numbers in dwarf_stack_trace_test.dart.

TEST=vm/dart/build_id_test
     standalone/dwarf_stack_trace_test

Cq-Include-Trybots: luci.dart.try:vm-asan-win-release-x64-try,vm-linux-release-x64-try,vm-mac-release-arm64-try
Bug: https://github.com/dart-lang/sdk/issues/60846
Change-Id: Ife06613d86874d76adeb99dcbc50fc3723aae584
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/432660
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2025-06-03 06:23:04 -07:00
Ryan Macnak 03301c9bfb [vm] Support assembly output for Windows.
The resulting DLL lacks debugging information / PDB.

TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/60812
Bug: https://github.com/dart-lang/sdk/issues/60813
Cq-Include-Trybots: luci.dart.try:vm-aot-win-debug-arm64-try,vm-aot-win-debug-x64-try,vm-aot-win-release-arm64-try,vm-aot-win-release-x64-try
Change-Id: I305bad0081ec24f27249ad9b75ff8d32fa9c4893
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/428200
Reviewed-by: Tess Strickland <sstrickl@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2025-06-02 12:12:04 -07:00
Ryan Macnak 56636971dc [test_runner] Remove nnbd mode options.
In particular, this means the VM tests stop getting invoked with the now-invalid --sound-null-safety flag.

Change-Id: Ia8f5a59e0bf1fd7094508fdc4bb146ebf3034148
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/431360
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Kallen Tu <kallentu@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2025-06-02 10:59:31 -07:00
Ömer Ağacan 804c6bbd84 [test_runner] Remove duplicate "allowed values" help, use package:args's allowed value help feature
`tools/test.py --help` output before: (only relevant parts)

```
-c, --compiler                    How the Dart code should be compiled or statically processed.
                                  dart2js:              Compile to JavaScript using dart2js.
                                  dart2analyzer:        Perform static analysis on Dart code using the analyzer.
                                  compare_analyzer_cfe: Compare analyzer and common front end representations.
                                  ddc:                  Compile to JavaScript using dartdevc.
                                  app_jitk:             Compile the Dart code into Kernel and then into an app
                                                        snapshot.
                                  dartk:                Compile the Dart code into Kernel before running test.
                                  dartkp:               Compile the Dart code into Kernel and then Kernel into
                                                        AOT snapshot before running the test.
                                  spec_parser:          Parse Dart code using the specification parser.
                                  fasta:                Compile using CFE for errors, but do not run.
                                  [dart2js, dart2analyzer, dart2wasm, ddc, app_jitk, dartk, dartkp, spec_parser, fasta, dart2bytecode]
-r, --runtime                     Where the tests should be run.
                                  vm:               Run Dart code on the standalone Dart VM.
                                  dart_precompiled: Run a precompiled snapshot on the VM without a JIT.
                                  d8:               Run JavaScript from the command line using Chrome's v8.
                                  jsc:              Run JavaScript from the command line using Safari/WebKit's jsc.
                                  jsshell:          Run JavaScript from the command line using Firefox's js-shell.

                                  firefox:
                                  chrome:
                                  safari:
                                  chromeOnAndroid:  Run JavaScript in the specified browser.

                                  none:             No runtime, compile only.
                                  [vm, flutter, dart_precompiled, d8, jsc, jsshell, firefox, chrome, safari, edge, chromeOnAndroid, none]
...
-p, --progress                    Progress indication mode.

                                  Allowed values are:
                                  compact, color, line, verbose, silent, status
                                  [compact (default), color, line, verbose, silent, status]
...
    --nnbd                        Which set of non-nullable type features to use.

                                  Allowed values are: legacy, weak, strong
                                  [legacy, weak, strong (default)]
```

After:

```
-c, --compiler                      How the Dart code should be compiled or statically processed.

          [dart2js]                 Compile to JavaScript using dart2js.
          [dart2analyzer]           Perform static analysis on Dart code using the analyzer.
          [compare_analyzer_cfe]    Compare analyzer and common front end representations.
          [ddc]                     Compile to JavaScript using dartdevc.
          [app_jitk]                Compile the Dart code into Kernel and then into an app snapshot.
          [dartk]                   Compile the Dart code into Kernel before running test.
          [dartkp]                  Compile the Dart code into Kernel and then Kernel into AOT snapshot before running the test.
          [spec_parser]             Parse Dart code using the specification parser.
          [fasta]                   Compile using CFE for errors, but do not run.

-r, --runtime                       Where the tests should be run.

          [vm]                      Run Dart code on the standalone Dart VM.
          [dart_precompiled]        Run a precompiled snapshot on the VM without a JIT.
          [d8]                      Run JavaScript from the command line using Chrome's v8.
          [jsc]                     Run JavaScript from the command line using Safari/WebKit's jsc.
          [jsshell]                 Run JavaScript from the command line using Firefox's js-shell.
          [firefox]                 Run JavaScript in Firefox.
          [chrome]                  Run JavaScript in Chrome.
          [safari]                  Run JavaScript in Safari.
          [chromeOnAndroid]         Run JavaScript in Chrome on Android.
          [none]                    No runtime, compile only.
...
-p, --progress                      Progress indication mode.
                                    [compact (default), color, line, verbose, silent, status]
    --nnbd                          Which set of non-nullable type features to use.
                                    [legacy, weak, strong (default)]
```

Changes:

- Duplicate "allowed values are ..." phrases removed.
- With `package:args`'s `allowedHelp` messages, allowed values documentations are now consistent with the rest of the ecosystem.

Change-Id: I25d5e310e7dd38e0e94622815d9773ec84ab8fb3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/431860
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
2025-05-30 02:09:42 -07:00
Ömer Ağacan b980788bf9 [test_runner] Use 'line' progress indicator by default when stdout is not a terminal
When the test runner output is piped to a file, 'compact' progress
indicator prints carriage returns to the file.

To avoid adding carriage returns to text files, only use 'compact'
indicator when stdout is a terminal. Otherwise use 'line' indicator.

Change-Id: Ic8ca111059799876caf401d3b040a5d3b5a7c731
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/431861
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
2025-05-29 12:13:42 -07:00
Tess Strickland af5221f442 [test_runner] Convert boolean use-elf to an enum gen-snapshot-format.
Currently, the configuration code only has a boolean option, 'use-elf'
for specifying the output format for gen_snapshot. If false, then the
output format is assumed to be assembly.

Add a new GenSnapshotFormat enum and replace the old 'use-elf' option
with a new 'gen-snapshot-format' option. The new enum has two getters:

* snapshotType returns the appropriate string to pass to gen_snapshot
  via the '--snapshot-type' option.
* fileOption returns the name of the option used to specify the
  output path for the given format.

In addition, make it so the Configuration only has a non-null
genSnapshotFormat field if the compiler is Compiler.dartkp to avoid
spurious differences in Configurations that are created with different
GenSnapshotFormat values when the configurations in question don't
actually call gen_snapshot.

TEST=pkg/smith/test/configuration_test.dart (and the CI in general)

Change-Id: I7f17dc8d3a1bb6d4bf57750bc5ef4a16b8a78c11
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/429980
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2025-05-26 08:53:03 -07:00
Ben Konyi a067d75f8f [ Observatory ] Remove legacy Observatory VM service tests
Clean up test_runner and the test matrix to remove all references to
the service test suite and delete the tests.

Work towards https://github.com/dart-lang/sdk/issues/50233

TEST=N/A

Change-Id: Ie3adb0d007d71f9a223843d739e57cbdb5be0d59
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/429140
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ivan Inozemtsev <iinozemtsev@google.com>
2025-05-20 10:33:53 -07:00
Ryan Macnak aa0a29c966 [infra] More setup for Mac and Windows ASAN.
Change-Id: I7cec0e5823410ee9dea2074c32f2ccb6f0aabceb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/427960
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2025-05-12 10:31:34 -07:00
Daco Harkes 245498232c [deps] Roll dart-lang/native
`package:native_assets_cli` has been split up and
`package:native_assets_builder` has been renamed.

Change-Id: Ic9d5c21bb3c7ecf7924fdee6b4281153ad37fac5
Cq-Include-Trybots: luci.dart.try:pkg-linux-debug-try,pkg-linux-release-arm64-try,pkg-linux-release-try,pkg-mac-release-arm64-try,pkg-win-release-arm64-try,pkg-mac-release-try,pkg-win-release-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/425504
Reviewed-by: Ivan Inozemtsev <iinozemtsev@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2025-05-01 02:18:11 -07:00
Johnni Winther 8d77908227 [test_runner] Support update_static_error_tests on Windows
A previous change inadvertently broke the support for Windows. This fixes this and adds an end-to-end test to avoid this.

Change-Id: I6f8563665038a7ecb0b30b5dfb7051b606d90620
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/420660
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2025-04-07 07:30:12 -07:00
Alexander Aprelev 1600519f81 [test/win] Use correct cdb.exe on ARM64.
See https://dart-ci.appspot.com/log/vm-win-release-arm64/vm-win-release-arm64/3854/vm/cc/IsolateReload_RegressB179030011 for example of currently incorrect behavior where x86 is used instead of arm64.

TEST=ci

Change-Id: I8e725a1bca39dcdd67ea856b7ebbea24e750dfda
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/420501
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2025-04-04 13:24:38 -07:00
Ryan Macnak 4ab313cf09 [vm, test] Enable some AOT testing for Fuchsia.
Fix the standalone embedder's ELF loader to open files with the executable permission.

TEST=ci
Bug: b/399714829
Bug: https://github.com/dart-lang/sdk/issues/60442
Cq-Include-Trybots: luci.dart.try:vm-fuchsia-release-arm64-try,vm-fuchsia-release-x64-try
Change-Id: I2652a5849462ce63585550e6c581cc578a228955
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/419341
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Zijie He <zijiehe@google.com>
2025-04-01 09:50:12 -07:00
Mayank Patke cc0527decb Remove babel from DEPS and (dart2js) IE support from test infra.
Tested: N/A
Change-Id: Ib1804b49c40cac9be52e732090e8160444ebb48d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/417948
Commit-Queue: Mayank Patke <fishythefish@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2025-03-28 11:26:47 -07:00
Stephen Adams 539511a611 [test] Add scriptUrl to trusted types
Change-Id: I0865832b120dd7b719f79d6374c166e414a180b9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/417902
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2025-03-25 19:30:33 -07:00
Stephen Adams 540922cdc9 [dart2js] Fix trusted types for dart2js deferred loading
'dart:deferred-loading' is not a valid trusted type policy name.
Change it to 'dart.deferred-loading'.

(See https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Content-Security-Policy/trusted-types#policyname )

Bug: https://github.com/flutter/flutter/issues/165513
Change-Id: I80c87ad0b1e34f3f8577721c0864aa31e83f2316
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/417105
Reviewed-by: Nate Biggs <natebiggs@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2025-03-24 10:57:02 -07:00
Martin Kustermann ea5f45e02e [dart2wasm] Make test runner validate <app>.support.js code says support is available before running test
This ensures we exercise the `<app>.support.js` code in our tests and
also catch it if a browser doesn't support what's needed (e.g. running
tests on Safari with `js-string` builtin)

Change-Id: Ib8874231d3aa82b598e0e206a2e27cb66775bbec
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/415882
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Ömer Ağacan <omersa@google.com>
2025-03-18 13:39:31 -07:00
Ömer Ağacan f4b41f0902 [dart2wasm] Fix handling of --define/-D
When parsing `--define` or `-D` arguments don't split the the value by
commas.

This is consistent with how dart2js handles `-D`, but inconsistent with
how VM handles it.

Example:

    void main() {
      print(const String.fromEnvironment("FOO"));
    }

When compiled with `dart compile js -DFOO="a, b"` and run, dart2js
prints

    a, b

VM prints (when compiled to exe)

    a

Between these two, I think dart2js' behavior is more common, so we
follow dart2js.

Also update compile_benchmark to avoid splitting a single argument "a b"
into "a" and "b" when parsing the arguments and then splicing them back
before calling `dart2wasm`.

Also update the test runner and ddc batch mode argument parser to handle
splitting quoted arguments in `// dart2jsOption = ...` and the same
options for ddc and dart2wasm, by moving dart2js's `splitLine` to a new
library and reusing it in the test runner and ddc.

Fixes https://github.com/flutter/flutter/issues/164873.

See also https://github.com/dart-lang/sdk/issues/60341 for relevant
future work.

Change-Id: Idbdf69072fa212c8e4a390990577eb5a57b49e8a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/415280
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
2025-03-18 04:11:41 -07:00
Devon Carew 3c973fb292 [lints] address diagnostics related to strict_top_level_inference
Change-Id: I228058202855900f0adba73c1ab04d35180a6e5d
Tested: this is an analyzer diagnostic only change
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/414900
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Nate Biggs <natebiggs@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2025-03-17 08:27:57 -07:00
Johnni Winther 0060b0f665 [cfe] Remove nnbd mode
TEST=existing

Change-Id: I30bbadb74e81c7f4aaa444d1e2f6f5ffc2005d4a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/412881
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2025-03-04 01:46:51 -08:00
Nate Biggs 237742feab [dart2js] Remove '--no-sound-null-safety' flag and make '--sound-null-safety' flag a no-op with warning.
Change-Id: I0225f9306aa2a84494f3fc17c9f7191214404249
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/406081
Reviewed-by: Ivan Inozemtsev <iinozemtsev@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2025-03-03 15:46:16 -08:00
Nicholas Shahan bc21f34991 [ddc] Break compiling with unsound null safety
Change-Id: Ib6f80fc38e355241f1214e7e457b712544645b37
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/386081
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Nate Biggs <natebiggs@google.com>
2025-02-28 12:33:17 -08:00
Mayank Patke 0c55c7e573 Remove unsound web configurations from test matrix.
This CL also removes references to unsound .dill files from the test
matrix and other build scripts and disables some of the option handling
that would lead to requiring unsound .dill files.

Change-Id: I89f701f8f5e1168bf974b5b44bfbafd5a39954fb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/412401
Reviewed-by: Nate Biggs <natebiggs@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2025-02-26 15:57:55 -08:00
Robert Nystrom 9c3e1a1459 Remove support for multi-line error messages in static error tests.
The static error test format allows an expected error message to contain newlines like:

```dart
some bad code;
// [cfe] The error message
// is two lines long.
```

Here, the expected error is "The error message\nistwo lines long."

This has an unfortunate side effect in that if you have a comment
immediately after a static error expectation, it will be treated as part
of the expected error:

```dart
some bad code;
// [cfe] Error.
// Unrelated comment.
```

This will expect the CFE to report "Error.\nUnrelated comment."

I looked at every static error test and there are no intentional uses
of multi-line expectations. The only two I found were both bugs.

Since this functionality is unused and error-prone, this CL removes it.
Error expectations can only be one line.

Fix #60137.

Change-Id: I7edb1f60a0c87d4160b93810806de49bc8f55b15
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/412185
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2025-02-26 00:14:51 -08:00
Ryan Macnak 690b380a6a [infra] Add configuration for testing SIMARM64 on ARM64.
Bug: https://github.com/dart-lang/sdk/issues/60204
Change-Id: Id49d144bedb7eb2047ee1cc36dd737bff62e808e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/411840
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2025-02-25 13:22:17 -08:00
Alexander Thomas 35d0a9caa6 [test_runner] Refactor BatchRunnerProcess
* Simplify runCommand using async/await.
* Remove outdated memory leak hack for DDC.
* Gather batch runner functionality in BatchRunnerProcess.
* Fix process leak that likely caused a hang on test.py shutdown.
* Add a test.

Change-Id: I87584e4c951ad0fe1650c67db090910acf0f37e4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/408700
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
2025-02-11 23:02:00 -08:00
Martin Kustermann 3581fa7850 [dart2wasm] No longer pass --experimental-wasm-imported-strings to V8 (js-string builtins are enabled by default)
Change-Id: I353e3dbd693d8ce83f75059a2d6dd72b277d3677
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/406842
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Ömer Ağacan <omersa@google.com>
2025-01-30 04:37:00 -08:00
Martin Kustermann e13db8b773 [dart2wasm] Remove --turboshaft-wasm flag (which was removed from D8) in test runner
Running tests currently result in a warning by D8:

    Warning: unknown flag --turboshaft-wasm.

Turboshaft was enabled by default in V8 and is no longer exposed as a
flag.

Change-Id: I487f145ba60b20d7c61397c4ad4c5af1d0263b60
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/404320
Reviewed-by: Ömer Ağacan <omersa@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2025-01-14 05:07:38 -08:00
Martin Kustermann 6aeb865781 [dart2wasm] Workaround bug in JavaScriptCore/WebKit in test runner
The recent roll of JSC caused *many* failures on the
dart2wasm-linux-optimized-jsc configuration. I believe this is due to a
interpretation/optimization bug in JavaScriptCore/WebKit.

=> Filed https://bugs.webkit.org/show_bug.cgi?id=285902

It seems we can workaround this by passing `--useWasmIPInt=false` in the
test runner for now.

Issue https://github.com/dart-lang/sdk/issues/59899

Change-Id: Ie7ae7bf0a5654eb3362bc23934becd8162227992
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/404104
Reviewed-by: Ömer Ağacan <omersa@google.com>
2025-01-14 04:09:47 -08:00
Ryan Macnak 7dbe18a36f Roll Fuchsia SDK from 25.20241104.6.1 to 26.20241209.5.1
Cq-Include-Trybots: luci.dart.try:vm-fuchsia-release-x64-try,vm-fuchsia-release-arm64-try
Change-Id: Iee85e6c34b588601fd26b383ec6bd8adaafbcc21
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/399628
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2024-12-10 00:25:10 +00:00
Lasse R.H. Nielsen 5430e68680 Remove unnecessary leftover @dart=2.19 from tests.
Change-Id: I6d5e15ff2d432202618fbc490969a65a9181816d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/396281
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
2024-11-28 09:10:30 +00:00
Robert Nystrom 9d3f7c52bd Make the static error test updater run the analyzer as a library.
Prior to this change, the static error test updater would spawn a new
analyzer CLI for each updated test file. This was incredibly slow, like
5-10 seconds for each file.

This change instead uses the analyzer as a library. It creates a single
analysis context collection for all of the files to be updated and then
gets the errors from that.

On my machine, it's about 100x faster. It's fast enough to routinely
update *all* of the test expectations in a batch. (Or, at least, it will
be if we can make a similar change for CFE.)

Change-Id: I39059489e966abf040e9f995505c7013b18d4930
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/396574
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
2024-11-26 19:07:38 +00:00
Johnni Winther 808fa4ca8b [cfe] Move tool/_fasta/ to tool/
Change-Id: I5b7348fb4adb4e7f4039c91d54d712c1eb131ecf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/395002
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2024-11-18 07:49:01 +00:00
Robert Nystrom 82afcb4edd Make the static error test updater not write comments at column zero.
The old formatter had a special rule that if a line comment as at the
left edge of the page, it would stay there regardless of the surrounding
indentation. So if you had:

```
class C {
  m() {
// comment
  }
}
```

After formatting, the comment would still be there instead of being
indented. The intent of that was to not shift over code that had been
commented out.

But all of the IDEs I tested don't actually work that way. When they
comment out code, they tend to put the `//` at the indentation of the
surrounding code. So the new formatter doesn't have this special rule
and always indents line comments following the surrounding indentation.
This is good because it also means that code generators that don't write
any leading whitespace will still get nicely formatted comments.

However, the static error test updater took advantage of this rule and
would write static error marker comments at column zero if needed to
get the carets to align with the code on the previous line and assume
that the formatter wouldn't move the comment.

This fixes the static error test updater. It always writes comments
using indentation from the previous line of code and if the caret
doesn't fit that way, it uses an explicit column marker.

Fix #57042.

Change-Id: I40fd7cd19d08dc228b6a6797e6a26965d1343d32
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/394363
Reviewed-by: Nate Bosch <nbosch@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
2024-11-11 23:36:35 +00:00
asiva 8b2b6b2440 Reland ""[SDK/VM] - Rename dart_precompiled_runtime to dartaotruntime, ensures we have a uniform name for the executable between the build directories and the SDK directory""
This reverts commit 74c5aa3a7a.

Reason for revert: Fix golem breakage by not changing the script dart_precompiled_runtime2

TEST=ci

Original change's description:
> Revert ""[SDK/VM] - Rename dart_precompiled_runtime to dartaotruntime, ensures we have a uniform name for the executable between the build directories and the SDK directory""
>
> This reverts commit f81a402aa1.
>
> Reason for revert: golem benchmarks are failing to run
>
> TEST=ci
>
> Original change's description:
> > "[SDK/VM] - Rename dart_precompiled_runtime to dartaotruntime, ensures we have a uniform name for the executable between the build directories and the SDK directory"
> >
> > Fixed golem breakage by temporarily copying dartaotruntime to dart_precompiled_runtime
> >
> > This reverts commit 75e6a748f7.
> >
> > TEST=ci
> >

Change-Id: I9efe40643c59bc617f6fb484b89b038deaffbb93
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/393941
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2024-11-08 04:36:23 +00:00
Srujan Gaddam 22833d51da [ddc, test_runner] Add stackTrace debugger helper to dartDevEmbedder and clean up test_runner
Adds a stackTrace helper that returns a stringified StackTrace for
an arbitrary error. Removes importLibrary references in test_runner
now that we have that and removes some calls that didn't do anything
(addAsyncCallback, removeAsyncCallback, and startRootIsolate).

addAsyncCallback and removeAsyncCallback are also removed from the
runtime. Calling these were removed in https://github.com/dart-lang/sdk/commit/8bd3690ab06c3eda2f4996ca60b94fdcc9f76105
so this is just finishing up the clean-up.

Change-Id: I9dacc2b3fd3e27468061d6e59a3207eecdb7cac8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/393800
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2024-11-07 03:40:54 +00:00
Siva Annamalai 74c5aa3a7a Revert ""[SDK/VM] - Rename dart_precompiled_runtime to dartaotruntime, ensures we have a uniform name for the executable between the build directories and the SDK directory""
This reverts commit f81a402aa1.

Reason for revert: golem benchmarks are failing to run

TEST=ci

Original change's description:
> "[SDK/VM] - Rename dart_precompiled_runtime to dartaotruntime, ensures we have a uniform name for the executable between the build directories and the SDK directory"
>
> Fixed golem breakage by temporarily copying dartaotruntime to dart_precompiled_runtime
>
> This reverts commit 75e6a748f7.
>
> TEST=ci
>
> Original change's description:
> > Revert "[SDK/VM] - Rename dart_precompiled_runtime to dartaotruntime, ensures we have a uniform name for the executable between the build directories and the SDK directory"
> >
> > This reverts commit 1b331d05c2.
> >
> > Reason for revert: golem builds are failing
> >
> > Original change's description:
> > > [SDK/VM] - Rename dart_precompiled_runtime to dartaotruntime, ensures we have a uniform name for the executable between the build directories and the SDK directory
> > >
> > > TEST=ci
> > >
>
> Change-Id: Id0f383eabb496c06c0acebc639c8e3b056ba82d0
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/393781
> Commit-Queue: Siva Annamalai <asiva@google.com>
> Reviewed-by: Ryan Macnak <rmacnak@google.com>

Change-Id: Iec494940412aa31dbefdc5280e35ae99e8cecb26
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/393764
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Liam Appelbe <liama@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2024-11-06 05:37:46 +00:00
asiva f81a402aa1 "[SDK/VM] - Rename dart_precompiled_runtime to dartaotruntime, ensures we have a uniform name for the executable between the build directories and the SDK directory"
Fixed golem breakage by temporarily copying dartaotruntime to dart_precompiled_runtime

This reverts commit 75e6a748f7.

TEST=ci

Original change's description:
> Revert "[SDK/VM] - Rename dart_precompiled_runtime to dartaotruntime, ensures we have a uniform name for the executable between the build directories and the SDK directory"
>
> This reverts commit 1b331d05c2.
>
> Reason for revert: golem builds are failing
>
> Original change's description:
> > [SDK/VM] - Rename dart_precompiled_runtime to dartaotruntime, ensures we have a uniform name for the executable between the build directories and the SDK directory
> >
> > TEST=ci
> >

Change-Id: Id0f383eabb496c06c0acebc639c8e3b056ba82d0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/393781
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2024-11-06 03:10:31 +00:00
Siva Annamalai 75e6a748f7 Revert "[SDK/VM] - Rename dart_precompiled_runtime to dartaotruntime, ensures we have a uniform name for the executable between the build directories and the SDK directory"
This reverts commit 1b331d05c2.

Reason for revert: golem builds are failing

Original change's description:
> [SDK/VM] - Rename dart_precompiled_runtime to dartaotruntime, ensures we have a uniform name for the executable between the build directories and the SDK directory
>
> TEST=ci
>
> Change-Id: I96ed52994e0d955300c18026032e68003504666d
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/389760
> Reviewed-by: Ryan Macnak <rmacnak@google.com>
> Commit-Queue: Siva Annamalai <asiva@google.com>
> Reviewed-by: Alexander Thomas <athom@google.com>

Change-Id: I5dc14973f4ee4e577b2c996839d5e497c97fb440
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/393761
Commit-Queue: Siva Annamalai <asiva@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2024-11-05 21:58:09 +00:00
asiva 1b331d05c2 [SDK/VM] - Rename dart_precompiled_runtime to dartaotruntime, ensures we have a uniform name for the executable between the build directories and the SDK directory
TEST=ci

Change-Id: I96ed52994e0d955300c18026032e68003504666d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/389760
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2024-11-05 20:39:15 +00:00
Chloe Stefantsova 253e715f83 [analyzer] Report warnings on expressions with non-nullable types
Part of https://github.com/dart-lang/sdk/issues/56836

Change-Id: I3fcdceff667f371fcf4b66c12bd16e2f34e6446c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/391621
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
2024-10-25 10:08:04 +00:00
asiva da14b16ef3 [Web/DDC] - Convert the kernel_worker and dartdevc snapshots to an AOT snapshot
Converts kernel_worker.dart.snapshot and dartdevc.dart.snapshot to
 AOT snapshots. Fixes tests and paths in the code accordingly.

TESTS=ci

Change-Id: Ib99b2a3343e23252c3a6b5295b0d20f0f486aede
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/381388
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2024-10-22 17:39:27 +00:00
Lasse R.H. Nielsen f8086c81ae Collect all test-related files in package:expect.
Collects files from `package:async_helper` and `tests/language`
that are generally useful, so that all test-related helpers are
in `package:expect`.

Moves the two libraries from `package:async_helper` into `package:expect`,
and the `tests/language/static_type_helper.dart` file too.

Deprecates `async_minitest.dart`, to follow `minitest.dart`,
expecting the Flutter use of it to have been fixed to not break
on deprecation (I believe Flutter no longer breaks builds on deprecations at all).

Patch 1 is the actual change.
Patch 2+4+8 is changing all existing references to the files.
Patch 6 ignores deprecation in files still using `async_minitest.dart`.

3+5+7+9 are updating this text to make the numbers match.
Then it's just test-expectations and small tweaks from there.

Change-Id: I1b665135b5fef9b9a0c3b340ffe9daf874d0174c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/373120
Reviewed-by: Nate Bosch <nbosch@google.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
2024-10-11 16:53:52 +00:00
Martin Kustermann bc15ff6d53 [deps] Roll dart-lang/native to new version
Cq-Include-Trybots: luci.dart.try:pkg-linux-debug-try,pkg-linux-release-arm64-try,pkg-linux-release-try,pkg-mac-release-arm64-try,pkg-mac-release-try,pkg-win-release-arm64-try,pkg-win-release-try
Change-Id: I8e9e8e076777e1ac152fddbdab72581c2fc572c7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/387701
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2024-10-01 12:45:16 +00:00