Sha256: 8b77ed684725d2e99fd7806d8f361cd2495b388cc463be3ff2fae25bcbe34c56

Contents?: true

Size: 1.86 KB

Versions: 23

Compression:

Stored size: 1.86 KB

Contents

// Copyright 2019 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.

use testutil::ToolchainVersion;

#[test]
#[cfg_attr(miri, ignore)]
fn ui() {
    let version = ToolchainVersion::extract_from_pwd().unwrap();
    // See the doc comment on this method for an explanation of what this does
    // and why we store source files in different directories.
    let source_files_dirname = version.get_ui_source_files_dirname_and_maybe_print_warning();

    let t = trybuild::TestCases::new();
    t.compile_fail(format!("tests/{source_files_dirname}/*.rs"));
}

// The file `invalid-impls.rs` directly includes `src/macros.rs` in order to
// test the `impl_or_verify!` macro which is defined in that file. Specifically,
// it tests the verification portion of that macro, which is enabled when
// `cfg(any(feature = "derive", test))`. While `--cfg test` is of course passed
// to the code in the file you're reading right now, `trybuild` does not pass
// `--cfg test` when it invokes Cargo. As a result, this `trybuild` test only
// tests the correct behavior when the "derive" feature is enabled.
#[cfg(feature = "derive")]
#[test]
#[cfg_attr(miri, ignore)]
fn ui_invalid_impls() {
    let version = ToolchainVersion::extract_from_pwd().unwrap();
    // See the doc comment on this method for an explanation of what this does
    // and why we store source files in different directories.
    let source_files_dirname = version.get_ui_source_files_dirname_and_maybe_print_warning();

    let t = trybuild::TestCases::new();
    t.compile_fail(format!("tests/{source_files_dirname}/invalid-impls/*.rs"));
}

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
wasmtime-29.0.0 ./ext/cargo-vendor/zerocopy-0.7.35/tests/trybuild.rs
wasmtime-28.0.0 ./ext/cargo-vendor/zerocopy-0.7.35/tests/trybuild.rs
wasmtime-27.0.0 ./ext/cargo-vendor/zerocopy-0.7.35/tests/trybuild.rs
wasmtime-26.0.0 ./ext/cargo-vendor/zerocopy-0.7.35/tests/trybuild.rs
wasmtime-25.0.2 ./ext/cargo-vendor/zerocopy-0.7.35/tests/trybuild.rs
wasmtime-25.0.1 ./ext/cargo-vendor/zerocopy-0.7.35/tests/trybuild.rs
wasmtime-25.0.0 ./ext/cargo-vendor/zerocopy-0.7.35/tests/trybuild.rs
wasmtime-24.0.0 ./ext/cargo-vendor/zerocopy-0.7.35/tests/trybuild.rs
wasmtime-23.0.2 ./ext/cargo-vendor/zerocopy-0.7.32/tests/trybuild.rs
wasmtime-22.0.0 ./ext/cargo-vendor/zerocopy-0.7.32/tests/trybuild.rs
wasmtime-21.0.1 ./ext/cargo-vendor/zerocopy-0.7.32/tests/trybuild.rs
wasmtime-20.0.2 ./ext/cargo-vendor/zerocopy-0.7.32/tests/trybuild.rs
wasmtime-20.0.0 ./ext/cargo-vendor/zerocopy-0.7.32/tests/trybuild.rs
wasmtime-18.0.3 ./ext/cargo-vendor/zerocopy-0.7.32/tests/trybuild.rs
wasmtime-17.0.1 ./ext/cargo-vendor/zerocopy-0.7.32/tests/trybuild.rs
wasmtime-17.0.0 ./ext/cargo-vendor/zerocopy-0.7.32/tests/trybuild.rs
wasmtime-16.0.0 ./ext/cargo-vendor/zerocopy-0.7.32/tests/trybuild.rs
wasmtime-15.0.1 ./ext/cargo-vendor/zerocopy-0.7.32/tests/trybuild.rs
wasmtime-15.0.0 ./ext/cargo-vendor/zerocopy-0.7.32/tests/trybuild.rs
wasmtime-14.0.4 ./ext/cargo-vendor/zerocopy-0.7.15/tests/trybuild.rs