From b0524a0b18eec9d5e5c3f6ce30b6cecdd02a6306 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 20 Jan 2015 17:18:09 +0200 Subject: Diagnostic infrastructure revamp --- tests/build/lexer/buildfile | 2 +- tests/build/lexer/driver.cxx | 9 +++++---- tests/build/parser/buildfile | 2 +- tests/build/parser/driver.cxx | 10 +++++----- 4 files changed, 12 insertions(+), 11 deletions(-) (limited to 'tests/build') 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 (""); } diff --git a/tests/build/parser/buildfile b/tests/build/parser/buildfile index 2672a02..c924dcb 100644 --- a/tests/build/parser/buildfile +++ b/tests/build/parser/buildfile @@ -1,2 +1,2 @@ exe{driver}: cxx{driver ../../../build/{lexer parser scope target native \ - prerequisite context diagnostics trace utility path timestamp}} + prerequisite context diagnostics utility path timestamp}} diff --git a/tests/build/parser/driver.cxx b/tests/build/parser/driver.cxx index 8e4a60b..681db38 100644 --- a/tests/build/parser/driver.cxx +++ b/tests/build/parser/driver.cxx @@ -23,6 +23,9 @@ parse (const char*); int main () { + ostream cnull (nullptr); + diag_stream = &cnull; + target_types.insert (file::static_type); target_types.insert (exe::static_type); target_types.insert (obj::static_type); @@ -78,22 +81,19 @@ main () assert (!parse ("test/ foo/:\n{\n}")); } -ostream cnull (nullptr); - static bool parse (const char* s) { istringstream is (s); is.exceptions (istream::failbit | istream::badbit); - parser p (cnull); - //parser p (cerr); + parser p; try { p.parse (is, path (), scopes[path::current ()]); } - catch (const parser_error&) + catch (const failed&) { return false; } -- cgit v1.1