Extended tests are only run when WINETEST_EXTENDED=1 is passed. This allows having some tests that take too long to be run in each MR pipeline, but are still valuable to run every now and then.
In this MR the feature is introduced and it is used for some mmdevapi tests.
From: Giovanni Mascellani gmascellani@codeweavers.com
Extended tests are only run when WINETEST_EXTENDED=1 is passed. This allows having some tests that take too long to be run in each MR pipeline, but are still valuable to run every now and then. --- include/wine/test.h | 7 +++++++ 1 file changed, 7 insertions(+)
diff --git a/include/wine/test.h b/include/wine/test.h index 0bc361ebf0c..7f1098d3ef5 100644 --- a/include/wine/test.h +++ b/include/wine/test.h @@ -61,6 +61,9 @@ extern int winetest_platform_is_wine; /* use ANSI escape codes for output coloring */ extern int winetest_color;
+/* run extended tests */ +extern int winetest_extended; + extern LONG winetest_successes; /* number of successful tests */ extern LONG winetest_failures; /* number of failures */ extern LONG winetest_flaky_failures; /* number of failures inside flaky block */ @@ -616,6 +619,9 @@ int winetest_mute_threshold = 42; /* use ANSI escape codes for output coloring */ int winetest_color = 0;
+/* run extended tests */ +int winetest_extended = 0; + static HANDLE winetest_mutex;
/* passing arguments around */ @@ -881,6 +887,7 @@ int main( int argc, char **argv ) if (GetEnvironmentVariableA( "WINETEST_REPORT_FLAKY", p, sizeof(p) )) winetest_report_flaky = atoi(p); if (GetEnvironmentVariableA( "WINETEST_REPORT_SUCCESS", p, sizeof(p) )) winetest_report_success = atoi(p); if (GetEnvironmentVariableA( "WINETEST_TIME", p, sizeof(p) )) winetest_time = atoi(p); + if (GetEnvironmentVariableA( "WINETEST_EXTENDED", p, sizeof(p) )) winetest_extended = atoi(p); winetest_last_time = winetest_start_time = winetest_get_time();
if (!strcmp( winetest_platform, "windows" )) SetUnhandledExceptionFilter( exc_filter );
From: Giovanni Mascellani gmascellani@codeweavers.com
And trim down the non-extended tests. --- dlls/mmdevapi/tests/render.c | 44 ++++++++++++++++++++++++++++++------ 1 file changed, 37 insertions(+), 7 deletions(-)
diff --git a/dlls/mmdevapi/tests/render.c b/dlls/mmdevapi/tests/render.c index 9ac82a65400..c7ecd34258c 100644 --- a/dlls/mmdevapi/tests/render.c +++ b/dlls/mmdevapi/tests/render.c @@ -41,10 +41,21 @@ #include "audiopolicy.h" #include "endpointvolume.h"
-static const unsigned int sampling_rates[] = { 8000, 16000, 22050, 44100, 48000, 96000 }; -static const unsigned int channel_counts[] = { 1, 2, 8 }; -static const unsigned int sample_formats[][2] = { {WAVE_FORMAT_PCM, 8}, {WAVE_FORMAT_PCM, 16}, - {WAVE_FORMAT_PCM, 32}, {WAVE_FORMAT_IEEE_FLOAT, 32} }; +static const unsigned int *sampling_rates; +static const unsigned int *channel_counts; +static const unsigned int (*sample_formats)[2]; +static size_t sampling_rate_count; +static size_t channel_count_count; +static size_t sample_format_count; + +static const unsigned int sampling_rates_regular[] = { 8000, 44100, 96000 }; +static const unsigned int channel_counts_regular[] = { 1, 2, 8 }; +static const unsigned int sample_formats_regular[][2] = { {WAVE_FORMAT_PCM, 16}, {WAVE_FORMAT_IEEE_FLOAT, 32} }; + +static const unsigned int sampling_rates_extended[] = { 8000, 11025, 16000, 22050, 44100, 48000, 96000 }; +static const unsigned int channel_counts_extended[] = { 1, 2, 4, 6, 8 }; +static const unsigned int sample_formats_extended[][2] = { {WAVE_FORMAT_PCM, 8}, {WAVE_FORMAT_PCM, 16}, + {WAVE_FORMAT_PCM, 32}, {WAVE_FORMAT_IEEE_FLOAT, 32} };
#define NULL_PTR_ERR MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, RPC_X_NULL_REF_POINTER)
@@ -518,9 +529,9 @@ static void test_formats(AUDCLNT_SHAREMODE mode, BOOL extensible)
fmt.Format.cbSize = extensible ? sizeof(WAVEFORMATEXTENSIBLE) - sizeof(WAVEFORMATEX) : 0;
- for (i = 0; i < ARRAY_SIZE(sampling_rates); i++) { - for (j = 0; j < ARRAY_SIZE(channel_counts); j++) { - for (k = 0; k < ARRAY_SIZE(sample_formats); k++) { + for (i = 0; i < sampling_rate_count; i++) { + for (j = 0; j < channel_count_count; j++) { + for (k = 0; k < sample_format_count; k++) { char format_chr[3];
hr = IMMDevice_Activate(dev, &IID_IAudioClient, CLSCTX_INPROC_SERVER, @@ -2832,6 +2843,25 @@ START_TEST(render) HRESULT hr; DWORD mode;
+ if (winetest_extended) + { + sampling_rates = sampling_rates_extended; + channel_counts = channel_counts_extended; + sample_formats = sample_formats_extended; + sampling_rate_count = ARRAY_SIZE(sampling_rates_extended); + channel_count_count = ARRAY_SIZE(channel_counts_extended); + sample_format_count = ARRAY_SIZE(sample_formats_extended); + } + else + { + sampling_rates = sampling_rates_regular; + channel_counts = channel_counts_regular; + sample_formats = sample_formats_regular; + sampling_rate_count = ARRAY_SIZE(sampling_rates_regular); + channel_count_count = ARRAY_SIZE(channel_counts_regular); + sample_format_count = ARRAY_SIZE(sample_formats_regular); + } + CoInitializeEx(NULL, COINIT_MULTITHREADED); hr = CoCreateInstance(&CLSID_MMDeviceEnumerator, NULL, CLSCTX_INPROC_SERVER, &IID_IMMDeviceEnumerator, (void**)&mme); if (FAILED(hr))
From: Giovanni Mascellani gmascellani@codeweavers.com
And trim down the non-extended tests. --- dlls/mmdevapi/tests/capture.c | 44 +++++++++++++++++++++++++++++------ 1 file changed, 37 insertions(+), 7 deletions(-)
diff --git a/dlls/mmdevapi/tests/capture.c b/dlls/mmdevapi/tests/capture.c index 918a6d0c2f6..357ebdbd7bc 100644 --- a/dlls/mmdevapi/tests/capture.c +++ b/dlls/mmdevapi/tests/capture.c @@ -37,10 +37,21 @@ #include "mmdeviceapi.h" #include "audioclient.h"
-static const unsigned int sampling_rates[] = { 8000, 16000, 22050, 44100, 48000, 96000 }; -static const unsigned int channel_counts[] = { 1, 2, 8 }; -static const unsigned int sample_formats[][2] = { {WAVE_FORMAT_PCM, 8}, {WAVE_FORMAT_PCM, 16}, - {WAVE_FORMAT_PCM, 32}, {WAVE_FORMAT_IEEE_FLOAT, 32} }; +static const unsigned int *sampling_rates; +static const unsigned int *channel_counts; +static const unsigned int (*sample_formats)[2]; +static size_t sampling_rate_count; +static size_t channel_count_count; +static size_t sample_format_count; + +static const unsigned int sampling_rates_regular[] = { 8000, 44100, 96000 }; +static const unsigned int channel_counts_regular[] = { 1, 2, 8 }; +static const unsigned int sample_formats_regular[][2] = { {WAVE_FORMAT_PCM, 16}, {WAVE_FORMAT_IEEE_FLOAT, 32} }; + +static const unsigned int sampling_rates_extended[] = { 8000, 11025, 16000, 22050, 44100, 48000, 96000 }; +static const unsigned int channel_counts_extended[] = { 1, 2, 4, 6, 8 }; +static const unsigned int sample_formats_extended[][2] = { {WAVE_FORMAT_PCM, 8}, {WAVE_FORMAT_PCM, 16}, + {WAVE_FORMAT_PCM, 32}, {WAVE_FORMAT_IEEE_FLOAT, 32} };
#define NULL_PTR_ERR MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, RPC_X_NULL_REF_POINTER)
@@ -570,9 +581,9 @@ static void test_formats(AUDCLNT_SHAREMODE mode, BOOL extensible)
fmt.Format.cbSize = extensible ? sizeof(WAVEFORMATEXTENSIBLE) - sizeof(WAVEFORMATEX) : 0;
- for (i = 0; i < ARRAY_SIZE(sampling_rates); i++) { - for (j = 0; j < ARRAY_SIZE(channel_counts); j++) { - for (k = 0; k < ARRAY_SIZE(sample_formats); k++) { + for (i = 0; i < sampling_rate_count; i++) { + for (j = 0; j < channel_count_count; j++) { + for (k = 0; k < sample_format_count; k++) { char format_chr[3];
hr = IMMDevice_Activate(dev, &IID_IAudioClient, CLSCTX_INPROC_SERVER, @@ -1245,6 +1256,25 @@ START_TEST(capture) { HRESULT hr;
+ if (winetest_extended) + { + sampling_rates = sampling_rates_extended; + channel_counts = channel_counts_extended; + sample_formats = sample_formats_extended; + sampling_rate_count = ARRAY_SIZE(sampling_rates_extended); + channel_count_count = ARRAY_SIZE(channel_counts_extended); + sample_format_count = ARRAY_SIZE(sample_formats_extended); + } + else + { + sampling_rates = sampling_rates_regular; + channel_counts = channel_counts_regular; + sample_formats = sample_formats_regular; + sampling_rate_count = ARRAY_SIZE(sampling_rates_regular); + channel_count_count = ARRAY_SIZE(channel_counts_regular); + sample_format_count = ARRAY_SIZE(sample_formats_regular); + } + CoInitializeEx(NULL, COINIT_MULTITHREADED); hr = CoCreateInstance(&CLSID_MMDeviceEnumerator, NULL, CLSCTX_INPROC_SERVER, &IID_IMMDeviceEnumerator, (void**)&mme); if (FAILED(hr))