Skip to content

Commit

Permalink
Add compile-tests to zerocopy
Browse files Browse the repository at this point in the history
This commit just adds the framework necessary to run these tests, but
does not add any compile-tests. Tests will need to be added to complete
 #17.
  • Loading branch information
joshlf committed Oct 1, 2022
1 parent 772604d commit 7c86a0d
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,5 @@ version = "1.3"
default-features = false

[dev-dependencies]
compiletest_rs = "0.8"
rand = "0.6"
25 changes: 25 additions & 0 deletions tests/compiletest.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// 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.

use std::path::PathBuf;

use compiletest_rs::{common::Mode, Config};

#[test]
fn ui() {
let mut config = Config {
// Uncomment to bless tests.
// bless: true,
mode: Mode::Ui,
src_base: PathBuf::from("tests/ui"),
target_rustcflags: Some("-L target/debug -L target/debug/deps".to_string()),
build_base: PathBuf::from("target/ui"),
..Default::default()
};

config.link_deps();
config.clean_rmeta();

compiletest_rs::run_tests(&config);
}

0 comments on commit 7c86a0d

Please sign in to comment.