From: Takashi Sakamoto Date: Sun, 9 Feb 2020 03:20:53 +0000 (+0900) Subject: timer: add test script for ALSATimer enumerations X-Git-Tag: v0.1.0~366 X-Git-Url: https://git.alsa-project.org/?a=commitdiff_plain;h=f66e8ad17c3f1d27c6c19be4538ec296161e181b;p=alsa-gobject.git timer: add test script for ALSATimer enumerations Signed-off-by: Takashi Sakamoto --- diff --git a/tests/alsatimer-enums b/tests/alsatimer-enums new file mode 100644 index 0000000..b5dd331 --- /dev/null +++ b/tests/alsatimer-enums @@ -0,0 +1,67 @@ +#!/usr/bin/env python3 + +from sys import exit +import gi +gi.require_version('ALSATimer', '0.0') +from gi.repository import ALSATimer + +class_types = ( + 'NONE', + 'GLOBAL', + 'CARD', + 'PCM', +) + +slave_class_types = ( + 'NONE', + 'APPLICATION', + 'SEQUENCER', +) + +specific_global_devices = ( + 'SYSTEM', + 'HRTIMER', +) + +device_info_flags = ( + 'SLAVE', +) + +instance_param_flags = ( + 'AUTO', + 'EXCLUSIVE', + 'EARLY_EVENT', +) + +event_types = ( + 'RESOLUTION', + 'TICK', + 'START', + 'STOP', + 'CONTINUE', + 'PAUSE', + 'EARLY', + 'SUSPEND', + 'RESUME', + 'MSTART', + 'MSTOP', + 'MCONTINUE', + 'MPAUSE', + 'MSUSPEND', + 'MRESUME', +) + +types = { + ALSATimer.Class: class_types, + ALSATimer.SlaveClass: slave_class_types, + ALSATimer.SpecificGlobalDevice: specific_global_devices, + ALSATimer.DeviceInfoFlag: device_info_flags, + ALSATimer.InstanceParamFlag: instance_param_flags, + ALSATimer.EventType: event_types, +} + +for obj, types in types.items(): + for t in types: + if not hasattr(obj, t): + print('Enumerator {0} is not produced.'.format(t)) + exit(1) diff --git a/tests/meson.build b/tests/meson.build index ac3518f..fb1e8b1 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -15,6 +15,9 @@ tests = { 'alsactl-elem-info-int64', 'alsactl-elem-value', ], + 'timer': [ + 'alsatimer-enums', + ], } foreach path, scripts: tests