All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Ser <simon.ser@intel.com>
To: igt-dev@lists.freedesktop.org
Subject: [igt-dev] [PATCH i-g-t v4 8/9] tests/kms_chamelium: don't abort audio test on first fail
Date: Wed, 15 May 2019 10:29:21 +0300	[thread overview]
Message-ID: <20190515072922.30768-9-simon.ser@intel.com> (raw)
In-Reply-To: <20190515072922.30768-1-simon.ser@intel.com>

The audio test is repeated with a few different frequencies. When the test
fails for one frequency, continue testing other frequencies so that we get a
better understanding of the situation: is only one frequency failing, or are
all of them failing?

Signed-off-by: Simon Ser <simon.ser@intel.com>
Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
---
 tests/kms_chamelium.c | 38 +++++++++++++++++++++++---------------
 1 file changed, 23 insertions(+), 15 deletions(-)

diff --git a/tests/kms_chamelium.c b/tests/kms_chamelium.c
index 51f335efb94b..c1dbd99d0e76 100644
--- a/tests/kms_chamelium.c
+++ b/tests/kms_chamelium.c
@@ -841,15 +841,6 @@ do_test_display_audio(data_t *data, struct chamelium_port *port,
 	struct audio_state state = {};
 	int channel_mapping[8], capture_chan;
 
-	if (!alsa_test_output_configuration(alsa, playback_channels,
-					    playback_rate)) {
-		igt_debug("Skipping test with sample rate %d Hz and %d channels "
-			  "because at least one of the selected output devices "
-			  "doesn't support this configuration\n",
-			  playback_rate, playback_channels);
-		return false;
-	}
-
 	igt_debug("Testing with playback sampling rate %d Hz and %d channels\n",
 		  playback_rate, playback_channels);
 	alsa_configure_output(alsa, playback_channels, playback_rate);
@@ -1028,15 +1019,14 @@ do_test_display_audio(data_t *data, struct chamelium_port *port,
 	audio_signal_fini(signal);
 	chamelium_stream_deinit(stream);
 
-	igt_assert(success);
-	return true;
+	return success;
 }
 
 static void
 test_display_audio(data_t *data, struct chamelium_port *port,
 		   const char *audio_device, enum test_edid edid)
 {
-	bool run = false;
+	bool run, success;
 	struct alsa *alsa;
 	int ret;
 	igt_output_t *output;
@@ -1045,6 +1035,7 @@ test_display_audio(data_t *data, struct chamelium_port *port,
 	drmModeModeInfo *mode;
 	drmModeConnector *connector;
 	int fb_id, i;
+	int channels, sampling_rate;
 
 	igt_require(alsa_has_exclusive_access());
 
@@ -1077,20 +1068,37 @@ test_display_audio(data_t *data, struct chamelium_port *port,
 
 	enable_output(data, port, output, mode, &fb);
 
+	run = false;
+	success = true;
 	for (i = 0; i < test_sampling_rates_count; i++) {
 		ret = alsa_open_output(alsa, audio_device);
 		igt_assert(ret >= 0);
 
 		/* TODO: playback on all 8 available channels */
-		run |= do_test_display_audio(data, port, alsa,
-					     PLAYBACK_CHANNELS,
-					     test_sampling_rates[i]);
+		channels = PLAYBACK_CHANNELS;
+		sampling_rate = test_sampling_rates[i];
+
+		if (!alsa_test_output_configuration(alsa, channels,
+						    sampling_rate)) {
+			igt_debug("Skipping test with sample rate %d Hz and %d channels "
+				  "because at least one of the selected output devices "
+				  "doesn't support this configuration\n",
+				  channels, sampling_rate);
+			continue;
+		}
+
+		run = true;
+
+		success &= do_test_display_audio(data, port, alsa, channels,
+						 sampling_rate);
 
 		alsa_close_output(alsa);
 	}
 
 	/* Make sure we tested at least one frequency. */
 	igt_assert(run);
+	/* Make sure all runs were successful. */
+	igt_assert(success);
 
 	igt_remove_fb(data->drm_fd, &fb);
 
-- 
2.21.0

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

  parent reply	other threads:[~2019-05-15  7:29 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-15  7:29 [igt-dev] [PATCH i-g-t v4 0/9] tests/kms_chamelium: add HDMI audio test Simon Ser
2019-05-15  7:29 ` [igt-dev] [PATCH i-g-t v4 1/9] tests/kms_chamelium: skip if GetAudioFormat is not supported Simon Ser
2019-05-16  7:27   ` [igt-dev] [PATCH i-g-t v5] " Simon Ser
2019-05-16  8:30     ` Arkadiusz Hiler
2019-05-15  7:29 ` [igt-dev] [PATCH i-g-t v4 2/9] lib/igt_edid: add support for Short Audio Descriptors Simon Ser
2019-05-15  7:29 ` [igt-dev] [PATCH i-g-t v4 3/9] lib/igt_edid: add support for Vendor Specific Data blocks Simon Ser
2019-05-15  7:29 ` [igt-dev] [PATCH i-g-t v4 4/9] lib/igt_chamelium: add CHAMELIUM_DEFAULT_EDID Simon Ser
2019-05-15  7:29 ` [igt-dev] [PATCH i-g-t v4 5/9] tests/kms_chamelium: generate an EDID with audio support Simon Ser
2019-05-15  7:29 ` [igt-dev] [PATCH i-g-t v4 6/9] tests/kms_chamelium: disable >48KHz audio tests Simon Ser
2019-05-15  7:29 ` [igt-dev] [PATCH i-g-t v4 7/9] tests/kms_chamelium: enable audio test on HDMI ports Simon Ser
2019-05-15  7:29 ` Simon Ser [this message]
2019-05-15  7:29 ` [igt-dev] [PATCH i-g-t v4 9/9] HAX: add {dp, hdmi}-audio test to fast-feedback Simon Ser
2019-05-15  8:25 ` [igt-dev] ✗ Fi.CI.BAT: failure for tests/kms_chamelium: add HDMI audio test (rev2) Patchwork
2019-05-15  8:36   ` Ser, Simon
2019-05-15 13:30     ` Arkadiusz Hiler
2019-05-16  9:44     ` Petri Latvala
2019-05-15 16:37 ` [igt-dev] ✓ Fi.CI.IGT: success " Patchwork
2019-05-16  7:58 ` [igt-dev] ✓ Fi.CI.BAT: success for tests/kms_chamelium: add HDMI audio test (rev3) Patchwork
2019-05-16  9:52 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2019-05-16 10:19   ` Arkadiusz Hiler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190515072922.30768-9-simon.ser@intel.com \
    --to=simon.ser@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.