Make test runner better.

Probably screws up windows.
Fixes #30.
This commit is contained in:
Ryan Dahl 2011-04-28 14:10:03 -04:00
parent 9b92e13721
commit 8c6c48595a
3 changed files with 6 additions and 4 deletions

View File

@ -34,7 +34,7 @@
static void log_progress(int total, int passed, int failed, char* name) {
LOGF("[%% %3d|+ %3d|- %3d]: %-50s\n", (passed + failed) / total * 100,
LOGF("[%% %3d|+ %3d|- %3d]: %s", (passed + failed) / total * 100,
passed, failed, name);
}
@ -68,8 +68,8 @@ int main(int argc, char **argv) {
continue;
}
log_progress(total, passed, failed, task->task_name);
rewind_cursor();
log_progress(total, passed, failed, task->task_name);
if (run_task(task, TEST_TIMEOUT, 0)) {
passed++;
@ -77,6 +77,8 @@ int main(int argc, char **argv) {
failed++;
}
}
rewind_cursor();
log_progress(total, passed, failed, "Done.");
return 0;

View File

@ -299,6 +299,6 @@ void process_cleanup(process_info_t *p) {
/* Move the console cursor one line up and back to the first column. */
int rewind_cursor() {
printf("\033[0A\r");
printf("\033[2K\r");
return 0;
}

View File

@ -117,7 +117,7 @@ finalize:
/* Show error and output from processes if the test failed. */
if (!success) {
LOG("=============================================================\n");
LOG("\n=============================================================\n");
LOGF("`%s` failed: %s\n", test->task_name, errmsg);
for (i = 0; i < process_count; i++) {