OLD | NEW |
1 # Copyright (C) 2010 Google Inc. All rights reserved. | 1 # Copyright (C) 2010 Google Inc. All rights reserved. |
2 # Copyright (C) 2010 Gabor Rapcsanyi (rgabor@inf.u-szeged.hu), University of Sze
ged | 2 # Copyright (C) 2010 Gabor Rapcsanyi (rgabor@inf.u-szeged.hu), University of Sze
ged |
3 # Copyright (C) 2011 Apple Inc. All rights reserved. | 3 # Copyright (C) 2011 Apple Inc. All rights reserved. |
4 # | 4 # |
5 # Redistribution and use in source and binary forms, with or without | 5 # Redistribution and use in source and binary forms, with or without |
6 # modification, are permitted provided that the following conditions are | 6 # modification, are permitted provided that the following conditions are |
7 # met: | 7 # met: |
8 # | 8 # |
9 # * Redistributions of source code must retain the above copyright | 9 # * Redistributions of source code must retain the above copyright |
10 # notice, this list of conditions and the following disclaimer. | 10 # notice, this list of conditions and the following disclaimer. |
(...skipping 897 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
908 | 908 |
909 def test_reset_results(self): | 909 def test_reset_results(self): |
910 # Test that we update expectations in place. If the expectation | 910 # Test that we update expectations in place. If the expectation |
911 # is missing, update the expected generic location. | 911 # is missing, update the expected generic location. |
912 host = MockHost() | 912 host = MockHost() |
913 details, err, _ = logging_run( | 913 details, err, _ = logging_run( |
914 ['--pixel-tests', '--reset-results', 'passes/image.html', 'failures/
expected/missing_image.html'], | 914 ['--pixel-tests', '--reset-results', 'passes/image.html', 'failures/
expected/missing_image.html'], |
915 tests_included=True, host=host, new_results=True) | 915 tests_included=True, host=host, new_results=True) |
916 file_list = host.filesystem.written_files.keys() | 916 file_list = host.filesystem.written_files.keys() |
917 self.assertEqual(details.exit_code, 0) | 917 self.assertEqual(details.exit_code, 0) |
918 self.assertEqual(len(file_list), 8) | 918 self.assertEqual(len(file_list), 7) |
919 self.assertBaselines(file_list, "passes/image", [".txt", ".png"], err) | 919 self.assertBaselines(file_list, "passes/image", [".txt", ".png"], err) |
920 self.assertBaselines(file_list, "failures/expected/missing_image", [".tx
t", ".png"], err) | 920 self.assertBaselines(file_list, "failures/expected/missing_image", [".tx
t", ".png"], err) |
921 | 921 |
922 def test_missing_results(self): | 922 def test_missing_results(self): |
923 # Test that we update expectations in place. If the expectation | 923 # Test that we update expectations in place. If the expectation |
924 # is missing, update the expected generic location. | 924 # is missing, update the expected generic location. |
925 host = MockHost() | 925 host = MockHost() |
926 details, err, _ = logging_run(['--no-show-results', | 926 details, err, _ = logging_run(['--no-show-results', |
927 'failures/unexpected/missing_text.html', | 927 'failures/unexpected/missing_text.html', |
928 'failures/unexpected/missing_image.html', | 928 'failures/unexpected/missing_image.html', |
929 'failures/unexpected/missing_audio.html', | 929 'failures/unexpected/missing_audio.html', |
930 'failures/unexpected/missing_render_tree_dump.html'], | 930 'failures/unexpected/missing_render_tree_dump.html'], |
931 tests_included=True, host=host, new_results=True) | 931 tests_included=True, host=host, new_results=True) |
932 file_list = host.filesystem.written_files.keys() | 932 file_list = host.filesystem.written_files.keys() |
933 self.assertEqual(details.exit_code, 0) | 933 self.assertEqual(details.exit_code, 0) |
934 self.assertEqual(len(file_list), 10) | 934 self.assertEqual(len(file_list), 9) |
935 self.assertBaselines(file_list, "failures/unexpected/missing_text", [".t
xt"], err) | 935 self.assertBaselines(file_list, "failures/unexpected/missing_text", [".t
xt"], err) |
936 self.assertBaselines(file_list, "platform/test/failures/unexpected/missi
ng_image", [".png"], err) | 936 self.assertBaselines(file_list, "platform/test/failures/unexpected/missi
ng_image", [".png"], err) |
937 self.assertBaselines(file_list, "platform/test/failures/unexpected/missi
ng_render_tree_dump", [".txt"], err) | 937 self.assertBaselines(file_list, "platform/test/failures/unexpected/missi
ng_render_tree_dump", [".txt"], err) |
938 | 938 |
939 def test_new_baseline(self): | 939 def test_new_baseline(self): |
940 # Test that we update the platform expectations in the version-specific
directories | 940 # Test that we update the platform expectations in the version-specific
directories |
941 # for both existing and new baselines. | 941 # for both existing and new baselines. |
942 host = MockHost() | 942 host = MockHost() |
943 details, err, _ = logging_run( | 943 details, err, _ = logging_run( |
944 ['--pixel-tests', '--new-baseline', 'passes/image.html', 'failures/e
xpected/missing_image.html'], | 944 ['--pixel-tests', '--new-baseline', 'passes/image.html', 'failures/e
xpected/missing_image.html'], |
945 tests_included=True, host=host, new_results=True) | 945 tests_included=True, host=host, new_results=True) |
946 file_list = host.filesystem.written_files.keys() | 946 file_list = host.filesystem.written_files.keys() |
947 self.assertEqual(details.exit_code, 0) | 947 self.assertEqual(details.exit_code, 0) |
948 self.assertEqual(len(file_list), 8) | 948 self.assertEqual(len(file_list), 7) |
949 self.assertBaselines(file_list, | 949 self.assertBaselines(file_list, |
950 "platform/test-mac-leopard/passes/image", [".txt", ".png"], err) | 950 "platform/test-mac-leopard/passes/image", [".txt", ".png"], err) |
951 self.assertBaselines(file_list, | 951 self.assertBaselines(file_list, |
952 "platform/test-mac-leopard/failures/expected/missing_image", [".txt"
, ".png"], err) | 952 "platform/test-mac-leopard/failures/expected/missing_image", [".txt"
, ".png"], err) |
953 | 953 |
954 | 954 |
955 class PortTest(unittest.TestCase): | 955 class PortTest(unittest.TestCase): |
956 def assert_mock_port_works(self, port_name, args=[]): | 956 def assert_mock_port_works(self, port_name, args=[]): |
957 self.assertTrue(passing_run(args + ['--platform', 'mock-' + port_name, '
fast/harness/results.html'], tests_included=True, host=Host())) | 957 self.assertTrue(passing_run(args + ['--platform', 'mock-' + port_name, '
fast/harness/results.html'], tests_included=True, host=Host())) |
958 | 958 |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
996 | 996 |
997 run_webkit_tests.run = successful_run | 997 run_webkit_tests.run = successful_run |
998 res = run_webkit_tests.main(['--platform', 'test'], stdout, stderr) | 998 res = run_webkit_tests.main(['--platform', 'test'], stdout, stderr) |
999 self.assertEqual(res, -1) | 999 self.assertEqual(res, -1) |
1000 | 1000 |
1001 run_webkit_tests.run = exception_raising_run | 1001 run_webkit_tests.run = exception_raising_run |
1002 res = run_webkit_tests.main([], stdout, stderr) | 1002 res = run_webkit_tests.main([], stdout, stderr) |
1003 self.assertEqual(res, run_webkit_tests.EXCEPTIONAL_EXIT_STATUS) | 1003 self.assertEqual(res, run_webkit_tests.EXCEPTIONAL_EXIT_STATUS) |
1004 finally: | 1004 finally: |
1005 run_webkit_tests.run = orig_run_fn | 1005 run_webkit_tests.run = orig_run_fn |
OLD | NEW |