Skip to content

Commit

Permalink
[tools/update-ui-test-files.sh] Initial commit (#1171)
Browse files Browse the repository at this point in the history
Update documentation to mention this new script.

Closes #1170
  • Loading branch information
joshlf committed May 3, 2024
1 parent c9226ba commit a546768
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
2 changes: 1 addition & 1 deletion INTERNAL.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Updating the versions pinned in CI may cause the UI tests to break. In order to
fix UI tests after a version update, run:

```
$ TRYBUILD=overwrite ./cargo.sh +all test
$ ./tools/update-ui-test-files.sh
```

## Crate versions
Expand Down
5 changes: 0 additions & 5 deletions tools/cargo-zerocopy/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,6 @@
// once for each "major" toolchain (msrv, stable, nightly). This does not
// include any toolchain which is listed in the `package.metadata.build-rs`
// Cargo.toml section.
//
// A common task that is especially annoying to perform by hand is to update
// trybuild's stderr files. Using this script:
//
// TRYBUILD=overwrite ./cargo-zerocopy +all test --workspace

use std::{
env, fmt,
Expand Down
17 changes: 17 additions & 0 deletions tools/update-ui-test-files.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash
#
# Copyright 2024 The Fuchsia Authors
#
# Licensed under a BSD-style license <LICENSE-BSD>, Apache License, Version 2.0
# <LICENSE-APACHE or https://www.apache.org/licenses/LICENSE-2.0>, or the MIT
# license <LICENSE-MIT or https://opensource.org/licenses/MIT>, at your option.
# This file may not be copied, modified, or distributed except according to
# those terms.

# Update the `.stderr` reference files used to validate our UI tests.

set -e

TRYBUILD=overwrite ./cargo.sh +nightly test ui --test trybuild --workspace --all-features
TRYBUILD=overwrite ./cargo.sh +stable test ui --test trybuild --workspace --features=__internal_use_only_features_that_work_on_stable
TRYBUILD=overwrite ./cargo.sh +msrv test ui --test trybuild --workspace --features=__internal_use_only_features_that_work_on_stable

0 comments on commit a546768

Please sign in to comment.