Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: index shards at 1, not 0 #14286

Merged
merged 1 commit into from
May 20, 2014
Merged

test: index shards at 1, not 0 #14286

merged 1 commit into from
May 20, 2014

Conversation

emberian
Copy link
Member

This has no tests because it's near impossible to test -- since TestFn uses
procs, they can not be cloned or tested for equality. The only way to really
test this is making sure that for a given number of shards a, sharding from
1 to a yields the complete set of tests. But filter_tests takes its vector
by value and procs cannot be compared.

[breaking-change]

Closes #10898

@huonw
Copy link
Member

huonw commented May 19, 2014

What about a run-make test?

@sfackler
Copy link
Member

Is there any reason to not keep the 0-based indexing and add a range check?

@emberian
Copy link
Member Author

@sfackler I think having it 1-based makes more sense. "This is shard 1 of 2" and "This is shard 2 of 2"

@emberian
Copy link
Member Author

@huonw what are you thinking that would look like?

@huonw
Copy link
Member

huonw commented May 19, 2014

# Makefile
all:
    rustc --test foo.rs
    ./foo --shard 1.2 | grep 'test_1 ... ok'
    ./foo --shard 2.2 | grep 'test_2 ... ok'
// foo.rs
#[test]
fn test_1() {}
#[test]
fn test_2() {}

(or similar)

DynTestFn(..) => "DynTestFn(..)",
DynMetricFn(..) => "DynMetricFn(..)",
DynBenchFn(..) => "DynBenchFn(..)"
}.as_bytes()).ok().unwrap();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems odd, why not just return the result?

@emberian
Copy link
Member Author

@alexcrichton I've removed your r+ -- I still need to add a test.

@alexcrichton
Copy link
Member

Ah whoops, ok! r=me with a test

This has no tests because it's near impossible to test -- since TestFn uses
`proc`s, they can not be cloned or tested for equality. The only way to really
test this is making sure that for a given number of shards `a`, sharding from
1 to `a` yields the complete set of tests. But `filter_tests` takes its vector
by value and `proc`s cannot be compared.

[breaking-change]

Closes #10898
bors added a commit that referenced this pull request May 19, 2014
This has no tests because it's near impossible to test -- since TestFn uses
`proc`s, they can not be cloned or tested for equality. The only way to really
test this is making sure that for a given number of shards `a`, sharding from
1 to `a` yields the complete set of tests. But `filter_tests` takes its vector
by value and `proc`s cannot be compared.

[breaking-change]

Closes #10898
@bors bors closed this May 20, 2014
@bors bors merged commit 2eeb499 into rust-lang:master May 20, 2014
lnicola pushed a commit to lnicola/rust that referenced this pull request Mar 13, 2023
fix: Fix block defmap not looking into tail expressions for macro calls

Fixes rust-lang/rust-analyzer#14263
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

--test-shard ignores benchmarks?
5 participants