From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2201) id B6E1C3858430; Fri, 14 Jul 2023 15:28:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B6E1C3858430 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1689348488; bh=Aa40AxUmfHgr4AxOA5totV+qC01GFGkc6wlO1ORo5xQ=; h=From:To:Subject:Date:From; b=TuyMUI0nU3fGi3vWk8b1QGJ420zAbTKaquX1Zaeri5+jyK0GixiH+UzeqgH/1QNgx 5lh+p2R3aQuLUukEJkYOyHgDFoxEmxw29o+9oDELdiUF6RTcij9tT2keA5WUwFKoR1 MlvwwbLZPTX+4kjnUBI1jjUiMLVIjsDVkF0mO680= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Jon Turney To: cygwin-cvs@sourceware.org Subject: [newlib-cygwin] Cygwin: testsuite: Skip devdsp test when no audio devices present X-Act-Checkin: newlib-cygwin X-Git-Author: Jon Turney X-Git-Refname: refs/heads/master X-Git-Oldrev: 04326f999b476d07b9c14f2a0ef2e4e9ac5b7e4c X-Git-Newrev: 97763573230368b38e6aadfa78cbd67f5871a1f4 Message-Id: <20230714152808.B6E1C3858430@sourceware.org> Date: Fri, 14 Jul 2023 15:28:08 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dnewlib-cygwin.git;h=3D97763573230= 368b38e6aadfa78cbd67f5871a1f4 commit 97763573230368b38e6aadfa78cbd67f5871a1f4 Author: Jon Turney Date: Sat Jul 8 12:50:58 2023 +0100 Cygwin: testsuite: Skip devdsp test when no audio devices present =20 Signed-off-by: Jon Turney Diff: --- winsup/testsuite/Makefile.am | 3 +++ winsup/testsuite/winsup.api/devdsp.c | 15 +++++++++++++++ 2 files changed, 18 insertions(+) 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 =3D -I$(srcdir)/libltp/include AM_LDFLAGS =3D $(LDFLAGS_FOR_TESTDLL) LDADD =3D $(builddir)/libltp.a $(builddir)/../cygwin/binmode.o $(LDADD_FOR= _TESTDLL) =20 +# additional flags for specific test executables +winsup_api_devdsp_LDADD =3D -lwinmm $(LDADD) + DEJATOOL =3D winsup =20 # Add '-v' to RUNTESTFLAGS if V=3D1 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 #include "test.h" /* use libltp framework */ =20 +#include + /* Controls if a child can open the device after the parent */ #define CHILD_EXPECT 0 /* 0 or 1 */ =20 @@ -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); =20 static int expect_child_failure =3D 0; =20 @@ -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; } =20 +/* skip test if we don't have any audio devices*/ +void +devcheck (void) +{ + if ((waveInGetNumDevs() =3D=3D 0) || (waveOutGetNumDevs() =3D=3D 0)) + { + tst_resm (TINFO, "Skipping, no audio devices present"); + exit(0); + } +} + /* test some extra ioctls */ void ioctltest (void)