aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Henningsson <david.henningsson@canonical.com>2014-09-04 14:21:07 +0200
committerTakashi Iwai <tiwai@suse.de>2014-09-04 14:52:22 +0200
commitfdcc1009e1ec772ec667de07ec63507108d24b34 (patch)
treef3a505f2921940c3ddc07e1697d185578990105a
parent8bcc9a0e89c85d180d8930fb9fbdf0c48e883227 (diff)
downloadhda-emu-fdcc1009e1ec772ec667de07ec63507108d24b34.tar.gz
hda-emu/tester: Test all codecs, not just one
This way we get a more complete test over the codecs. Signed-off-by: David Henningsson <david.henningsson@canonical.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rwxr-xr-xtester/summary.py62
1 files 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 <http://www.gnu.org/licenses/>.
+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)