aboutsummaryrefslogtreecommitdiff
path: root/tests/build/lexer
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-01-20 17:18:09 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-01-20 17:18:09 +0200
commitb0524a0b18eec9d5e5c3f6ce30b6cecdd02a6306 (patch)
tree4b1efc586782507e0647e884d6a13c6605298508 /tests/build/lexer
parent47751abc43dab40e0ac4a1523994fd533e6a3b22 (diff)
Diagnostic infrastructure revamp
Diffstat (limited to 'tests/build/lexer')
-rw-r--r--tests/build/lexer/buildfile2
-rw-r--r--tests/build/lexer/driver.cxx9
2 files changed, 6 insertions, 5 deletions
diff --git a/tests/build/lexer/buildfile b/tests/build/lexer/buildfile
index 2985343..415c64c 100644
--- a/tests/build/lexer/buildfile
+++ b/tests/build/lexer/buildfile
@@ -1 +1 @@
-exe{driver}: cxx{driver ../../../build/lexer}
+exe{driver}: cxx{driver ../../../build/{lexer diagnostics utility}}
diff --git a/tests/build/lexer/driver.cxx b/tests/build/lexer/driver.cxx
index 739fa26..5b29b7d 100644
--- a/tests/build/lexer/driver.cxx
+++ b/tests/build/lexer/driver.cxx
@@ -22,6 +22,9 @@ lex (const char*);
int
main ()
{
+ ostream cnull (nullptr);
+ diag_stream = &cnull;
+
// Whitespaces.
//
assert (lex ("") == tokens ({""}));
@@ -71,8 +74,6 @@ main ()
tokens ({"foo", ":", "\n", "bar", ""}));
}
-ostream cnull (nullptr);
-
static tokens
lex (const char* s)
{
@@ -80,7 +81,7 @@ lex (const char* s)
istringstream is (s);
is.exceptions (istream::failbit | istream::badbit);
- lexer l (is, "", cnull);
+ lexer l (is, "");
try
{
@@ -106,7 +107,7 @@ lex (const char* s)
break;
}
}
- catch (const lexer_error&)
+ catch (const failed&)
{
r.push_back ("<lexer error>");
}