Use golden files for runtime tests on Windows or Mac

This CL introduces a new way to circumvent the lack
of host runtime for these platform.
Dex files are emitted by a reference source i.e. a
Linux bot, and Windows or Mac bots will only compare
the dex files produced by R8/D8 against those produced
on linux to check they are the same, removing the need
to actually exectute them on any runtime.
The directory for golden files is passed to test.py via
--generate_golden_files_to/--generate_golden_files_to
options.

Change-Id: I52c98863409ed5959e1a4263b63826bc49bd6686
diff --git a/tools/upload_to_x20.py b/tools/upload_to_x20.py
index 1efacf5..2d08362 100755
--- a/tools/upload_to_x20.py
+++ b/tools/upload_to_x20.py
@@ -20,11 +20,10 @@
 def parse_options():
   return optparse.OptionParser().parse_args()
 
-def create_archive(name):
-  tarname = '%s.tar.gz' % name
-  with tarfile.open(tarname, 'w:gz') as tar:
-    tar.add(name)
-  return tarname
+def uploadFile(filename, dest):
+  print 'Uploading to %s' % dest
+  shutil.copyfile(filename, dest)
+  subprocess.check_call(['chmod', '664', dest])
 
 def Main():
   (options, args) = parse_options()
@@ -34,12 +33,10 @@
   if not name in os.listdir('.'):
     print 'You must be standing directly below the directory you are uploading'
     return 1
-  filename = create_archive(name)
+  filename = utils.create_archive(name)
   sha1 = utils.get_sha1(filename)
   dest = os.path.join(GMSCORE_DEPS, sha1)
-  print 'Uploading to %s' % dest
-  shutil.copyfile(filename, dest)
-  subprocess.check_call(['chmod', '664', dest])
+  uploadFile(filename, dest)
   sha1_file = '%s.sha1' % filename
   with open(sha1_file, 'w') as output:
     output.write(sha1)