~ubuntu-branches/ubuntu/saucy/ecasound2.2/saucy

« back to all changes in this revision

Viewing changes to manual-tests/misc-test-apps/run_tests.py

  • Committer: Bazaar Package Importer
  • Author(s): Junichi Uekawa
  • Date: 2009-11-02 18:22:35 UTC
  • mfrom: (5.1.2 sid)
  • Revision ID: james.westby@ubuntu.com-20091102182235-4ngh7699dmkgonyu
Tags: 2.7.0-1
* New upstream release.
* Depend on libreadline-dev instead of libreadline5-dev by request of
  Mattias Klose. It's now libreadline6-dev. (closes: #553748)
* Update menu file to use section Applications/ instead of Apps/.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/env python
 
2
 
 
3
# -----------------------------------------------------------------------
 
4
# Runs all misc-test-apps test cases
 
5
#
 
6
# Copyright (C) 2009 Kai Vehmanen
 
7
# Licensed under GPL. See the file 'COPYING' for more information.
 
8
# -----------------------------------------------------------------------
 
9
 
 
10
import sys
 
11
import os
 
12
import string
 
13
 
 
14
def check_for_test_data_files(filenamestr):
 
15
    try:
 
16
        file = open(filenamestr)
 
17
        file.close()
 
18
    except IOError:
 
19
        print "Test data file '" + filenamestr + "' not found; can't run tests. See 'README.txt'."
 
20
        sys.exit(1)
 
21
 
 
22
def run_tests():
 
23
    check_for_test_data_files("foo.wav")
 
24
    check_for_test_data_files("ecatestlist.txt")
 
25
    check_for_test_data_files("ecasound_test")
 
26
    
 
27
    file = open("ecatestlist.txt")
 
28
    lines = file.readlines()
 
29
    file.close()
 
30
 
 
31
    failed = 0
 
32
    for line in lines:
 
33
        if line[0] == "#":
 
34
            continue
 
35
        testcases = string.split(line)
 
36
        for testcase in testcases:
 
37
            print "Running test " + testcase + ":"
 
38
            res = os.system("./" + testcase)
 
39
            print ""
 
40
            if res:
 
41
                failed = 1
 
42
    return failed
 
43
 
 
44
# main
 
45
sys.exit(run_tests())
 
46