def test_cache_size_shrinking(self): stat4 = CCacheStats(self.STAT4) stat5 = CCacheStats(self.STAT5) stats_diff = stat5 - stat4 self.assertTrue(stat4) self.assertTrue(stat5) self.assertTrue(stats_diff)
def test_stats_version33(self): stat3 = CCacheStats(self.STAT3) stat6 = CCacheStats(self.STAT6) stats_diff = stat6 - stat3 self.assertTrue(stat6) self.assertTrue(stat3) self.assertTrue(stats_diff)
def test_stats_version33(self): # Test stats for 3.3.2. stat3 = CCacheStats(self.STAT3) stat6 = CCacheStats(self.STAT6) stats_diff = stat6 - stat3 self.assertTrue(stat6) self.assertTrue(stat3) self.assertTrue(stats_diff) # Test stats for 3.3.3. stat7 = CCacheStats(self.STAT7) self.assertTrue(stat7)
def test_stats_contains_data(self): stats0 = CCacheStats(self.STAT0) stats1 = CCacheStats(self.STAT1) stats2 = CCacheStats(self.STAT2) stats_diff_zero = stats1 - stats1 stats_diff_negative1 = stats0 - stats1 stats_diff_negative2 = stats1 - stats2 self.assertFalse(stats0) self.assertTrue(stats1) self.assertTrue(stats2) self.assertFalse(stats_diff_zero) self.assertFalse(stats_diff_negative1) self.assertFalse(stats_diff_negative2)
def test_hit_rate_of_diff_stats(self): stats1 = CCacheStats(self.STAT1) stats2 = CCacheStats(self.STAT2) stats_diff = stats2 - stats1 self.assertEqual(stats_diff.hit_rates(), (0.9, 0.05, 0.05))
def test_parse_zero_stats_message(self): stats = CCacheStats(self.STAT0) self.assertEqual(stats.cache_dir, "/home/tlin/.ccache") self.assertEqual(stats.hit_rates(), (0, 0, 0))
def test_stats_version32(self): stat2 = CCacheStats(self.STAT2) stat3 = CCacheStats(self.STAT3) stats_diff = stat3 - stat2 self.assertTrue(stat3) self.assertTrue(stats_diff)
def test_stats_version34(self): # Test parsing 3.4 output. stat8 = CCacheStats(self.STAT8) self.assertTrue(stat8)
def test_stats_version35(self): # Test parsing 3.5 output. stat9 = CCacheStats(self.STAT9) self.assertTrue(stat9)