diff options
Diffstat (limited to 'tests/parser/driver.cxx')
-rw-r--r-- | tests/parser/driver.cxx | 12 |
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&) { |