def test_reading_results_from_dir(self): dir_path = self.ExampleDataDir() results = perfcompare.ResultsFromDir(dir_path) test_name = 'fuchsia.example: ClockGetTimeExample' self.assertEquals( results[test_name].FormatConfidenceInterval(), '991 +/- 26 ns')
def test_reading_results_from_multi_boot_dir(self): dir_path = self.MakeTempDir() subdir = os.path.join(dir_path, 'by_boot', 'boot000000') os.makedirs(subdir) self.WriteExampleDataDir(subdir) results = perfcompare.ResultsFromDir(dir_path) self.assertEquals( results['ClockGetTimeExample'].FormatConfidenceInterval(), '991 +/- 26')
def test_reading_results_from_tar_file(self): dir_path = self.ExampleDataDir() # Test the uncompressed and gzipped cases. for write_mode in ('w', 'w:gz'): # Create a tar file containing the example results files. tar_filename = os.path.join(self.MakeTempDir(), 'out.tar') with tarfile.open(tar_filename, write_mode) as tar: for name in os.listdir(dir_path): tar.add(os.path.join(dir_path, name), arcname=name) results = perfcompare.ResultsFromDir(tar_filename) self.assertEquals( results['ClockGetTimeExample'].FormatConfidenceInterval(), '991 +/- 26')
def test_reading_results_from_dir(self): dir_path = self.ExampleDataDir() results = perfcompare.ResultsFromDir(dir_path) self.assertEquals( results['ClockGetTimeExample'].FormatConfidenceInterval(), '991 +/- 26')
def CheckConfidenceInterval(self, data, interval_string): dir_path = self.DirOfData(data) test_name = 'example_suite: ExampleTest' stats = perfcompare.ResultsFromDir(dir_path)[test_name] self.assertEquals(stats.FormatConfidenceInterval(), interval_string)