Create per-platform pdfium test suppression files.

This is required now that we have win/mac bots, which may produce
different outputs.

R=thestig@chromium.org

Review URL: https://codereview.chromium.org/1031203003
diff --git a/testing/SUPPRESSIONS b/testing/SUPPRESSIONS
index 1d417b2..4742483 100644
--- a/testing/SUPPRESSIONS
+++ b/testing/SUPPRESSIONS
@@ -1,48 +1,2 @@
-# List of tests to be skipped, one per line.
+# List of tests to be skipped, on all platforms, one per line.
 # Try to keep the file alphabetized.
-1_10_watermark.pdf
-1_1_textbox.pdf
-1_2_typewriter.pdf
-1_3_callout.pdf
-2_6_textbox.pdf
-3_4_textbox.pdf
-5.2.pdf
-action.pdf
-all_trigger_alert.pdf
-all_trigger_browsefordoc.pdf
-all_trigger_mailmsg.pdf
-all_trigger_newdoc.pdf
-all_trigger_print.pdf
-bookmark.pdf
-calcorderindex_test.pdf
-calculate_order.pdf
-ch_1.pdf
-check_box.pdf
-combo_box.pdf
-fillform.pdf
-form_action_trigger.pdf
-format_custom_format.pdf
-format_custom_keystroke.pdf
-form_button_sign_url.pdf
-form_combobox0.pdf
-form_combobox_actioin_goto.pdf
-form_combobox_date1.pdf
-form_combobox_importform.pdf
-form_combobox_resetform.pdf
-form_combo_sign_url.pdf
-formfeild.pdf
-form_list1.pdf
-form_list.pdf
-form_text_sign_url.pdf
-javascriptaction.pdf
-js_calculate.pdf
-list_box.pdf
-number.pdf
-push_button.pdf
-radio_button.pdf
-run_custom_validate_script.pdf
-signature_4.pdf
-signature.pdf
-test_app_beep.pdf
-test_control.pdf
-text_field.pdf
diff --git a/testing/SUPPRESSIONS_linux b/testing/SUPPRESSIONS_linux
new file mode 100644
index 0000000..7bc0fc1
--- /dev/null
+++ b/testing/SUPPRESSIONS_linux
@@ -0,0 +1,48 @@
+# List of tests to be skipped on linux platforms, one per line.
+# Try to keep the file alphabetized.
+1_10_watermark.pdf
+1_1_textbox.pdf
+1_2_typewriter.pdf
+1_3_callout.pdf
+2_6_textbox.pdf
+3_4_textbox.pdf
+5.2.pdf
+action.pdf
+all_trigger_alert.pdf
+all_trigger_browsefordoc.pdf
+all_trigger_mailmsg.pdf
+all_trigger_newdoc.pdf
+all_trigger_print.pdf
+bookmark.pdf
+calcorderindex_test.pdf
+calculate_order.pdf
+ch_1.pdf
+check_box.pdf
+combo_box.pdf
+fillform.pdf
+form_action_trigger.pdf
+format_custom_format.pdf
+format_custom_keystroke.pdf
+form_button_sign_url.pdf
+form_combobox0.pdf
+form_combobox_actioin_goto.pdf
+form_combobox_date1.pdf
+form_combobox_importform.pdf
+form_combobox_resetform.pdf
+form_combo_sign_url.pdf
+formfeild.pdf
+form_list1.pdf
+form_list.pdf
+form_text_sign_url.pdf
+javascriptaction.pdf
+js_calculate.pdf
+list_box.pdf
+number.pdf
+push_button.pdf
+radio_button.pdf
+run_custom_validate_script.pdf
+signature_4.pdf
+signature.pdf
+test_app_beep.pdf
+test_control.pdf
+text_field.pdf
diff --git a/testing/SUPPRESSIONS_mac b/testing/SUPPRESSIONS_mac
new file mode 100644
index 0000000..b0ffc7d
--- /dev/null
+++ b/testing/SUPPRESSIONS_mac
@@ -0,0 +1,2 @@
+# List of tests to be skipped on mac platforms, one per line.
+# Try to keep the file alphabetized.
diff --git a/testing/SUPPRESSIONS_win b/testing/SUPPRESSIONS_win
new file mode 100644
index 0000000..b5aa351
--- /dev/null
+++ b/testing/SUPPRESSIONS_win
@@ -0,0 +1,2 @@
+# List of tests to be skipped on windows platforms, one per line.
+# Try to keep the file alphabetized.
diff --git a/testing/tools/run_corpus_tests.py b/testing/tools/run_corpus_tests.py
index 05be76e..2f5c413 100755
--- a/testing/tools/run_corpus_tests.py
+++ b/testing/tools/run_corpus_tests.py
@@ -15,6 +15,12 @@
 #   x_path - "path/to/a/b/c/x.ext"
 #   c_dir - "path/to/a/b/c"
 
+def extract_suppressions(filename):
+  with open(filename) as f:
+    suppressions = [y for y in [
+      x.split('#')[0].strip() for x in f.readlines()] if y]
+  return suppressions
+
 def test_one_file(input_filename, source_dir, working_dir,
                   pdfium_test_path, pdfium_diff_path):
   input_root, _ = os.path.splitext(input_filename)
@@ -45,6 +51,16 @@
   return True
 
 def main():
+  if sys.platform.startswith('linux'):
+    os_name = 'linux'
+  elif sys.platform.startswith('win'):
+    os_name = 'win'
+  elif sys.platform.startswith('darwin'):
+    os_name = 'mac'
+  else:
+    print 'Confused, can not determine OS, aborting.'
+    return 1
+
   parser = optparse.OptionParser()
   parser.add_option('--build-dir', default=os.path.join('out', 'Debug'),
                     help='relative path from the base source directory')
@@ -76,7 +92,7 @@
   # Compiled binaries are found under the build path.
   pdfium_test_path = os.path.join(build_dir, 'pdfium_test')
   pdfium_diff_path = os.path.join(build_dir, 'pdfium_diff')
-  if sys.platform.startswith('win'):
+  if os_name == 'win':
     pdfium_test_path = pdfium_test_path + '.exe'
     pdfium_diff_path = pdfium_diff_path + '.exe'
   # TODO(tsepez): Mac may require special handling here.
@@ -86,9 +102,12 @@
   if not os.path.exists(working_dir):
     os.makedirs(working_dir)
 
-  with open(os.path.join(testing_dir, 'SUPPRESSIONS')) as f:
-    suppression_list = [y for y in [
-      x.split('#')[0].strip() for x in f.readlines()] if y]
+  suppression_list = extract_suppressions(
+    os.path.join(testing_dir, 'SUPPRESSIONS'))
+
+  platform_suppression_filename = 'SUPPRESSIONS_%s' % os_name
+  platform_suppression_list = extract_suppressions(
+    os.path.join(testing_dir, platform_suppression_filename))
 
   # test files are under .../pdfium/testing/corpus.
   failures = []
@@ -102,6 +121,11 @@
            if input_filename in suppression_list:
              print "Not running %s, found in SUPPRESSIONS file" % input_filename
              continue
+           if input_filename in platform_suppression_list:
+             print ("Not running %s, found in %s file" %
+                    (input_filename, platform_suppression_filename))
+             continue
+
          if not test_one_file(input_filename, source_dir, working_dir,
                                 pdfium_test_path, pdfium_diff_path):
              failures.append(input_path)