| // Copyright 2022 The Fuchsia Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| { |
| actions: [ |
| // Expectations are processed from top to bottom, such that the _last_ matching expectation |
| // is the one that wins out. So you can read this expectation as: if no other expectations |
| // match, expect that the test failed. |
| { |
| type: "expect_failure", |
| matchers: [ |
| "*", |
| ], |
| }, |
| |
| // Expectation files can be included using relative paths... |
| { |
| include: "included_expectations.json5", |
| }, |
| |
| // or using absolute ones. Note that including the same expectation file multiple times is |
| // allowed. There's not much reason to do that directly as is done here, but it's more |
| // convenient in deeper expectation include trees. |
| { |
| include: "//src/lib/testing/expectation/included_expectations.json5", |
| }, |
| |
| // Expectation matchers are globs against test case names, with the same rules as |
| // Unix file globbing (see the `glob` crate docs: https://docs.rs/crate/glob/latest). |
| { |
| type: "expect_failure", |
| matchers: [ |
| "*fail*", |
| ], |
| }, |
| { |
| type: "skip", |
| matchers: [ |
| "*skip*", |
| ], |
| }, |
| |
| // If a test produces error logs, the `with_err_logs` expectation can be used alongside |
| // GN flags (see README) to restrict the environments in which the test is run. |
| { |
| type: "expect_failure_with_err_logs", |
| matchers: [ |
| "*a_failing_test_with_err_logs*", |
| ], |
| }, |
| { |
| type: "expect_pass_with_err_logs", |
| matchers: [ |
| "*a_passing_test_with_err_logs*", |
| ], |
| }, |
| ], |
| } |