summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2009-09-27 18:15:49 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2009-09-27 18:15:49 +0200
commitc5e49023abc9d4d1a348588aa7ce743f6af0cf41 (patch)
treed1228216b4f8db1dcbb3d38e664d30a2dd666cea /tests
parentb3ab9d53c47ad5f7c35ac12b2577c589cf4e0d20 (diff)
Pass file name as path
Diffstat (limited to 'tests')
-rw-r--r--tests/parser/driver.cxx12
1 files changed, 10 insertions, 2 deletions
diff --git a/tests/parser/driver.cxx b/tests/parser/driver.cxx
index ea7b003..c351d5b 100644
--- a/tests/parser/driver.cxx
+++ b/tests/parser/driver.cxx
@@ -22,12 +22,20 @@ int main (int argc, char* argv[])
try
{
+ semantics::path path (argv[1]);
+
ifstream ifs;
ifs.exceptions (ifstream::failbit | ifstream::badbit);
- ifs.open (argv[1]);
+ ifs.open (path.string ().c_str ());
parser p;
- p.parse (ifs, argv[1]);
+ p.parse (ifs, path);
+ }
+ catch (semantics::invalid_path const& e)
+ {
+ cerr << "error: '" << e.path () << "' is not a valid filesystem path"
+ << endl;
+ return 1;
}
catch (parser::invalid_input const&)
{