Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Turney <jon.turney@dronecode.org.uk>2023-07-08 14:50:58 +0300
committerJon Turney <jon.turney@dronecode.org.uk>2023-07-14 16:02:41 +0300
commit97763573230368b38e6aadfa78cbd67f5871a1f4 (patch)
tree604fe051ec67660e490105ea87b45a9a700d1019 /winsup/testsuite
parent04326f999b476d07b9c14f2a0ef2e4e9ac5b7e4c (diff)
Cygwin: testsuite: Skip devdsp test when no audio devices present
Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Diffstat (limited to 'winsup/testsuite')
-rw-r--r--winsup/testsuite/Makefile.am3
-rw-r--r--winsup/testsuite/winsup.api/devdsp.c15
2 files changed, 18 insertions, 0 deletions
diff --git a/winsup/testsuite/Makefile.am b/winsup/testsuite/Makefile.am
index 11332eda2..60111a0aa 100644
--- a/winsup/testsuite/Makefile.am
+++ b/winsup/testsuite/Makefile.am
@@ -325,6 +325,9 @@ AM_CPPFLAGS = -I$(srcdir)/libltp/include
AM_LDFLAGS = $(LDFLAGS_FOR_TESTDLL)
LDADD = $(builddir)/libltp.a $(builddir)/../cygwin/binmode.o $(LDADD_FOR_TESTDLL)
+# additional flags for specific test executables
+winsup_api_devdsp_LDADD = -lwinmm $(LDADD)
+
DEJATOOL = winsup
# Add '-v' to RUNTESTFLAGS if V=1
diff --git a/winsup/testsuite/winsup.api/devdsp.c b/winsup/testsuite/winsup.api/devdsp.c
index 6c8850a74..0ac76f085 100644
--- a/winsup/testsuite/winsup.api/devdsp.c
+++ b/winsup/testsuite/winsup.api/devdsp.c
@@ -27,6 +27,8 @@ details. */
#include <errno.h>
#include "test.h" /* use libltp framework */
+#include <windows.h>
+
/* Controls if a child can open the device after the parent */
#define CHILD_EXPECT 0 /* 0 or 1 */
@@ -59,6 +61,7 @@ void playwavtest (void);
void syncwithchild (pid_t pid, int expected_exit_status);
void cleanup (void);
void dup_test (void);
+void devcheck (void);
static int expect_child_failure = 0;
@@ -77,6 +80,7 @@ int
main (int argc, char *argv[])
{
/* tst_brkm(TBROK, cleanup, "see if it breaks all right"); */
+ devcheck ();
ioctltest ();
playbacktest ();
recordingtest ();
@@ -91,6 +95,17 @@ main (int argc, char *argv[])
return 0;
}
+/* skip test if we don't have any audio devices*/
+void
+devcheck (void)
+{
+ if ((waveInGetNumDevs() == 0) || (waveOutGetNumDevs() == 0))
+ {
+ tst_resm (TINFO, "Skipping, no audio devices present");
+ exit(0);
+ }
+}
+
/* test some extra ioctls */
void
ioctltest (void)