Esempio n. 1
0
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
"""
"""
Check whether there are any tests listed in the Failing test pack.

This is intended to be run as a script from the root of the Chaste
distribution.
"""

import glob
import sys

sys.path[0:0] = ['python/infra']
import BuildTools

failing_tests = BuildTools.set()
for test_dir in glob.glob('*/test') + glob.glob('projects/*/test'):
    failing_tests.update(BuildTools.GetTestsInTestPacks(test_dir, ['Failing']))

# Display results
if failing_tests:
    print "Failing tests found:"
    for test in sorted(failing_tests):
        print "   ", test
    print "The next line is for the benefit of the test summary scripts."
    print "Failed", len(failing_tests), "of", len(failing_tests), "tests"
else:
    print "Infrastructure test passed ok."
Esempio n. 2
0
    #print test_dir, test_file, test_ext, is_test
    return is_test


test_packs = set()  # Names of test packs found
orphans = set()  # Names of any orphaned test files
found_tests = set()  # Names of tests found in test packs
parallel_not_tested_continuous_too = []
test_dirs = glob.glob('*/test')
test_dirs.extend(map(lambda p: os.path.join(p, 'test'), projects_to_check))

# First get a list of all tests in all test packs
print "Test folders checked:"
for test_dir in sorted(test_dirs):
    print "   ", test_dir
    tf, pn = BuildTools.GetTestsInTestPacks(test_dir, returnFoundPacks=True)
    found_tests.update(tf)
    test_packs.update(pn)

    # Make a list of parallel and continuous tests
    parallel = BuildTools.GetTestsInTestPacks(test_dir, ['Parallel'])
    continuous = BuildTools.GetTestsInTestPacks(test_dir, ['Continuous'])

    # Check that parallel tests are a subset of continuous (coverage just runs continuous in parallel!)
    if not parallel.issubset(continuous):
        not_tested_continuous_too = parallel.difference(continuous)
        for particular_test in not_tested_continuous_too:
            parallel_not_tested_continuous_too.append(particular_test)

# Now check for orphaned tests in each top-level dir
local_found_tests = {}  # Names of tests found in test packs in each folder
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
"""

"""
Check whether there are any tests listed in the Failing test pack.

This is intended to be run as a script from the root of the Chaste
distribution.
"""

import glob
import sys

sys.path[0:0] = ['python/infra']
import BuildTools

failing_tests = BuildTools.set()
for test_dir in glob.glob('*/test') + glob.glob('projects/*/test'):
    failing_tests.update(BuildTools.GetTestsInTestPacks(test_dir, ['Failing']))

# Display results
if failing_tests:
    print "Failing tests found:"
    for test in sorted(failing_tests):
        print "   ", test
    print "The next line is for the benefit of the test summary scripts."
    print "Failed", len(failing_tests), "of", len(failing_tests), "tests"
else:
    print "Infrastructure test passed ok."
Esempio n. 4
0
    test_packs.update(pn)

# Now check for orphaned tests in each top-level dir
local_found_tests = {} # Names of tests found in test packs in each folder

for test_dir in test_dirs:
    local_found_tests[test_dir] = BuildTools.GetTestsInTestPacks(test_dir)
    #print test_dir, local_found_tests[test_dir]
    # Check for orphans in this folder
    for dirpath, dirnames, filenames in os.walk(test_dir):
        for dirname in dirnames[:]:
            if dirname in ['.svn', 'data']:
                dirnames.remove(dirname)
        for filename in filenames:
            filepath = os.path.join(dirpath, filename)
            filepath = BuildTools.relpath(filepath, test_dir)
            if IsTestFile(test_dir, filepath):
                if not filepath in local_found_tests[test_dir]:
                    orphans.add(os.path.join(test_dir, filepath))
                else:
                    local_found_tests[test_dir].remove(filepath)

# Output the names of test packs found
if test_packs:
    print "Test packs found:"
    for test_pack in test_packs:
        print "   ", test_pack
    print

# Compute a list of tests listed in test packs without .hpp files
not_found = []
Esempio n. 5
0
        fp.close()
    #print test_dir, test_file, test_ext, is_test
    return is_test


test_packs = set()  # Names of test packs found
orphans = set()  # Names of any orphaned test files
found_tests = set()  # Names of tests found in test packs
test_dirs = glob.glob('*/test')
test_dirs.extend(map(lambda p: os.path.join(p, 'test'), projects_to_check))

# First get a list of all tests in all test packs
print "Test folders checked:"
for test_dir in sorted(test_dirs):
    print "   ", test_dir
    tf, pn = BuildTools.GetTestsInTestPacks(test_dir, returnFoundPacks=True)
    found_tests.update(tf)
    test_packs.update(pn)

# Now check for orphaned tests in each top-level dir
local_found_tests = {}  # Names of tests found in test packs in each folder

for test_dir in test_dirs:
    local_found_tests[test_dir] = BuildTools.GetTestsInTestPacks(test_dir)
    #print test_dir, local_found_tests[test_dir]
    # Check for orphans in this folder
    for dirpath, dirnames, filenames in os.walk(test_dir):
        for dirname in dirnames[:]:
            if dirname in ['.svn', 'data']:
                dirnames.remove(dirname)
        for filename in filenames: