test: index shards at 1, not 0

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
This commit is contained in:
Corey Richardson 2014-05-18 19:35:45 -07:00
parent 63287eef27
commit 2eeb4992df
3 changed files with 60 additions and 22 deletions

View file

@ -0,0 +1,7 @@
-include ../tools.mk
all:
# Running all the shards should hit every test
$(RUSTC) --test main.rs
$(call RUN,main) --test-shard 1.2 | grep "test_1 ... ok"
$(call RUN,main) --test-shard 2.2 | grep "test_2 ... ok"

View file

@ -0,0 +1,16 @@
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![crate_type = "lib"]
#[test]
fn test_1() { }
#[test]
fn test_2() { }