From 9f72d1959fe9b7a3469495c19ee30114488230a9 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Fri, 22 Apr 2011 13:20:49 +0200 Subject: [PATCH] winetest: Cowardly refuse to submit results that have too many failed tests. --- programs/winetest/main.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/programs/winetest/main.c b/programs/winetest/main.c index 3316b4401e8..376b542d80f 100644 --- a/programs/winetest/main.c +++ b/programs/winetest/main.c @@ -40,6 +40,9 @@ /* Don't submit the results if more than SKIP_LIMIT tests have been skipped */ #define SKIP_LIMIT 10 +/* Don't submit the results if more than FAILURES_LIMIT tests have failed */ +#define FAILURES_LIMIT 50 + struct wine_test { char *name; @@ -62,6 +65,7 @@ static const char whitespace[] = " \t\r\n"; static const char testexe[] = "_test.exe"; static char build_id[64]; static BOOL is_wow64; +static int failures; /* filters for running only specific tests */ static char *filters[64]; @@ -705,6 +709,7 @@ run_test (struct wine_test* test, const char* subtest, HANDLE out_file, const ch status = run_ex (cmd, out_file, tempdir, 120000); heap_free (cmd); xprintf ("%s:%s done (%d)\n", test->name, subtest, status); + if (status) failures++; } } @@ -1316,7 +1321,13 @@ int main( int argc, char *argv[] ) DeleteFileA(logname); exit (0); } - if (build_id[0] && nr_of_skips <= SKIP_LIMIT && !nr_native_dlls && !is_win9x && + if (failures > FAILURES_LIMIT) + report( R_WARNING, + "%d tests failed, there's probably something broken with your setup.\n" + "You need to address this before submitting results.", failures ); + + if (build_id[0] && nr_of_skips <= SKIP_LIMIT && failures <= FAILURES_LIMIT && + !nr_native_dlls && !is_win9x && report (R_ASK, MB_YESNO, "Do you want to submit the test results?") == IDYES) if (!send_file (logname) && !DeleteFileA(logname)) report (R_WARNING, "Can't remove logfile: %u", GetLastError());