diff options
author | Philip Craig <philip@pobox.com> | 2011-05-29 18:24:46 (GMT) |
---|---|---|
committer | Evan Martin <martine@danga.com> | 2011-06-02 22:54:20 (GMT) |
commit | 2048bb4ad953fada2c8f9a35c62bad86286d2c08 (patch) | |
tree | ef7dc64f9e4374d1e90c212cfbc686e44870c281 /src/build_test.cc | |
parent | 9f55f1c3a82543273739a6f57bd3965895dd892f (diff) | |
download | Ninja-2048bb4ad953fada2c8f9a35c62bad86286d2c08.zip Ninja-2048bb4ad953fada2c8f9a35c62bad86286d2c08.tar.gz Ninja-2048bb4ad953fada2c8f9a35c62bad86286d2c08.tar.bz2 |
On Windows, ninja didn't create needed paths first
Now it does. Still works as it should on linux too.
The canonical example that now works on Windows is:
builddir = build
rule copy
command = copy $in $out
build $builddir\fred\test.out: copy test.in
Diffstat (limited to 'src/build_test.cc')
-rwxr-xr-x[-rw-r--r--] | src/build_test.cc | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/build_test.cc b/src/build_test.cc index 5610d47..813521c 100644..100755 --- a/src/build_test.cc +++ b/src/build_test.cc @@ -390,17 +390,26 @@ TEST_F(BuildTest, MissingTarget) { TEST_F(BuildTest, MakeDirs) { string err; - ASSERT_NO_FATAL_FAILURE(AssertParse(&state_, -"build subdir/dir2/file: cat in1\n")); +#ifdef WIN32 + ASSERT_NO_FATAL_FAILURE(AssertParse(&state_, "build subdir\\dir2\\file: cat in1\n")); + EXPECT_TRUE(builder_.AddTarget("subdir\\dir2\\file", &err)); +#else + ASSERT_NO_FATAL_FAILURE(AssertParse(&state_, "build subdir/dir2/file: cat in1\n")); EXPECT_TRUE(builder_.AddTarget("subdir/dir2/file", &err)); +#endif + EXPECT_EQ("", err); now_ = 0; // Make all stat()s return file not found. EXPECT_TRUE(builder_.Build(&err)); ASSERT_EQ("", err); ASSERT_EQ(2u, fs_.directories_made_.size()); EXPECT_EQ("subdir", fs_.directories_made_[0]); +#ifdef WIN32 + EXPECT_EQ("subdir\\dir2", fs_.directories_made_[1]); +#else EXPECT_EQ("subdir/dir2", fs_.directories_made_[1]); +#endif } TEST_F(BuildTest, DepFileMissing) { |