aboutsummaryrefslogtreecommitdiff
path: root/unit-tests/cc/lexer/driver.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'unit-tests/cc/lexer/driver.cxx')
-rw-r--r--unit-tests/cc/lexer/driver.cxx17
1 files changed, 5 insertions, 12 deletions
diff --git a/unit-tests/cc/lexer/driver.cxx b/unit-tests/cc/lexer/driver.cxx
index 5803a88..53910a6 100644
--- a/unit-tests/cc/lexer/driver.cxx
+++ b/unit-tests/cc/lexer/driver.cxx
@@ -11,6 +11,7 @@
#include <build2/cc/lexer.hxx>
using namespace std;
+using namespace butl;
namespace build2
{
@@ -39,24 +40,16 @@ namespace build2
try
{
- istream* is;
-
- // Reading from file is several times faster.
- //
- ifdstream ifs;
+ ifdstream is;
if (file != nullptr)
- {
- ifs.open (file);
- is = &ifs;
- }
+ is.open (file);
else
{
file = "stdin";
- cin.exceptions (istream::failbit | istream::badbit);
- is = &cin;
+ is.open (fddup (stdin_fd ()));
}
- lexer l (*is, path (file));
+ lexer l (is, path (file));
// No use printing eos since we will either get it or loop forever.
//