winetest: Allow submitting the results if not too many tests have been skipped.

Currently the limit is set at 10 tests or subtests.
This commit is contained in:
Francois Gouget 2010-12-09 12:19:08 +01:00 committed by Alexandre Julliard
parent aa424f8159
commit d9dcafab91
1 changed files with 29 additions and 23 deletions

View File

@ -37,6 +37,9 @@
#include "winetest.h" #include "winetest.h"
#include "resource.h" #include "resource.h"
/* Don't submit the results if more than SKIP_LIMIT tests have been skipped */
#define SKIP_LIMIT 10
struct wine_test struct wine_test
{ {
char *name; char *name;
@ -53,7 +56,7 @@ char *url = NULL;
char *email = NULL; char *email = NULL;
BOOL aborting = FALSE; BOOL aborting = FALSE;
static struct wine_test *wine_tests; static struct wine_test *wine_tests;
static int nr_of_files, nr_of_tests; static int nr_of_files, nr_of_tests, nr_of_skips;
static int nr_native_dlls; static int nr_native_dlls;
static const char whitespace[] = " \t\r\n"; static const char whitespace[] = " \t\r\n";
static const char testexe[] = "_test.exe"; static const char testexe[] = "_test.exe";
@ -597,6 +600,7 @@ run_test (struct wine_test* test, const char* subtest, HANDLE out_file, const ch
{ {
report (R_STEP, "Skipping: %s:%s", test->name, subtest); report (R_STEP, "Skipping: %s:%s", test->name, subtest);
xprintf ("%s:%s skipped %s -\n", test->name, subtest, file); xprintf ("%s:%s skipped %s -\n", test->name, subtest, file);
nr_of_skips++;
} }
else else
{ {
@ -703,7 +707,11 @@ extract_test_proc (HMODULE hModule, LPCTSTR lpszType,
ULONG_PTR cookie; ULONG_PTR cookie;
if (aborting) return TRUE; if (aborting) return TRUE;
if (test_filtered_out( lpszName, NULL )) return TRUE; if (test_filtered_out( lpszName, NULL ))
{
nr_of_skips++;
return TRUE;
}
CharLowerA(lpszName); CharLowerA(lpszName);
extract_test (&wine_tests[nr_of_files], tempdir, lpszName); extract_test (&wine_tests[nr_of_files], tempdir, lpszName);
@ -902,6 +910,7 @@ run_tests (char *logname, char *outdir)
report (R_PROGRESS, 0, nr_of_files); report (R_PROGRESS, 0, nr_of_files);
nr_of_files = 0; nr_of_files = 0;
nr_of_tests = 0; nr_of_tests = 0;
nr_of_skips = 0;
if (!EnumResourceNames (NULL, "TESTRES", extract_test_proc, (LPARAM)tempdir)) if (!EnumResourceNames (NULL, "TESTRES", extract_test_proc, (LPARAM)tempdir))
report (R_FATAL, "Can't enumerate test files: %d", report (R_FATAL, "Can't enumerate test files: %d",
GetLastError ()); GetLastError ());
@ -1172,8 +1181,6 @@ int main( int argc, char *argv[] )
SetEnvironmentVariableA( "WINETEST_REPORT_SUCCESS", "0" ); SetEnvironmentVariableA( "WINETEST_REPORT_SUCCESS", "0" );
} }
if (!nb_filters) /* don't submit results when filtering */
{
while (!tag) { while (!tag) {
if (!interactive) if (!interactive)
report (R_FATAL, "Please specify a tag (-t option) if " report (R_FATAL, "Please specify a tag (-t option) if "
@ -1192,7 +1199,6 @@ int main( int argc, char *argv[] )
if (!build_id[0]) if (!build_id[0])
report( R_WARNING, "You won't be able to submit results without a valid build id.\n" report( R_WARNING, "You won't be able to submit results without a valid build id.\n"
"To submit results, winetest needs to be built from a git checkout." ); "To submit results, winetest needs to be built from a git checkout." );
}
if (!logname) { if (!logname) {
logname = run_tests (NULL, outdir); logname = run_tests (NULL, outdir);
@ -1200,7 +1206,7 @@ int main( int argc, char *argv[] )
DeleteFileA(logname); DeleteFileA(logname);
exit (0); exit (0);
} }
if (build_id[0] && !nb_filters && !nr_native_dlls && if (build_id[0] && nr_of_skips <= SKIP_LIMIT && !nr_native_dlls &&
report (R_ASK, MB_YESNO, "Do you want to submit the test results?") == IDYES) report (R_ASK, MB_YESNO, "Do you want to submit the test results?") == IDYES)
if (!send_file (logname) && !DeleteFileA(logname)) if (!send_file (logname) && !DeleteFileA(logname))
report (R_WARNING, "Can't remove logfile: %u", GetLastError()); report (R_WARNING, "Can't remove logfile: %u", GetLastError());