aboutsummaryrefslogtreecommitdiff
path: root/tests/builtin/driver.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'tests/builtin/driver.cxx')
-rw-r--r--tests/builtin/driver.cxx37
1 files changed, 15 insertions, 22 deletions
diff --git a/tests/builtin/driver.cxx b/tests/builtin/driver.cxx
index 843631a..bdf3fa9 100644
--- a/tests/builtin/driver.cxx
+++ b/tests/builtin/driver.cxx
@@ -5,9 +5,6 @@
# include <libbutl/win32-utility.hxx>
#endif
-#include <cassert>
-
-#ifndef __cpp_lib_modules_ts
#include <string>
#include <vector>
#include <chrono>
@@ -18,31 +15,26 @@
#ifndef _WIN32
# include <thread> // this_thread::sleep_for()
#endif
-#endif
-// Other includes.
+#include <libbutl/path.hxx>
+#include <libbutl/utility.hxx> // eof()
+#include <libbutl/builtin.hxx>
+#include <libbutl/optional.hxx>
+#include <libbutl/timestamp.hxx> // to_stream(duration)
-#ifdef __cpp_modules_ts
-#ifdef __cpp_lib_modules_ts
-import std.core;
-import std.io;
-#endif
-import butl.path;
-import butl.utility; // eof()
-import butl.builtin;
-import butl.optional;
-import butl.timestamp; // to_stream(duration)
-#else
-#include <libbutl/path.mxx>
-#include <libbutl/utility.mxx>
-#include <libbutl/builtin.mxx>
-#include <libbutl/optional.mxx>
-#include <libbutl/timestamp.mxx>
-#endif
+#undef NDEBUG
+#include <cassert>
using namespace std;
using namespace butl;
+// Disable arguments globbing that may be enabled by default for MinGW runtime
+// (see tests/wildcard/driver.cxx for details).
+//
+#ifdef __MINGW32__
+int _CRT_glob = 0;
+#endif
+
inline ostream&
operator<< (ostream& os, const path& p)
{
@@ -90,6 +82,7 @@ main (int argc, char* argv[])
assert (!s.empty ());
char* e (nullptr);
+ errno = 0; // We must clear it according to POSIX.
uint64_t r (strtoull (s.c_str (), &e, 10)); // Can't throw.
assert (errno != ERANGE && e == s.c_str () + s.size ());
return r;