(self, section)
| 115 | self.Compare(section_element.tag+" file:"+section_file) |
| 116 | |
| 117 | def Compare(self, section): |
| 118 | # Rerun the script with the modified aircraft definition |
| 119 | self.sandbox.delete_csv_files() |
| 120 | fdm = CreateFDM(self.sandbox) |
| 121 | # We need to tell JSBSim that the aircraft definition is located in the |
| 122 | # directory build/.../aircraft |
| 123 | fdm.set_aircraft_path('aircraft') |
| 124 | fdm.set_output_directive(self.sandbox.path_to_jsbsim_file('tests', |
| 125 | 'output.xml')) |
| 126 | fdm.load_script(self.script) |
| 127 | fdm['simulation/randomseed'] = 0.0 |
| 128 | |
| 129 | fdm.run_ic() |
| 130 | ExecuteUntil(fdm, 50.0) |
| 131 | |
| 132 | mod = pd.read_csv('output.csv', index_col=0) |
| 133 | |
| 134 | # Check the data are matching i.e. the time steps are the same between |
| 135 | # the two data sets and that the output data are also the same. |
| 136 | self.assertTrue(isDataMatching(self.ref, mod)) |
| 137 | |
| 138 | # Whether the data is read from the aircraft definition file or from an |
| 139 | # external file, the results shall be exactly identical. Hence the |
| 140 | # precision set to 0.0. |
| 141 | diff = FindDifferences(self.ref, mod, 0.0) |
| 142 | self.assertEqual(len(diff), 0, |
| 143 | msg='\nTesting section "'+section+'"\n'+diff.to_string()) |
| 144 | |
| 145 | def test_model_loading(self): |
| 146 | self.longMessage = True |
no test coverage detected