| OLD | NEW |
| 1 # Copyright (C) 2010 Google Inc. All rights reserved. | 1 # Copyright (C) 2010 Google Inc. All rights reserved. |
| 2 # | 2 # |
| 3 # Redistribution and use in source and binary forms, with or without | 3 # Redistribution and use in source and binary forms, with or without |
| 4 # modification, are permitted provided that the following conditions are | 4 # modification, are permitted provided that the following conditions are |
| 5 # met: | 5 # met: |
| 6 # | 6 # |
| 7 # * Redistributions of source code must retain the above copyright | 7 # * Redistributions of source code must retain the above copyright |
| 8 # notice, this list of conditions and the following disclaimer. | 8 # notice, this list of conditions and the following disclaimer. |
| 9 # * Redistributions in binary form must reproduce the above | 9 # * Redistributions in binary form must reproduce the above |
| 10 # copyright notice, this list of conditions and the following disclaimer | 10 # copyright notice, this list of conditions and the following disclaimer |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 os_version = 'snowleopard' | 38 os_version = 'snowleopard' |
| 39 port_name = 'mac' | 39 port_name = 'mac' |
| 40 full_port_name = 'mac-snowleopard' | 40 full_port_name = 'mac-snowleopard' |
| 41 port_maker = mac.MacPort | 41 port_maker = mac.MacPort |
| 42 | 42 |
| 43 def assert_name(self, port_name, os_version_string, expected): | 43 def assert_name(self, port_name, os_version_string, expected): |
| 44 port = self.make_port(os_version=os_version_string, port_name=port_name) | 44 port = self.make_port(os_version=os_version_string, port_name=port_name) |
| 45 self.assertEqual(expected, port.name()) | 45 self.assertEqual(expected, port.name()) |
| 46 | 46 |
| 47 def test_versions(self): | 47 def test_versions(self): |
| 48 self.assertTrue(self.make_port().name() in ('mac-snowleopard', 'mac-lion
', 'mac-mountainlion', 'mac-mavericks')) | 48 self.assertTrue(self.make_port().name() in ('mac-snowleopard', 'mac-lion
', 'mac-mountainlion', 'mac-mavericks', 'mac-yosemite')) |
| 49 | 49 |
| 50 self.assert_name(None, 'snowleopard', 'mac-snowleopard') | 50 self.assert_name(None, 'snowleopard', 'mac-snowleopard') |
| 51 self.assert_name('mac', 'snowleopard', 'mac-snowleopard') | 51 self.assert_name('mac', 'snowleopard', 'mac-snowleopard') |
| 52 self.assert_name('mac-snowleopard', 'leopard', 'mac-snowleopard') | 52 self.assert_name('mac-snowleopard', 'leopard', 'mac-snowleopard') |
| 53 self.assert_name('mac-snowleopard', 'snowleopard', 'mac-snowleopard') | 53 self.assert_name('mac-snowleopard', 'snowleopard', 'mac-snowleopard') |
| 54 | 54 |
| 55 self.assert_name(None, 'lion', 'mac-lion') | 55 self.assert_name(None, 'lion', 'mac-lion') |
| 56 self.assert_name(None, 'mountainlion', 'mac-mountainlion') | 56 self.assert_name(None, 'mountainlion', 'mac-mountainlion') |
| 57 self.assert_name(None, 'mavericks', 'mac-mavericks') | 57 self.assert_name(None, 'mavericks', 'mac-mavericks') |
| 58 self.assert_name(None, 'future', 'mac-mavericks') | 58 self.assert_name(None, 'yosemite', 'mac-yosemite') |
| 59 self.assert_name(None, 'future', 'mac-yosemite') |
| 59 | 60 |
| 60 self.assert_name('mac', 'lion', 'mac-lion') | 61 self.assert_name('mac', 'lion', 'mac-lion') |
| 61 self.assertRaises(AssertionError, self.assert_name, None, 'tiger', 'shou
ld-raise-assertion-so-this-value-does-not-matter') | 62 self.assertRaises(AssertionError, self.assert_name, None, 'tiger', 'shou
ld-raise-assertion-so-this-value-does-not-matter') |
| 62 | 63 |
| 63 def test_baseline_path(self): | 64 def test_baseline_path(self): |
| 64 port = self.make_port(port_name='mac-snowleopard') | 65 port = self.make_port(port_name='mac-snowleopard') |
| 65 self.assertEqual(port.baseline_path(), port._webkit_baseline_path('mac-s
nowleopard')) | 66 self.assertEqual(port.baseline_path(), port._webkit_baseline_path('mac-s
nowleopard')) |
| 66 | 67 |
| 67 port = self.make_port(port_name='mac-lion') | 68 port = self.make_port(port_name='mac-lion') |
| 68 self.assertEqual(port.baseline_path(), port._webkit_baseline_path('mac-l
ion')) | 69 self.assertEqual(port.baseline_path(), port._webkit_baseline_path('mac-l
ion')) |
| 69 | 70 |
| 70 port = self.make_port(port_name='mac-mountainlion') | 71 port = self.make_port(port_name='mac-mountainlion') |
| 71 self.assertEqual(port.baseline_path(), port._webkit_baseline_path('mac-m
ountainlion')) | 72 self.assertEqual(port.baseline_path(), port._webkit_baseline_path('mac-m
ountainlion')) |
| 72 | 73 |
| 73 port = self.make_port(port_name='mac-mavericks') | 74 port = self.make_port(port_name='mac-mavericks') |
| 75 self.assertEqual(port.baseline_path(), port._webkit_baseline_path('mac-m
avericks')) |
| 76 |
| 77 port = self.make_port(port_name='mac-yosemite') |
| 74 self.assertEqual(port.baseline_path(), port._webkit_baseline_path('mac')
) | 78 self.assertEqual(port.baseline_path(), port._webkit_baseline_path('mac')
) |
| 75 | 79 |
| 76 def test_operating_system(self): | 80 def test_operating_system(self): |
| 77 self.assertEqual('mac', self.make_port().operating_system()) | 81 self.assertEqual('mac', self.make_port().operating_system()) |
| 78 | 82 |
| 79 def test_build_path(self): | 83 def test_build_path(self): |
| 80 # Test that optional paths are used regardless of whether they exist. | 84 # Test that optional paths are used regardless of whether they exist. |
| 81 options = MockOptions(configuration='Release', build_directory='/foo') | 85 options = MockOptions(configuration='Release', build_directory='/foo') |
| 82 self.assert_build_path(options, ['/mock-checkout/out/Release'], '/foo/Re
lease') | 86 self.assert_build_path(options, ['/mock-checkout/out/Release'], '/foo/Re
lease') |
| 83 | 87 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 100 # Check with 'xcodebuild' being newer. | 104 # Check with 'xcodebuild' being newer. |
| 101 port.host.filesystem.mtime = lambda f: 5 if '/xcodebuild/' in f else 4 | 105 port.host.filesystem.mtime = lambda f: 5 if '/xcodebuild/' in f else 4 |
| 102 self.assertEqual(port._build_path(), '/mock-checkout/xcodebuild/Release'
) | 106 self.assertEqual(port._build_path(), '/mock-checkout/xcodebuild/Release'
) |
| 103 | 107 |
| 104 def test_driver_name_option(self): | 108 def test_driver_name_option(self): |
| 105 self.assertTrue(self.make_port()._path_to_driver().endswith('Content She
ll')) | 109 self.assertTrue(self.make_port()._path_to_driver().endswith('Content She
ll')) |
| 106 self.assertTrue(self.make_port(options=MockOptions(driver_name='OtherDri
ver'))._path_to_driver().endswith('OtherDriver')) | 110 self.assertTrue(self.make_port(options=MockOptions(driver_name='OtherDri
ver'))._path_to_driver().endswith('OtherDriver')) |
| 107 | 111 |
| 108 def test_path_to_image_diff(self): | 112 def test_path_to_image_diff(self): |
| 109 self.assertEqual(self.make_port()._path_to_image_diff(), '/mock-checkout
/out/Release/image_diff') | 113 self.assertEqual(self.make_port()._path_to_image_diff(), '/mock-checkout
/out/Release/image_diff') |
| OLD | NEW |