summaryrefslogtreecommitdiff
path: root/tests/dumptest.cc
diff options
context:
space:
mode:
authorMarius Kintel <marius@kintel.net>2013-05-09 10:18:51 (GMT)
committerMarius Kintel <marius@kintel.net>2013-05-09 10:18:51 (GMT)
commitf46118da22f806d05b410cced0f9b06ea00ac02c (patch)
treee42fece860be6d224744ba5401bf35e783dddd62 /tests/dumptest.cc
parentf8ad66c8bbb3c78548c2e4b3b930f82d4a57b345 (diff)
parentad8ba77a15efd745fe7845e085b3daefd3f58e81 (diff)
Merge branch 'master' into issue352
Diffstat (limited to 'tests/dumptest.cc')
-rw-r--r--tests/dumptest.cc13
1 files changed, 6 insertions, 7 deletions
diff --git a/tests/dumptest.cc b/tests/dumptest.cc
index e4876fa..4477703 100644
--- a/tests/dumptest.cc
+++ b/tests/dumptest.cc
@@ -97,9 +97,10 @@ int main(int argc, char **argv)
exit(1);
}
- if (fs::path(filename).has_parent_path()) {
- fs::current_path(fs::path(filename).parent_path());
- }
+ fs::path fpath = boosty::absolute(fs::path(filename));
+ fs::path fparent = fpath.parent_path();
+ fs::current_path(fparent);
+ top_ctx.setDocumentPath(fparent.string());
AbstractNode::resetIndexCounter();
root_node = root_module->instantiate(&top_ctx, &root_inst);
@@ -130,7 +131,7 @@ int main(int argc, char **argv)
delete root_module;
fs::current_path(original_path);
- root_module = parsefile(outfilename);
+ root_module = parsefile(outfilename, fparent.string().c_str());
if (!root_module) {
fprintf(stderr, "Error: Unable to read back dumped file\n");
exit(1);
@@ -141,9 +142,7 @@ int main(int argc, char **argv)
tree.setRoot(root_node);
- if (fs::path(outfilename).has_parent_path()) {
- fs::current_path(fs::path(outfilename).parent_path());
- }
+ fs::current_path(fparent);
string readbackstr = dumptree(tree, *root_node);
if (dumpstdstr != readbackstr) {
contact: Jan Huwald // Impressum