mirror of
https://github.com/encounter/SDL.git
synced 2025-12-19 01:46:22 +00:00
test: Add a mode to skip tests that involve arbitrary delays
This can be used as a quick acceptance test for CI workflows. Signed-off-by: Simon McVittie <smcv@collabora.com>
This commit is contained in:
committed by
Sam Lantinga
parent
7d2808e30b
commit
40bef98f8b
@@ -19,6 +19,7 @@ static int total_channels;
|
||||
static int active_channel;
|
||||
|
||||
#define SAMPLE_RATE_HZ 48000
|
||||
#define QUICK_TEST_TIME_MSEC 100
|
||||
#define CHANNEL_TEST_TIME_SEC 5
|
||||
#define MAX_AMPLITUDE SDL_MAX_SINT16
|
||||
|
||||
@@ -188,7 +189,11 @@ main(int argc, char *argv[])
|
||||
SDL_Log("Playing %d Hz test tone on channel: %s\n", sine_freq, get_channel_name(j, total_channels));
|
||||
|
||||
/* fill_buffer() will increment the active channel */
|
||||
SDL_Delay(CHANNEL_TEST_TIME_SEC * 1000);
|
||||
if (SDL_getenv("SDL_TESTS_QUICK") != NULL) {
|
||||
SDL_Delay(QUICK_TEST_TIME_MSEC);
|
||||
} else {
|
||||
SDL_Delay(CHANNEL_TEST_TIME_SEC * 1000);
|
||||
}
|
||||
}
|
||||
|
||||
SDL_CloseAudioDevice(dev);
|
||||
|
||||
Reference in New Issue
Block a user