示例#1
0
    return suites


if __name__ == '__main__':
    KratosMultiphysics.Logger.GetDefaultOutput().SetSeverity(
        KratosMultiphysics.Logger.Severity.WARNING)
    KratosMultiphysics.Logger.PrintInfo("Unittests",
                                        "\nRunning cpp unit tests ...")
    KratosMultiphysics.Tester.SetVerbosity(
        KratosMultiphysics.Tester.Verbosity.PROGRESS)  # TESTS_OUTPUTS
    KratosMultiphysics.Tester.RunTestSuite("FluidDynamicsApplicationFastSuite")
    KratosMultiphysics.Logger.PrintInfo("Unittests",
                                        "Finished running cpp unit tests!")

    if kratos_utilities.IsMPIAvailable():
        KratosMultiphysics.Logger.PrintInfo("Unittests",
                                            "\nRunning mpi python tests ...")
        p = subprocess.Popen([
            "mpiexec", "-np", "2", "python3",
            "test_FluidDynamicsApplication_mpi.py"
        ],
                             stdout=subprocess.PIPE,
                             cwd=os.path.dirname(os.path.abspath(__file__)))
        p.wait()
        KratosMultiphysics.Logger.PrintInfo("Unittests",
                                            "Finished mpi python tests!")

    KratosMultiphysics.Logger.PrintInfo("Unittests",
                                        "\nRunning python tests ...")
    KratosUnittest.runTests(AssembleTestSuites())
示例#2
0
    # Create a test suit that contains all the tests:
    allSuite = suites['all']
    allSuite.addTests(nightSuite)  # Already contains the smallSuite
    validationSuite.addTests(allSuite)  # Validation contains all

    return suites


if __name__ == '__main__':
    KratosMultiphysics.Logger.PrintInfo("Unittests",
                                        "\nRunning cpp unit tests ...")
    run_cpp_unit_tests.run()
    KratosMultiphysics.Logger.PrintInfo("Unittests",
                                        "Finished running cpp unit tests!")

    if kratos_utilities.IsMPIAvailable(
    ) and kratos_utilities.CheckIfApplicationsAvailable(
            "MetisApplication", "TrilinosApplication"):
        KratosMultiphysics.Logger.PrintInfo("Unittests",
                                            "\nRunning mpi python tests ...")
        p = subprocess.Popen([
            "mpiexec", "-np", "2", "python3",
            "test_StructuralMechanicsApplication_mpi.py"
        ],
                             stdout=subprocess.PIPE,
                             cwd=os.path.dirname(os.path.abspath(__file__)))
        p.wait()
        KratosMultiphysics.Logger.PrintInfo("Unittests",
                                            "Finished mpi python tests!")
    else:
        KratosMultiphysics.Logger.PrintInfo(
            "Unittests",
    validationSuite.addTest(TShellQ4ThinOrthotropicLaminateLinearStaticTests('test_execution'))
    ### ---| OLD Shell Tests End

    # Create a test suit that contains all the tests:
    allSuite = suites['all']
    allSuite.addTests(nightSuite) # Already contains the smallSuite
    validationSuite.addTests(allSuite) # Validation contains all

    return suites


if __name__ == '__main__':
    KratosMultiphysics.Logger.PrintInfo("Unittests", "\nRunning cpp unit tests ...")
    run_cpp_unit_tests.run()
    KratosMultiphysics.Logger.PrintInfo("Unittests", "Finished running cpp unit tests!")

    if kratos_utilities.IsMPIAvailable() and kratos_utilities.CheckIfApplicationsAvailable("MetisApplication", "TrilinosApplication"):
        KratosMultiphysics.Logger.PrintInfo("Unittests", "\nRunning mpi python tests ...")
        p = subprocess.Popen(
            ["mpiexec", "-np", "2", "python3", "test_StructuralMechanicsApplication_mpi.py", "--using-mpi"],
            stdout=subprocess.PIPE,
            cwd=os.path.dirname(os.path.abspath(__file__)))
        p.wait()
        KratosMultiphysics.Logger.PrintInfo("Unittests", "Finished mpi python tests!")
    else:
        KratosMultiphysics.Logger.PrintInfo("Unittests", "\nSkipping mpi python tests due to missing dependencies")

    KratosMultiphysics.Logger.PrintInfo("Unittests", "\nRunning python tests ...")
    KratosUnittest.runTests(AssembleTestSuites())
    KratosMultiphysics.Logger.PrintInfo("Unittests", "Finished python tests!")