Example #1
0
        testrunner = TextTestRunner(stream=stream, verbosity=2)

    parinfo = []
    #for test in [UTSphereParallelSetup]:
    #    info = ['', test.__name__, test.__doc__.strip('\n'), '']
    #    testsuite = initialTestLoader.loadTestsFromTestCase(test)
    #    map(testrunner.stream.writeln, info)
    #    testresult = testrunner.run(testsuite)
    #    assert testresult.wasSuccessful(), 'Initial verification failed!'
    #    parinfo.extend(['    Parallelization options: %s' % tci._parinfo for \
    #                    tci in testsuite._tests if hasattr(tci, '_parinfo')])
    #parinfo = np.unique(np.sort(parinfo)).tolist()

    testcases = [UTSphereParallelSetup]
    #for dtype in [float, complex]:
    #    for parstride_bands in [False, True]:
    #        for blocking in ['fast', 'best']: # 'light'
    #            for async in [False, True]:
    #                testcases.append(UTConstantWavefunctionFactory(dtype, \
    #                    parstride_bands, blocking, async))

    for test in testcases:
        info = ['', test.__name__, test.__doc__.strip('\n')] + parinfo + ['']
        testsuite = defaultTestLoader.loadTestsFromTestCase(test)
        map(testrunner.stream.writeln, info)
        testresult = testrunner.run(testsuite)
        # Provide feedback on failed tests if imported by test.py
        if __name__ == '__builtin__' and not testresult.wasSuccessful():
            raise SystemExit('Test failed. Check ut_csh.log for details.')

Example #2
0
    parinfo = []
    # Initial Verification only tests case : dtype = float
    for test in [UTBandParallelSetup_Blocked, UTBandParallelSetup_Strided]:
        info = ['', test.__name__, test.__doc__.strip('\n'), '']
        testsuite = initialTestLoader.loadTestsFromTestCase(test)
        map(testrunner.stream.writeln, info)
        testresult = testrunner.run(testsuite)
        assert testresult.wasSuccessful(), 'Initial verification failed!'
        parinfo.extend(['    Parallelization options: %s' % tci._parinfo for \
                        tci in testsuite._tests if hasattr(tci, '_parinfo')])
    parinfo = np.unique(np.sort(parinfo)).tolist()

    testcases = []
    for dtype in [float, complex]:
        for parstride_bands in [False, True]:
            for blocking in [
                    'fast', 'light', 'intdiv', 'nonintdiv1', 'nonintdiv2'
            ]:
                for async in [False, True]:
                    testcases.append(UTConstantWavefunctionFactory(dtype, \
                        parstride_bands, blocking, async))

    for test in testcases:
        info = ['', test.__name__, test.__doc__.strip('\n')] + parinfo + ['']
        testsuite = defaultTestLoader.loadTestsFromTestCase(test)
        map(testrunner.stream.writeln, info)
        testresult = testrunner.run(testsuite)
        # Provide feedback on failed tests if imported by test.py
        if __name__ == '__builtin__' and not testresult.wasSuccessful():
            raise SystemExit('Test failed. Check ut_hsops.log for details.')