Currently executing test now shows before completion.

The text used to appear after the check completed, along with the status. Now the text shows when the test starts executing, and the status appears when the check completes. This provides better UX for long-running tests.
This commit is contained in:
Graham Sutherland
2018-05-28 20:47:38 +01:00
parent 4b71d41bdf
commit bbf020b39b
4 changed files with 17 additions and 8 deletions
+15 -3
View File
@@ -50,7 +50,7 @@ VOID print_category(TCHAR* text)
SetConsoleTextAttribute(nStdHandle, OriginalColors);
}
VOID print_results(int result, TCHAR* szMsg)
VOID _print_check_text(TCHAR* szMsg)
{
_tprintf(TEXT("[*] %s"), szMsg);
@@ -60,7 +60,10 @@ VOID print_results(int result, TCHAR* szMsg)
_tprintf(TEXT(" "));
spaces_to_padd--;
}
}
VOID _print_check_result(int result, TCHAR* szMsg)
{
if (result == TRUE)
print_detected();
else
@@ -72,14 +75,23 @@ VOID print_results(int result, TCHAR* szMsg)
LOG_PRINT(buffer);
}
VOID print_results(int result, TCHAR* szMsg)
{
_print_check_text(szMsg);
_print_check_result(result, szMsg);
}
VOID exec_check(int(*callback)(), TCHAR* szMsg)
{
/* Print the text to screen so we can see what's currently running */
_print_check_text(szMsg);
/* Call our check */
int result = callback();
/* Print / Log the result */
if (szMsg)
print_results(result, szMsg);
_print_check_result(result, szMsg);
}
VOID resize_console_window()
+2 -5
View File
@@ -14,8 +14,5 @@ TCHAR* ascii_to_wide_str(CHAR* lpMultiByteStr);
CHAR* wide_str_to_multibyte(TCHAR* lpWideStr);
VOID resize_console_window();
VOID print_results(int result, TCHAR* szMsg);
VOID _print_check_text(TCHAR* szMsg);
VOID _print_check_result(int result, TCHAR* szMsg);
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.