import FIREFOX_52_6_0esr_RELEASE from mozilla-esr52 hg repo

This commit is contained in:
Roy Tam 2018-01-19 03:59:58 +08:00
commit dcd9973243
150858 changed files with 23884658 additions and 0 deletions

View file

@ -0,0 +1,82 @@
#!/usr/bin/env python
# Copyright (c) 2011 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Verifies simple rules when using an explicit build target of 'all'.
"""
import sys
if sys.platform == 'win32':
print "This test is currently disabled: https://crbug.com/483696."
sys.exit(0)
import TestGyp
test = TestGyp.TestGyp()
test.run_gyp('no_action_with_rules_fails.gyp', chdir='src/noaction', status=1,
stderr=None)
test.run_gyp('actions.gyp',
'-G', 'xcode_ninja_target_pattern=^pull_in_all_actions$',
chdir='src')
test.relocate('src', 'relocate/src')
test.build('actions.gyp', test.ALL, chdir='relocate/src')
expect = """\
Hello from program.c
Hello from function1.in
Hello from function2.in
"""
if test.format == 'xcode':
chdir = 'relocate/src/subdir1'
else:
chdir = 'relocate/src'
test.run_built_executable('program', chdir=chdir, stdout=expect)
expect = """\
Hello from program.c
Hello from function3.in
"""
if test.format == 'xcode':
chdir = 'relocate/src/subdir3'
else:
chdir = 'relocate/src'
test.run_built_executable('program2', chdir=chdir, stdout=expect)
test.must_match('relocate/src/subdir2/file1.out', 'Hello from file1.in\n')
test.must_match('relocate/src/subdir2/file2.out', 'Hello from file2.in\n')
test.must_match('relocate/src/subdir2/file1.out2', 'Hello from file1.in\n')
test.must_match('relocate/src/subdir2/file2.out2', 'Hello from file2.in\n')
test.must_match('relocate/src/subdir2/file1.out4', 'Hello from file1.in\n')
test.must_match('relocate/src/subdir2/file2.out4', 'Hello from file2.in\n')
test.must_match('relocate/src/subdir2/file1.copy', 'Hello from file1.in\n')
test.must_match('relocate/src/external/file1.external_rules.out',
'Hello from file1.in\n')
test.must_match('relocate/src/external/file2.external_rules.out',
'Hello from file2.in\n')
expect = """\
Hello from program.c
Got 41.
"""
if test.format == 'xcode':
chdir = 'relocate/src/subdir4'
else:
chdir = 'relocate/src'
test.run_built_executable('program4', chdir=chdir, stdout=expect)
test.pass_test()

View file

@ -0,0 +1,68 @@
#!/usr/bin/env python
# Copyright (c) 2011 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Verifies simple rules when using an explicit build target of 'all'.
"""
import sys
if sys.platform == 'win32':
print "This test is currently disabled: https://crbug.com/483696."
sys.exit(0)
import TestGyp
test = TestGyp.TestGyp()
test.run_gyp('actions.gyp',
'-G', 'xcode_ninja_target_pattern=^pull_in_all_actions$',
chdir='src')
test.relocate('src', 'relocate/src')
test.build('actions.gyp', chdir='relocate/src')
expect = """\
Hello from program.c
Hello from function1.in
Hello from function2.in
"""
if test.format == 'xcode':
chdir = 'relocate/src/subdir1'
else:
chdir = 'relocate/src'
test.run_built_executable('program', chdir=chdir, stdout=expect)
expect = """\
Hello from program.c
Hello from function3.in
"""
if test.format == 'xcode':
chdir = 'relocate/src/subdir3'
else:
chdir = 'relocate/src'
test.run_built_executable('program2', chdir=chdir, stdout=expect)
test.must_match('relocate/src/subdir2/file1.out', 'Hello from file1.in\n')
test.must_match('relocate/src/subdir2/file2.out', 'Hello from file2.in\n')
test.must_match('relocate/src/subdir2/file1.out2', 'Hello from file1.in\n')
test.must_match('relocate/src/subdir2/file2.out2', 'Hello from file2.in\n')
test.must_match('relocate/src/subdir2/file1.out4', 'Hello from file1.in\n')
test.must_match('relocate/src/subdir2/file2.out4', 'Hello from file2.in\n')
test.must_match('relocate/src/subdir2/file1.copy', 'Hello from file1.in\n')
test.must_match('relocate/src/external/file1.external_rules.out',
'Hello from file1.in\n')
test.must_match('relocate/src/external/file2.external_rules.out',
'Hello from file2.in\n')
test.pass_test()

View file

@ -0,0 +1,26 @@
#!/usr/bin/env python
# Copyright (c) 2011 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Verifies that RULE_INPUT_ROOT isn't turned into a path in rule actions
"""
import TestGyp
test = TestGyp.TestGyp()
test.run_gyp('input-root.gyp', chdir='src')
test.relocate('src', 'relocate/src')
test.build('input-root.gyp', target='test', chdir='relocate/src')
expect = """\
Hello somefile
"""
test.run_built_executable('test', chdir='relocate/src', stdout=expect)
test.pass_test()

View file

@ -0,0 +1,18 @@
#!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
""" Verifies that VS variables that require special variables are expanded
correctly. """
import sys
import TestGyp
if sys.platform == 'win32':
test = TestGyp.TestGyp()
test.run_gyp('special-variables.gyp', chdir='src')
test.build('special-variables.gyp', test.ALL, chdir='src')
test.pass_test()

View file

@ -0,0 +1,23 @@
# Copyright (c) 2011 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{
'targets': [
{
'target_name': 'pull_in_all_actions',
'type': 'none',
'dependencies': [
'subdir1/executable.gyp:*',
'subdir2/both_rule_and_action_input.gyp:*',
'subdir2/never_used.gyp:*',
'subdir2/no_inputs.gyp:*',
'subdir2/no_action.gyp:*',
'subdir2/none.gyp:*',
'subdir3/executable2.gyp:*',
'subdir4/build-asm.gyp:*',
'external/external.gyp:*',
],
},
],
}

View file

@ -0,0 +1,6 @@
// Copyright (c) 2012 Google Inc. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Fake asm file.
int main() {}

View file

@ -0,0 +1,7 @@
@echo off
:: Copyright (c) 2011 Google Inc. All rights reserved.
:: Use of this source code is governed by a BSD-style license that can be
:: found in the LICENSE file.
:: Fake assembler for Windows
cl /TP /c %1 /Fo%2

View file

@ -0,0 +1,11 @@
#!/usr/bin/env python
# Copyright (c) 2009 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import sys
contents = open(sys.argv[1], 'r').read()
open(sys.argv[2], 'wb').write(contents)
sys.exit(0)

View file

@ -0,0 +1,66 @@
# Copyright (c) 2009 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# Test that the case where there are no inputs (other than the
# file the rule applies to).
{
'target_defaults': {
'msvs_cygwin_dirs': ['../../../../../../<(DEPTH)/third_party/cygwin'],
},
'targets': [
{
'target_name': 'external_rules',
'type': 'none',
'sources': [
'file1.in',
'file2.in',
],
'conditions': [
['OS=="win"', {
'dependencies': [
'cygwin',
],
}],
],
'rules': [
{
'rule_name': 'copy_file',
'extension': 'in',
'msvs_external_rule': 1,
'outputs': [
'<(RULE_INPUT_ROOT).external_rules.out',
],
'action': [
'python', '../copy-file.py', '<(RULE_INPUT_PATH)', '<@(_outputs)',
],
},
],
},
],
'conditions': [
['OS=="win"', {
'targets': [
{
'target_name': 'cygwin',
'type': 'none',
'actions': [
{
'action_name': 'setup_mount',
'msvs_cygwin_shell': 0,
'inputs': [
'../../../../../../<(DEPTH)/third_party/cygwin/setup_mount.bat',
],
# Visual Studio requires an output file, or else the
# custom build step won't run.
'outputs': [
'<(INTERMEDIATE_DIR)/_always_run_setup_mount.marker',
],
'action': ['<@(_inputs)'],
},
],
},
],
}],
],
}

View file

@ -0,0 +1 @@
Hello from file1.in

View file

@ -0,0 +1 @@
Hello from file2.in

View file

@ -0,0 +1,24 @@
# Copyright (c) 2011 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{
'targets': [
{
'target_name': 'test',
'type': 'executable',
'sources': [ 'somefile.ext', ],
'rules': [{
'rule_name': 'rule',
'extension': 'ext',
'inputs': [ 'rule.py', ],
'outputs': [ '<(RULE_INPUT_ROOT).cc', ],
'action': [ 'python', 'rule.py', '<(RULE_INPUT_ROOT)', ],
'message': 'Processing <(RULE_INPUT_PATH)',
'process_outputs_as_sources': 1,
# Allows the test to run without hermetic cygwin on windows.
'msvs_cygwin_shell': 0,
}],
},
],
}

View file

@ -0,0 +1 @@
Hello from file1.in

View file

@ -0,0 +1,37 @@
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# Test the case where there's no action but there are input rules that should
# be processed results in a gyp failure.
{
'targets': [
{
'target_name': 'extension_does_match_sources_but_no_action',
'type': 'none',
'msvs_cygwin_shell': 0,
'sources': [
'file1.in',
],
'rules': [
{
'rule_name': 'assembled',
'extension': 'in',
'outputs': [
'<(RULE_INPUT_ROOT).in',
],
'conditions': [
# Always fails.
[ '"true"=="false"', {
'action': [
'python', '../copy-file.py', '<(RULE_INPUT_PATH)', '<@(_outputs)',
],
'process_outputs_as_sources': 1,
'message': 'test_rule',
}],
],
},
],
},
],
}

View file

@ -0,0 +1,17 @@
#!/usr/bin/env python
# Copyright (c) 2011 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import sys
f = open(sys.argv[1] + ".cc", "w")
f.write("""\
#include <stdio.h>
int main() {
puts("Hello %s");
return 0;
}
""" % sys.argv[1])
f.close()

View file

@ -0,0 +1,34 @@
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{
'targets': [
{
'rules': [
{
'rule_name': 'assembler (gnu-compatible)',
'msvs_cygwin_shell': 0,
'msvs_quote_cmd': 0,
'extension': 'S',
'inputs': [
'as.bat',
],
'outputs': [
'$(IntDir)/$(InputName).obj',
],
'action': [
'as.bat',
'$(InputPath)',
'$(IntDir)/$(InputName).obj',
],
'message': 'Building assembly language file $(InputPath)',
'process_outputs_as_sources': 1,
},
],
'target_name': 'test',
'type': 'static_library',
'sources': [ 'an_asm.S' ],
},
],
}

View file

@ -0,0 +1,37 @@
# Copyright (c) 2009 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{
'targets': [
{
'target_name': 'program',
'type': 'executable',
'msvs_cygwin_shell': 0,
'sources': [
'program.c',
'function1.in',
'function2.in',
],
'rules': [
{
'rule_name': 'copy_file',
'extension': 'in',
'inputs': [
'../copy-file.py',
],
'outputs': [
# TODO: fix Make to support generated files not
# in a variable-named path like <(INTERMEDIATE_DIR)
#'<(RULE_INPUT_ROOT).c',
'<(INTERMEDIATE_DIR)/<(RULE_INPUT_ROOT).c',
],
'action': [
'python', '<(_inputs)', '<(RULE_INPUT_PATH)', '<@(_outputs)',
],
'process_outputs_as_sources': 1,
},
],
},
],
}

View file

@ -0,0 +1,6 @@
#include <stdio.h>
void function1(void)
{
printf("Hello from function1.in\n");
}

View file

@ -0,0 +1,6 @@
#include <stdio.h>
void function2(void)
{
printf("Hello from function2.in\n");
}

View file

@ -0,0 +1,12 @@
#include <stdio.h>
extern void function1(void);
extern void function2(void);
int main(void)
{
printf("Hello from program.c\n");
function1();
function2();
return 0;
}

View file

@ -0,0 +1,50 @@
# Copyright (c) 2014 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# Tests that if a rule input is also an action input, both the rule and action
# are executed
{
'targets': [
{
'target_name': 'files_both_rule_and_action_input',
'type': 'executable',
'msvs_cygwin_shell': 0,
'sources': [
'program.c',
'file1.in',
'file2.in',
],
'rules': [
{
'rule_name': 'copy_file',
'extension': 'in',
'inputs': [
'../copy-file.py',
],
'outputs': [
'<(RULE_INPUT_ROOT).out4',
],
'action': [
'python', '<(_inputs)', '<(RULE_INPUT_PATH)', '<@(_outputs)',
],
},
],
'actions': [
{
'action_name': 'copy_file1_in',
'inputs': [
'../copy-file.py',
'file1.in',
],
'outputs': [
'file1.copy',
],
'action': [
'python', '<@(_inputs)', '<(_outputs)'
],
},
],
},
],
}

View file

@ -0,0 +1 @@
Hello from file1.in

View file

@ -0,0 +1 @@
Hello from file2.in

View file

@ -0,0 +1,31 @@
# Copyright (c) 2009 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# Test that the case where there is a rule that doesn't apply to anything.
{
'targets': [
{
'target_name': 'files_no_input2',
'type': 'none',
'msvs_cygwin_shell': 0,
'sources': [
'file1.in',
'file2.in',
],
'rules': [
{
'rule_name': 'copy_file3',
'extension': 'in2',
'outputs': [
'<(RULE_INPUT_ROOT).out3',
],
'action': [
'python', '../copy-file.py', '<(RULE_INPUT_PATH)', '<@(_outputs)',
],
'process_outputs_as_sources': 1,
},
],
},
],
}

View file

@ -0,0 +1,38 @@
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# Test that the case where an action is only specified under a conditional is
# evaluated appropriately.
{
'targets': [
{
'target_name': 'extension_does_not_match_sources_and_no_action',
'type': 'none',
'msvs_cygwin_shell': 0,
'sources': [
'file1.in',
'file2.in',
],
'rules': [
{
'rule_name': 'assemble',
'extension': 'asm',
'outputs': [
'<(RULE_INPUT_ROOT).fail',
],
'conditions': [
# Always fails.
[ '"true"=="false"', {
'action': [
'python', '../copy-file.py', '<(RULE_INPUT_PATH)', '<@(_outputs)',
],
'process_outputs_as_sources': 1,
'message': 'test_rule',
}],
],
},
],
},
],
}

View file

@ -0,0 +1,32 @@
# Copyright (c) 2009 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# Test that the case where there are no inputs (other than the
# file the rule applies to).
{
'targets': [
{
'target_name': 'files_no_input',
'type': 'none',
'msvs_cygwin_shell': 0,
'sources': [
'file1.in',
'file2.in',
],
'rules': [
{
'rule_name': 'copy_file2',
'extension': 'in',
'outputs': [
'<(RULE_INPUT_ROOT).out2',
],
'action': [
'python', '../copy-file.py', '<(RULE_INPUT_PATH)', '<@(_outputs)',
],
'process_outputs_as_sources': 1,
},
],
},
],
}

View file

@ -0,0 +1,33 @@
# Copyright (c) 2009 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{
'targets': [
{
'target_name': 'files',
'type': 'none',
'msvs_cygwin_shell': 0,
'sources': [
'file1.in',
'file2.in',
],
'rules': [
{
'rule_name': 'copy_file',
'extension': 'in',
'inputs': [
'../copy-file.py',
],
'outputs': [
'<(RULE_INPUT_ROOT).out',
],
'action': [
'python', '<(_inputs)', '<(RULE_INPUT_PATH)', '<@(_outputs)',
],
'process_outputs_as_sources': 1,
},
],
},
],
}

View file

@ -0,0 +1,12 @@
/* Copyright (c) 2014 Google Inc. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include <stdio.h>
int main(void)
{
printf("Hello from program.c\n");
return 0;
}

View file

@ -0,0 +1,37 @@
# Copyright (c) 2009 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# This one tests that rules are properly written if extensions are different
# between the target's sources (program.c) and the generated files
# (function3.cc)
{
'targets': [
{
'target_name': 'program2',
'type': 'executable',
'msvs_cygwin_shell': 0,
'sources': [
'program.c',
'function3.in',
],
'rules': [
{
'rule_name': 'copy_file',
'extension': 'in',
'inputs': [
'../copy-file.py',
],
'outputs': [
'<(SHARED_INTERMEDIATE_DIR)/<(RULE_INPUT_ROOT).cc',
],
'action': [
'python', '<(_inputs)', '<(RULE_INPUT_PATH)', '<@(_outputs)',
],
'process_outputs_as_sources': 1,
},
],
},
],
}

View file

@ -0,0 +1,6 @@
#include <stdio.h>
extern "C" void function3(void)
{
printf("Hello from function3.in\n");
}

View file

@ -0,0 +1,10 @@
#include <stdio.h>
extern void function3(void);
int main(void)
{
printf("Hello from program.c\n");
function3();
return 0;
}

View file

@ -0,0 +1,10 @@
#if PLATFORM_WINDOWS || PLATFORM_MAC
# define IDENTIFIER(n) _##n
#else /* Linux */
# define IDENTIFIER(n) n
#endif
.globl IDENTIFIER(asm_function)
IDENTIFIER(asm_function):
movl $41, %eax
ret

View file

@ -0,0 +1,49 @@
# Copyright (c) 2009 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# This one tests that assembly files ended as .s and .S are compiled.
{
'target_defaults': {
'conditions': [
['OS=="win"', {
'defines': ['PLATFORM_WIN'],
}],
['OS=="mac"', {
'defines': ['PLATFORM_MAC'],
}],
['OS=="linux"', {
'defines': ['PLATFORM_LINUX'],
}],
],
},
'targets': [
{
'target_name': 'program4',
'type': 'executable',
'sources': [
'asm-function.assem',
'program.c',
],
'conditions': [
['OS=="linux" or OS=="mac"', {
'rules': [
{
'rule_name': 'convert_assem',
'extension': 'assem',
'inputs': [],
'outputs': [
'<(SHARED_INTERMEDIATE_DIR)/<(RULE_INPUT_ROOT).S',
],
'action': [
'bash', '-c', 'cp <(RULE_INPUT_PATH) <@(_outputs)',
],
'process_outputs_as_sources': 1,
},
],
}],
],
},
],
}

View file

@ -0,0 +1,19 @@
#include <stdio.h>
// Use the assembly function in linux and mac where it is built.
#if PLATFORM_LINUX || PLATFORM_MAC
extern int asm_function(void);
#else
int asm_function() {
return 41;
}
#endif
int main(void)
{
fprintf(stdout, "Hello from program.c\n");
fflush(stdout);
fprintf(stdout, "Got %d.\n", asm_function());
fflush(stdout);
return 0;
}