eupn / macrotest

Test harness for declarative and procedural macros expansion via `cargo-expand`
47 stars 9 forks source link

test-project: cargo test shows failures #73

Closed taqtiqa-mark closed 2 years ago

taqtiqa-mark commented 2 years ago

Context: Investigating the cause of issue #71, in the course of making PR #72.

Using the current master:

cd test-project
cargo test -- --nocapture

Shows some tests failing:

    Finished test [unoptimized + debuginfo] target(s) in 0.02s
     Running unittests (target/debug/deps/test_project-90e6064d5d3cb538)

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

     Running tests/par_tests_regression.rs (target/debug/deps/par_tests_regression-ed3d7a792e4170a2)

running 2 tests
Running 1 macro expansion tests
Running 1 macro expansion tests
    Checking test-project-tests v0.0.0 (/home/user/src/macrotest/test-project/target/tests/test-project/macrotest000)
    Blocking waiting for file lock on build directory
    Finished dev [unoptimized + debuginfo] target(s) in 0.18s
    Checking test-project-tests v0.0.0 (/home/user/src/macrotest/test-project/target/tests/test-project/macrotest001)
    Finished dev [unoptimized + debuginfo] target(s) in 0.48s

use std::prelude::rust_2018::*;

use std::prelude::rust_2018::*;
tests/expand/second.rs - ok
test parallel_2 ... ok
tests/expand/first.rs - ok
test parallel_1 ... ok

test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 1.78s

     Running tests/tests.rs (target/debug/deps/tests-78123928aa400a33)

running 7 tests
Running 4 macro expansion tests
Running 1 macro expansion tests
    Checking test-project-tests v0.0.0 (/home/user/src/macrotest/test-project/target/tests/test-project/macrotest000)
    Blocking waiting for file lock on build directory
    Finished dev [unoptimized + debuginfo] target(s) in 0.24s
    Checking test-project-tests v0.0.0 (/home/user/src/macrotest/test-project/target/tests/test-project/macrotest001)

use std::prelude::rust_2018::*;
    Finished dev [unoptimized + debuginfo] target(s) in 0.99s

use std::prelude::rust_2018::*;
tests/no_expanded/first.expanded.rs is expected but not found
tests/no_expanded_args/with_args.expanded.rs is expected but not found

thread 'fail_expect_expanded_args' panicked at '1 of 1 tests failed', /home/user/src/macrotest/src/expand.rs:171:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
test fail_expect_expanded_args - should panic ... ok
Running 4 macro expansion tests
    Checking test-project-tests v0.0.0 (/home/user/src/macrotest/test-project/target/tests/test-project/macrotest002)
tests/no_expanded/fourth.expanded.rs is expected but not found
    Finished dev [unoptimized + debuginfo] target(s) in 0.55s

use std::prelude::rust_2018::*;
tests/no_expanded/second.expanded.rs is expected but not found
tests/expand/first.rs - ok
tests/no_expanded/third.expanded.rs is expected but not found

thread 'fail_expect_expanded' panicked at '4 of 4 tests failed', /home/user/src/macrotest/src/expand.rs:171:9
test fail_expect_expanded - should panic ... ok
Running 1 macro expansion tests
    Checking test-project-tests v0.0.0 (/home/user/src/macrotest/test-project/target/tests/test-project/macrotest003)
tests/expand/fourth.rs - ok
    Finished dev [unoptimized + debuginfo] target(s) in 1.00s

use std::prelude::rust_2018::*;
tests/expand/second.rs - ok
tests/expand_args/with_args.rs - ok
test pass_args ... ok
Running 4 macro expansion tests
    Checking test-project-tests v0.0.0 (/home/user/src/macrotest/test-project/target/tests/test-project/macrotest004)
tests/expand/third.rs - ok
test pass ... ok
Running 1 macro expansion tests
    Finished dev [unoptimized + debuginfo] target(s) in 0.57s
    Checking test-project-tests v0.0.0 (/home/user/src/macrotest/test-project/target/tests/test-project/macrotest005)

use std::prelude::rust_2018::*;
    Finished dev [unoptimized + debuginfo] target(s) in 0.47s

use std::prelude::rust_2018::*;
tests/expand/first.rs - ok
tests/expand_args/with_args.rs - ok
test pass_expect_expanded_args ... ok
Running 2 macro expansion tests
    Checking test-project-tests v0.0.0 (/home/user/src/macrotest/test-project/target/tests/test-project/macrotest006)
tests/expand/fourth.rs - ok
    Finished dev [unoptimized + debuginfo] target(s) in 0.47s

use std::prelude::rust_2018::*;
tests/expand/second.rs - ok
tests/pr61/a/test.rs - ok
tests/expand/third.rs - ok
test pass_expect_expanded ... ok
tests/pr61/b/test.rs - ok
test pr61 ... ok

test result: ok. 7 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 17.27s

   Doc-tests test-project

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
taqtiqa-mark commented 2 years ago

Ok it appears these are #[should_panic] and are not the two failures observed in issue #71