From f945e57bd050227bbf92f151303785991173f2fe Mon Sep 17 00:00:00 2001 From: Tim Chevalier Date: Mon, 22 Apr 2013 17:56:15 -0700 Subject: [PATCH] rustpkg: Correct directory structure in test scenarios --- .../testsuite/pass/src/fancy-lib/{src => }/bar.rs | 0 .../pass/src/fancy-lib/{src => }/fancy-lib.rs | 2 +- .../testsuite/pass/src/fancy-lib/{src => }/foo.rs | 0 .../testsuite/pass/src/fancy-lib/pkg.rs | 15 ++++++++++----- .../pass/src/hello-world/{src => }/main.rs | 0 .../pass/src/install-paths/{src => }/bench.rs | 0 .../pass/src/install-paths/{src => }/lib.rs | 0 .../pass/src/install-paths/{src => }/main.rs | 0 .../pass/src/install-paths/{src => }/test.rs | 0 9 files changed, 11 insertions(+), 6 deletions(-) rename src/librustpkg/testsuite/pass/src/fancy-lib/{src => }/bar.rs (100%) rename src/librustpkg/testsuite/pass/src/fancy-lib/{src => }/fancy-lib.rs (92%) rename src/librustpkg/testsuite/pass/src/fancy-lib/{src => }/foo.rs (100%) rename src/librustpkg/testsuite/pass/src/hello-world/{src => }/main.rs (100%) rename src/librustpkg/testsuite/pass/src/install-paths/{src => }/bench.rs (100%) rename src/librustpkg/testsuite/pass/src/install-paths/{src => }/lib.rs (100%) rename src/librustpkg/testsuite/pass/src/install-paths/{src => }/main.rs (100%) rename src/librustpkg/testsuite/pass/src/install-paths/{src => }/test.rs (100%) diff --git a/src/librustpkg/testsuite/pass/src/fancy-lib/src/bar.rs b/src/librustpkg/testsuite/pass/src/fancy-lib/bar.rs similarity index 100% rename from src/librustpkg/testsuite/pass/src/fancy-lib/src/bar.rs rename to src/librustpkg/testsuite/pass/src/fancy-lib/bar.rs diff --git a/src/librustpkg/testsuite/pass/src/fancy-lib/src/fancy-lib.rs b/src/librustpkg/testsuite/pass/src/fancy-lib/fancy-lib.rs similarity index 92% rename from src/librustpkg/testsuite/pass/src/fancy-lib/src/fancy-lib.rs rename to src/librustpkg/testsuite/pass/src/fancy-lib/fancy-lib.rs index 55261a820981..dc068eed143e 100644 --- a/src/librustpkg/testsuite/pass/src/fancy-lib/src/fancy-lib.rs +++ b/src/librustpkg/testsuite/pass/src/fancy-lib/fancy-lib.rs @@ -21,4 +21,4 @@ extern mod std; pub mod foo; pub mod bar; -#[path = "build/generated.rs"] pub mod generated; +#[path = "../../build/fancy_lib/generated.rs"] pub mod generated; diff --git a/src/librustpkg/testsuite/pass/src/fancy-lib/src/foo.rs b/src/librustpkg/testsuite/pass/src/fancy-lib/foo.rs similarity index 100% rename from src/librustpkg/testsuite/pass/src/fancy-lib/src/foo.rs rename to src/librustpkg/testsuite/pass/src/fancy-lib/foo.rs diff --git a/src/librustpkg/testsuite/pass/src/fancy-lib/pkg.rs b/src/librustpkg/testsuite/pass/src/fancy-lib/pkg.rs index be3c68d731b2..eeaa0f68ed53 100644 --- a/src/librustpkg/testsuite/pass/src/fancy-lib/pkg.rs +++ b/src/librustpkg/testsuite/pass/src/fancy-lib/pkg.rs @@ -11,13 +11,18 @@ use core::run; pub fn main() { - let cwd = os::getcwd(); - debug!("cwd = %s", cwd.to_str()); - let file = io::file_writer(&Path(~"fancy-lib/build/generated.rs"), + use core::libc::consts::os::posix88::{S_IRUSR, S_IWUSR, S_IXUSR}; + + let out_path = Path(~"build/fancy_lib"); + if !os::path_exists(&out_path) { + assert!(os::make_dir(&out_path, (S_IRUSR | S_IWUSR | S_IXUSR) as i32)); + } + + let file = io::file_writer(&out_path.push("generated.rs"), [io::Create]).get(); file.write_str("pub fn wheeeee() { for [1, 2, 3].each() |_| { assert!(true); } }"); // now compile the crate itself - run::run_program("rustc", ~[~"fancy-lib/fancy-lib.rs", ~"--lib", - ~"-o", ~"fancy-lib/build/fancy_lib"]); + run::run_program("rustc", ~[~"src/fancy-lib/fancy-lib.rs", ~"--lib", + ~"-o", out_path.push(~"fancy_lib").to_str()]); } \ No newline at end of file diff --git a/src/librustpkg/testsuite/pass/src/hello-world/src/main.rs b/src/librustpkg/testsuite/pass/src/hello-world/main.rs similarity index 100% rename from src/librustpkg/testsuite/pass/src/hello-world/src/main.rs rename to src/librustpkg/testsuite/pass/src/hello-world/main.rs diff --git a/src/librustpkg/testsuite/pass/src/install-paths/src/bench.rs b/src/librustpkg/testsuite/pass/src/install-paths/bench.rs similarity index 100% rename from src/librustpkg/testsuite/pass/src/install-paths/src/bench.rs rename to src/librustpkg/testsuite/pass/src/install-paths/bench.rs diff --git a/src/librustpkg/testsuite/pass/src/install-paths/src/lib.rs b/src/librustpkg/testsuite/pass/src/install-paths/lib.rs similarity index 100% rename from src/librustpkg/testsuite/pass/src/install-paths/src/lib.rs rename to src/librustpkg/testsuite/pass/src/install-paths/lib.rs diff --git a/src/librustpkg/testsuite/pass/src/install-paths/src/main.rs b/src/librustpkg/testsuite/pass/src/install-paths/main.rs similarity index 100% rename from src/librustpkg/testsuite/pass/src/install-paths/src/main.rs rename to src/librustpkg/testsuite/pass/src/install-paths/main.rs diff --git a/src/librustpkg/testsuite/pass/src/install-paths/src/test.rs b/src/librustpkg/testsuite/pass/src/install-paths/test.rs similarity index 100% rename from src/librustpkg/testsuite/pass/src/install-paths/src/test.rs rename to src/librustpkg/testsuite/pass/src/install-paths/test.rs