summaryrefslogtreecommitdiffstats
path: root/src/build_test.cc
diff options
context:
space:
mode:
authorEvan Martin <martine@danga.com>2012-08-07 20:58:55 (GMT)
committerEvan Martin <martine@danga.com>2012-08-07 21:03:00 (GMT)
commitcc222d3f6ba769fd800b1dfdb1699fbb84516c7b (patch)
tree99f395a2f120ffbdd1d1390c8e5d6205d346354f /src/build_test.cc
parent645165bca247558f94d5f47cf7795c463e81d83a (diff)
downloadNinja-cc222d3f6ba769fd800b1dfdb1699fbb84516c7b.zip
Ninja-cc222d3f6ba769fd800b1dfdb1699fbb84516c7b.tar.gz
Ninja-cc222d3f6ba769fd800b1dfdb1699fbb84516c7b.tar.bz2
use DiskInterface to create the build directory
Fixes issue #392 (didn't handle creating nested build dirs right). Moves MakeDir out of util.h; all code should go through DiskInterface to simplify testing. Moves ownership of the DiskInterface into the client of the Builder, which also allows removing some code that reached inside the object as well as a minor leak.
Diffstat (limited to 'src/build_test.cc')
-rw-r--r--src/build_test.cc8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/build_test.cc b/src/build_test.cc
index a3f345b..574ffb4 100644
--- a/src/build_test.cc
+++ b/src/build_test.cc
@@ -178,9 +178,8 @@ TEST_F(PlanTest, DependencyCycle) {
struct BuildTest : public StateTestWithBuiltinRules,
public CommandRunner {
- BuildTest() : config_(MakeConfig()), builder_(&state_, config_), now_(1),
- last_command_(NULL), status_(config_) {
- builder_.disk_interface_ = &fs_;
+ BuildTest() : config_(MakeConfig()), builder_(&state_, config_, &fs_),
+ now_(1), last_command_(NULL), status_(config_) {
builder_.command_runner_.reset(this);
AssertParse(&state_,
"build cat1: cat in1\n"
@@ -212,11 +211,10 @@ struct BuildTest : public StateTestWithBuiltinRules,
}
BuildConfig config_;
+ VirtualFileSystem fs_;
Builder builder_;
int now_;
- VirtualFileSystem fs_;
-
vector<string> commands_ran_;
Edge* last_command_;
BuildStatus status_;