~hjd/ubuntu/wily/gyp/debian-merged

« back to all changes in this revision

Viewing changes to test/mac/gyptest-bundle-resources.py

  • Committer: Hans Joachim Desserud
  • Date: 2015-10-31 12:46:59 UTC
  • mfrom: (6.2.6 sid)
  • Revision ID: hans_joachim_desserud-20151031124659-lzxekr6woskh4k0b
Merge latest Debian version

Show diffs side-by-side

added added

removed removed

Lines of Context:
10
10
 
11
11
import TestGyp
12
12
 
 
13
import os
 
14
import stat
13
15
import sys
14
16
 
 
17
if sys.platform in ('darwin'):
 
18
  print "This test is currently disabled: https://crbug.com/483696."
 
19
  sys.exit(0)
 
20
 
 
21
 
 
22
def check_attribs(path, expected_exec_bit):
 
23
  out_path = test.built_file_path(
 
24
      os.path.join('resource.app/Contents/Resources', path), chdir=CHDIR)
 
25
 
 
26
  in_stat = os.stat(os.path.join(CHDIR, path))
 
27
  out_stat = os.stat(out_path)
 
28
  if in_stat.st_mtime == out_stat.st_mtime:
 
29
    test.fail_test()
 
30
  if out_stat.st_mode & stat.S_IXUSR != expected_exec_bit:
 
31
    test.fail_test()
 
32
 
 
33
 
15
34
if sys.platform == 'darwin':
16
35
  # set |match| to ignore build stderr output.
17
36
  test = TestGyp.TestGyp(formats=['ninja', 'make', 'xcode'])
26
45
  test.built_file_must_match('source_rule.app/Contents/Resources/secret.txt',
27
46
                             'ABC\n', chdir=CHDIR)
28
47
 
 
48
  test.built_file_must_match(
 
49
      'resource.app/Contents/Resources/executable-file.sh',
 
50
      '#!/bin/bash\n'
 
51
      '\n'
 
52
      'echo echo echo echo cho ho o o\n', chdir=CHDIR)
 
53
 
 
54
  check_attribs('executable-file.sh', expected_exec_bit=stat.S_IXUSR)
 
55
  check_attribs('secret.txt', expected_exec_bit=0)
 
56
 
29
57
  # TODO(thakis): This currently fails with make.
30
58
  if test.format != 'make':
31
59
    test.built_file_must_match(