def test_write_results_to_disk(self, mock_platform, no_results_instantiation_check): config = Config("krun/tests/example.krun") mock_platform.num_cpus = 4 mock_platform.num_per_core_measurements = mock_platform.num_cpus out_file = "krun/tests/example_results.json.bz2" results0 = Results(config, mock_platform) results0.audit = dict() results0.starting_temperatures = [4355, 9879] results0.wallclock_times = {u"dummy:Java:default-java": [[1.000726]]} results0.eta_estimates = {u"dummy:Java:default-java": [1.1]} results0.core_cycle_counts = { u"dummy:Java:default-java": [[[2], [3], [4], [5]]] } results0.aperf_counts = { u"dummy:Java:default-java": [[[3], [4], [5], [6]]] } results0.mperf_counts = { u"dummy:Java:default-java": [[[4], [5], [6], [7]]] } results0.pexec_flags = { u"dummy:Java:default-java": [[["C"], ["C"], ["C"], ["C"]]] } results0.reboots = 5 results0.error_flag = False results0.write_to_file() results1 = Results(config, None, results_file=out_file) assert results0 == results1 # Clean-up generated file. os.unlink(out_file)
def fake_results(mock_platform, no_results_instantiation_check): results = Results(None, mock_platform) mock_platform.num_cpus = 2 mock_platform.num_per_core_measurements = 2 results.eta_estimates = {"bench:vm:variant": [1., 1.]} results.wallclock_times = {"bench:vm:variant": [[2., 2.], [2., 2.]]} results.core_cycle_counts = { "bench:vm:variant": [[[3., 3.], [ 3., 3., ]], [[3., 3.], [3., 3.]]] } results.aperf_counts = { "bench:vm:variant": [[[4., 4.], [ 4., 4., ]], [[4., 4.], [4., 4.]]] } results.mperf_counts = { "bench:vm:variant": [[[5., 5.], [ 5., 5., ]], [[5., 5.], [5., 5.]]] } results.pexec_flags = {"bench:vm:variant": ["C", "T"]} return results