Skip to content

Commit f945e57

Browse files
committed
rustpkg: Correct directory structure in test scenarios
1 parent 6a3e26a commit f945e57

File tree

9 files changed

+11
-6
lines changed

9 files changed

+11
-6
lines changed

src/librustpkg/testsuite/pass/src/fancy-lib/src/fancy-lib.rs renamed to src/librustpkg/testsuite/pass/src/fancy-lib/fancy-lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ extern mod std;
2121

2222
pub mod foo;
2323
pub mod bar;
24-
#[path = "build/generated.rs"] pub mod generated;
24+
#[path = "../../build/fancy_lib/generated.rs"] pub mod generated;

src/librustpkg/testsuite/pass/src/fancy-lib/pkg.rs

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,18 @@
1111
use core::run;
1212

1313
pub fn main() {
14-
let cwd = os::getcwd();
15-
debug!("cwd = %s", cwd.to_str());
16-
let file = io::file_writer(&Path(~"fancy-lib/build/generated.rs"),
14+
use core::libc::consts::os::posix88::{S_IRUSR, S_IWUSR, S_IXUSR};
15+
16+
let out_path = Path(~"build/fancy_lib");
17+
if !os::path_exists(&out_path) {
18+
assert!(os::make_dir(&out_path, (S_IRUSR | S_IWUSR | S_IXUSR) as i32));
19+
}
20+
21+
let file = io::file_writer(&out_path.push("generated.rs"),
1722
[io::Create]).get();
1823
file.write_str("pub fn wheeeee() { for [1, 2, 3].each() |_| { assert!(true); } }");
1924

2025
// now compile the crate itself
21-
run::run_program("rustc", ~[~"fancy-lib/fancy-lib.rs", ~"--lib",
22-
~"-o", ~"fancy-lib/build/fancy_lib"]);
26+
run::run_program("rustc", ~[~"src/fancy-lib/fancy-lib.rs", ~"--lib",
27+
~"-o", out_path.push(~"fancy_lib").to_str()]);
2328
}

0 commit comments

Comments
 (0)