-
Notifications
You must be signed in to change notification settings - Fork 248
/
Copy pathtest_CoSimulationApplication_mpi.py
54 lines (41 loc) · 2.24 KB
/
test_CoSimulationApplication_mpi.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# Importing the Kratos Library
import KratosMultiphysics as KM
if not KM.IsDistributedRun():
raise Exception("This test script can only be executed in MPI!")
# Import Kratos "wrapper" for unittests
import KratosMultiphysics.KratosUnittest as KratosUnittest
# Import tests
from test_convergence_criteria import TestConvergenceCriteriaWrapper
from test_convergence_accelerators import TestConvergenceAcceleratorWrapper
from test_processes import TestCreatePointBasedEntitiesProcess
from co_simulation_test_factory import TestCoSimulationCases
def AssembleTestSuites():
''' Populates the test suites to run.
Populates the test suites to run. At least, it should populate the suites:
"mpi_small", "mpi_nighlty" and "mpi_all"
Return
------
suites: A dictionary of suites
The set of suites with its test_cases added.
'''
suites = KratosUnittest.KratosSuites
################################################################################
smallSuite = suites['mpi_small'] # These tests are executed by the continuous integration tool
smallSuite.addTests(KratosUnittest.TestLoader().loadTestsFromTestCases([TestConvergenceCriteriaWrapper]))
smallSuite.addTests(KratosUnittest.TestLoader().loadTestsFromTestCases([TestConvergenceAcceleratorWrapper]))
smallSuite.addTests(KratosUnittest.TestLoader().loadTestsFromTestCases([TestCreatePointBasedEntitiesProcess]))
################################################################################
nightSuite = suites['mpi_nightly'] # These tests are executed in the nightly build
nightSuite.addTests(smallSuite)
################################################################################
# For very long tests that should not be in nighly and you can use to validate
validationSuite = suites['mpi_validation']
validationSuite.addTest(TestCoSimulationCases('test_sdof_fsi'))
################################################################################
# Create a test suit that contains all the tests:
allSuite = suites['mpi_all']
allSuite.addTests(nightSuite) # already contains the smallSuite
allSuite.addTests(validationSuite)
return suites
if __name__ == '__main__':
KratosUnittest.runTests(AssembleTestSuites())