]> git.alsa-project.org Git - alsa-gobject.git/commitdiff
timer: add test script for ALSATimer enumerations
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>
Sun, 9 Feb 2020 03:20:53 +0000 (12:20 +0900)
committer坂本 貴史 <o-takashi@sakamocchi.jp>
Tue, 11 Feb 2020 04:28:18 +0000 (13:28 +0900)
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
tests/alsatimer-enums [new file with mode: 0644]
tests/meson.build

diff --git a/tests/alsatimer-enums b/tests/alsatimer-enums
new file mode 100644 (file)
index 0000000..b5dd331
--- /dev/null
@@ -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)
index ac3518f896faa089bb4a8eef578064189b75375c..fb1e8b1146b16286f87698108e38b7972c3ef618 100644 (file)
@@ -15,6 +15,9 @@ tests = {
     'alsactl-elem-info-int64',
     'alsactl-elem-value',
   ],
+  'timer': [
+    'alsatimer-enums',
+  ],
 }
 
 foreach path, scripts: tests