From patchwork Thu Sep 4 12:21:07 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Henningsson X-Patchwork-Id: 4845711 X-Patchwork-Delegate: tiwai@suse.de Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 4F0FAC033A for ; Thu, 4 Sep 2014 13:30:23 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7783B2026D for ; Thu, 4 Sep 2014 13:30:17 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 4DADA2027D for ; Thu, 4 Sep 2014 13:30:15 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 6BD072657FB; Thu, 4 Sep 2014 15:30:14 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,NO_DNS_FOR_FROM, UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 2D40926582C; Thu, 4 Sep 2014 15:07:46 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id A94F026581B; Thu, 4 Sep 2014 15:07:41 +0200 (CEST) Received: from youngberry.canonical.com (youngberry.canonical.com [91.189.89.112]) by alsa0.perex.cz (Postfix) with ESMTP id CD91A2658A8 for ; Thu, 4 Sep 2014 14:21:07 +0200 (CEST) Received: from hd9483857.selulk5.dyn.perspektivbredband.net ([217.72.56.87] helo=localhost.localdomain) by youngberry.canonical.com with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1XPW2F-0001P1-HG; Thu, 04 Sep 2014 12:21:07 +0000 From: David Henningsson To: alsa-devel@alsa-project.org, tiwai@suse.de Date: Thu, 4 Sep 2014 14:21:07 +0200 Message-Id: <1409833267-9778-6-git-send-email-david.henningsson@canonical.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1409833267-9778-1-git-send-email-david.henningsson@canonical.com> References: <1409833267-9778-1-git-send-email-david.henningsson@canonical.com> Cc: David Henningsson Subject: [alsa-devel] [PATCH 5/5] hda-emu/tester: Test all codecs, not just one X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP This way we get a more complete test over the codecs. Signed-off-by: David Henningsson --- tester/summary.py | 62 +++++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 49 insertions(+), 13 deletions(-) diff --git a/tester/summary.py b/tester/summary.py index 0f9fbf3..640d1c1 100755 --- a/tester/summary.py +++ b/tester/summary.py @@ -18,15 +18,33 @@ # You should have received a copy of the GNU General Public License along # with this program. If not, see . +import runner + + def defaultpath(s): import os.path q = os.path.dirname(os.path.realpath(__file__)) return os.path.join(q, s) +def count_codecs(filename): + r = runner.HdaEmuRunner() + r.set_alsa_info_file(filename) + r.set_codec_index(99999) + r.start_process() + try: + r.run_command() + except runner.HdaEmuFatalError: + import re + m = re.compile("Codec index (\d+) requested, but found only (\d+) codecs") + for line in r.error_list: + match = m.search(line) + if match: + return int(match.group(2)) + return -1 + def main(): import os import os.path - import runner import argparse parser = argparse.ArgumentParser(description='Hda-emu automated test wrapper.') @@ -53,19 +71,37 @@ def main(): index += 1 if verbose > 2: print '[{0}/{1}]: Testing {2}'.format(index, len(files), f) + try: - r = runner.HdaEmuRunner() - r.set_alsa_info_file(os.path.join(directory, f)) - r.set_print_errors(verbose > 1) - r.run_standard() - if r.errors > 0 or r.warnings > 0: - fails += 1 - errors += r.errors - warnings += r.warnings - if verbose > 0: - print '{0} errors, {1} warnings. ({2})'.format(r.errors, r.warnings, f) - else: - successes += 1 + codecs = count_codecs(os.path.join(directory, f)) + + fail_this = False + skip_this = codecs < 0 + for codec_index in range(codecs): + r = runner.HdaEmuRunner() + r.set_alsa_info_file(os.path.join(directory, f)) + r.set_codec_index(codec_index) + r.set_print_errors(verbose > 1) + + try: + r.run_standard() + except runner.HdaEmuFatalError: + for line in r.error_list: + if line.find("is a modem codec, aborting"): + skip_this = True + + if (not skip_this) and (r.errors > 0 or r.warnings > 0): + fail_this = True + errors += r.errors + warnings += r.warnings + if verbose > 0: + print '{0} errors, {1} warnings for {2}, codec {3}/{4}.'.format(r.errors, r.warnings, f, codec_index+1, codecs) + + if not skip_this: + if fail_this: + fails += 1 + else: + successes += 1 except KeyboardInterrupt: import sys sys.exit(1)