Fix feature-gating of test-programs (#612)

* Fix feature-gating of test-programs

This commit fixes bugs in enabling feature-gating of `test-programs`
which was introduced in #600. It turns out, #600 accidentally
disabled `test-programs` from ever running, and this commit fixes
that.

* Fix the CI
This commit is contained in:
Jakub Konka
2019-11-21 13:52:15 +01:00
committed by GitHub
parent eb8538099f
commit bbe2a797ba
6 changed files with 15 additions and 9 deletions

View File

@@ -23,3 +23,6 @@ tempfile = "3.1.0"
os_pipe = "0.9"
anyhow = "1.0.19"
wat = "1.0.2"
[features]
test_programs = []

View File

@@ -4,11 +4,11 @@
//! to automatically run the files in parallel.
fn main() {
#[cfg(features = "test-programs")]
#[cfg(feature = "test_programs")]
wasi_tests::build_and_generate_tests()
}
#[cfg(features = "test-programs")]
#[cfg(feature = "test_programs")]
mod wasi_tests {
use std::env;
use std::fs::{read_dir, DirEntry, File};
@@ -16,7 +16,7 @@ mod wasi_tests {
use std::path::{Path, PathBuf};
use std::process::{Command, Stdio};
fn build_and_generate_tests() {
pub(super) fn build_and_generate_tests() {
// Validate if any of test sources are present and if they changed
// This should always work since there is no submodule to init anymore
let bin_tests = std::fs::read_dir("wasi-tests/src/bin").unwrap();

View File

@@ -1,4 +1,4 @@
#![cfg(features = "test-programs")]
#![cfg(feature = "test_programs")]
mod runtime;
mod utils;

View File

@@ -60,10 +60,10 @@ rustup target add wasm32-wasi
[rustup]: https://rustup.rs
Now, you should be able to run the integration testsuite by running `cargo test` on the
`test-programs` package:
`test-programs` package with `test_programs` feature enabled:
```
cargo test --package test-programs
cargo test --features test_programs --package test-programs
```
## Third-Party Code