aboutsummaryrefslogtreecommitdiffstats
path: root/test/tools/isoltest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/tools/isoltest.cpp')
-rw-r--r--test/tools/isoltest.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/tools/isoltest.cpp b/test/tools/isoltest.cpp
index 41dff148..ed4f148e 100644
--- a/test/tools/isoltest.cpp
+++ b/test/tools/isoltest.cpp
@@ -29,6 +29,10 @@
#include <fstream>
#include <queue>
+#if defined(_WIN32)
+#include <windows.h>
+#endif
+
using namespace dev;
using namespace dev::solidity;
using namespace dev::solidity::test;
@@ -242,8 +246,30 @@ TestStats TestTool::processPath(
}
+void setupTerminal()
+{
+#if defined(_WIN32) && defined(ENABLE_VIRTUAL_TERMINAL_PROCESSING)
+ // Set output mode to handle virtual terminal (ANSI escape sequences)
+ // ignore any error, as this is just a "nice-to-have"
+ // only windows needs to be taken care of, as other platforms (Linux/OSX) support them natively.
+ HANDLE hOut = GetStdHandle(STD_OUTPUT_HANDLE);
+ if (hOut == INVALID_HANDLE_VALUE)
+ return;
+
+ DWORD dwMode = 0;
+ if (!GetConsoleMode(hOut, &dwMode))
+ return;
+
+ dwMode |= ENABLE_VIRTUAL_TERMINAL_PROCESSING;
+ if (!SetConsoleMode(hOut, dwMode))
+ return;
+#endif
+}
+
int main(int argc, char *argv[])
{
+ setupTerminal();
+
if (getenv("EDITOR"))
TestTool::editor = getenv("EDITOR");
else if (fs::exists("/usr/bin/editor"))