Skip to content

Commit 91cdf8b

Browse files
committed
Fix some tests
1 parent 84af9ed commit 91cdf8b

File tree

3 files changed

+19
-11
lines changed

3 files changed

+19
-11
lines changed

Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,11 @@ ifeq ($(wildcard rustc/bin),)
77
export RUSTC := rustc
88
else
99
export RUSTC := $(CURDIR)/rustc/bin/rustc
10+
export LD_LIBRARY_PATH := $(CURDIR)/rustc/lib:$(LD_LIBRARY_PATH)
11+
export DYLD_LIBRARY_PATH := $(CURDIR)/rustc/lib:$(DYLD_LIBRARY_PATH)
1012
endif
1113

12-
export PATH := $(PATH):$(CURDIR)/rustc/bin
14+
export PATH := $(CURDIR)/rustc/bin:$(PATH)
1315

1416
# Link flags to pull in dependencies
1517
BINS = cargo \

tests/test_cargo_compile.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1062,7 +1062,7 @@ test!(verbose_release_build_deps {
10621062
--out-dir {dir}{sep}target{sep}release \
10631063
-L {dir}{sep}target{sep}release \
10641064
-L {dir}{sep}target{sep}release{sep}deps \
1065-
--extern foo={dir}/target/release/deps/libfoo{hash1}.rlib`
1065+
--extern foo={dir}{sep}target{sep}release{sep}deps/libfoo{hash1}.rlib`
10661066
{compiling} foo v0.0.0 (file:{dir})
10671067
{compiling} test v0.0.0 (file:{dir})\n",
10681068
running = RUNNING,

tests/test_cargo_test.rs

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1+
use std::str;
2+
13
use support::{project, execs, basic_bin_manifest, COMPILING, cargo_dir};
4+
use support::{ResultTest};
25
use hamcrest::{assert_that, existing_file};
36
use cargo::util::process;
47

@@ -60,23 +63,26 @@ test!(test_with_lib_dep {
6063
fn bin_test() {}
6164
");
6265

63-
assert_that(p.cargo_process("cargo-test"),
64-
execs().with_status(0)
65-
.with_stdout(format!("\
66-
{compiling} foo v0.0.1 (file:{dir})
66+
let output = p.cargo_process("cargo-test")
67+
.exec_with_output().assert();
68+
let out = str::from_utf8(output.output.as_slice()).assert();
6769

70+
let bin = "\
6871
running 1 test
6972
test bin_test ... ok
7073
71-
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured
72-
73-
74+
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured";
75+
let lib = "\
7476
running 1 test
7577
test lib_test ... ok
7678
77-
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured
79+
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured";
80+
81+
let head = format!("{compiling} foo v0.0.1 (file:{dir})",
82+
compiling = COMPILING, dir = p.root().display());
7883

79-
", compiling = COMPILING, dir = p.root().display()).as_slice()));
84+
assert!(out == format!("{}\n\n{}\n\n\n{}\n\n", head, bin, lib).as_slice() ||
85+
out == format!("{}\n\n{}\n\n\n{}\n\n", head, lib, bin).as_slice());
8086
})
8187

8288
test!(test_with_deep_lib_dep {

0 commit comments

Comments
 (0)