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,32 @@
#!/usr/bin/env python
# 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.
"""
Verify that running gyp in a different directory does not cause actions and
rules to rerun.
"""
import os
import sys
import TestGyp
test = TestGyp.TestGyp(formats=['ninja'])
# The xcode-ninja generator handles gypfiles which are not at the
# project root incorrectly.
# cf. https://code.google.com/p/gyp/issues/detail?id=460
if test.format == 'xcode-ninja':
test.skip_test()
test.run_gyp('subdir/action-rule-hash.gyp')
test.build('subdir/action-rule-hash.gyp', test.ALL)
test.up_to_date('subdir/action-rule-hash.gyp')
# Verify that everything is still up-to-date when we re-invoke gyp from a
# different directory.
test.run_gyp('action-rule-hash.gyp', '--depth=../', chdir='subdir')
test.up_to_date('subdir/action-rule-hash.gyp')
test.pass_test()

View file

@ -0,0 +1,29 @@
# 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.
{
'targets': [
{
'target_name': 'program',
'type': 'executable',
'sources': [
'<(INTERMEDIATE_DIR)/main.cc',
],
'actions': [
{
'action_name': 'emit_main_cc',
'inputs': ['emit.py'],
'outputs': ['<(INTERMEDIATE_DIR)/main.cc'],
'action': [
'python',
'emit.py',
'<(INTERMEDIATE_DIR)/main.cc',
],
# Allows the test to run without hermetic cygwin on windows.
'msvs_cygwin_shell': 0,
},
],
},
],
}

View file

@ -0,0 +1,13 @@
#!/usr/bin/env python
# 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.
import sys
f = open(sys.argv[1], 'wb')
f.write('int main() {\n')
f.write(' return 0;\n')
f.write('}\n')
f.close()

View file

@ -0,0 +1,62 @@
#!/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.
"""
Verify that building an object file correctly depends on running actions in
dependent targets, but not the targets themselves.
"""
import os
import sys
if sys.platform == 'win32':
print "This test is currently disabled: https://crbug.com/483696."
sys.exit(0)
import TestGyp
# NOTE(piman): This test will not work with other generators because:
# - it explicitly tests the optimization, which is not implemented (yet?) on
# other generators
# - it relies on the exact path to output object files, which is generator
# dependent, and actually, relies on the ability to build only that object file,
# which I don't think is available on all generators.
# TODO(piman): Extend to other generators when possible.
test = TestGyp.TestGyp(formats=['ninja'])
# xcode-ninja doesn't support building single object files by design.
if test.format == 'xcode-ninja':
test.skip_test()
test.run_gyp('action_dependencies.gyp', chdir='src')
chdir = 'relocate/src'
test.relocate('src', chdir)
objext = '.obj' if sys.platform == 'win32' else '.o'
test.build('action_dependencies.gyp',
os.path.join('obj', 'b.b' + objext),
chdir=chdir)
# The 'a' actions should be run (letting b.c compile), but the a static library
# should not be built.
test.built_file_must_not_exist('a', type=test.STATIC_LIB, chdir=chdir)
test.built_file_must_not_exist('b', type=test.STATIC_LIB, chdir=chdir)
test.built_file_must_exist(os.path.join('obj', 'b.b' + objext), chdir=chdir)
test.build('action_dependencies.gyp',
os.path.join('obj', 'c.c' + objext),
chdir=chdir)
# 'a' and 'b' should be built, so that the 'c' action succeeds, letting c.c
# compile
test.built_file_must_exist('a', type=test.STATIC_LIB, chdir=chdir)
test.built_file_must_exist('b', type=test.EXECUTABLE, chdir=chdir)
test.built_file_must_exist(os.path.join('obj', 'c.c' + objext), chdir=chdir)
test.pass_test()

View file

@ -0,0 +1,10 @@
/* 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.
*/
#include "a.h"
int funcA() {
return 42;
}

View file

@ -0,0 +1,13 @@
/* 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.
*/
#ifndef A_H_
#define A_H_
#include "a/generated.h"
int funcA();
#endif // A_H_

View file

@ -0,0 +1,88 @@
# 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': 'a',
'type': 'static_library',
'sources': [
'a.c',
'a.h',
],
'actions': [
{
'action_name': 'generate_headers',
'inputs': [
'emit.py'
],
'outputs': [
'<(SHARED_INTERMEDIATE_DIR)/a/generated.h'
],
'action': [
'python',
'emit.py',
'<(SHARED_INTERMEDIATE_DIR)/a/generated.h',
],
# Allows the test to run without hermetic cygwin on windows.
'msvs_cygwin_shell': 0,
},
],
'include_dirs': [
'<(SHARED_INTERMEDIATE_DIR)',
],
'direct_dependent_settings': {
'include_dirs': [
'<(SHARED_INTERMEDIATE_DIR)',
],
},
},
{
'target_name': 'b',
'type': 'executable',
'sources': [
'b.c',
'b.h',
],
'dependencies': [
'a',
],
},
{
'target_name': 'c',
'type': 'static_library',
'sources': [
'c.c',
'c.h',
],
'dependencies': [
'b',
],
'actions': [
{
'action_name': 'generate_headers',
'inputs': [
],
'outputs': [
'<(SHARED_INTERMEDIATE_DIR)/c/generated.h'
],
'action': [
'<(PRODUCT_DIR)/b',
'<(SHARED_INTERMEDIATE_DIR)/c/generated.h',
],
# Allows the test to run without hermetic cygwin on windows.
'msvs_cygwin_shell': 0,
},
],
'include_dirs': [
'<(SHARED_INTERMEDIATE_DIR)',
],
'direct_dependent_settings': {
'include_dirs': [
'<(SHARED_INTERMEDIATE_DIR)',
],
},
},
],
}

View file

@ -0,0 +1,18 @@
/* 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.
*/
#include <stdio.h>
#include "b.h"
int main(int argc, char** argv) {
FILE* f;
if (argc < 2)
return 1;
f = fopen(argv[1], "wt");
fprintf(f, "#define VALUE %d\n", funcA());
fclose(f);
return 0;
}

View file

@ -0,0 +1,13 @@
/* 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.
*/
#ifndef B_H_
#define B_H_
#include "a.h"
int funcB();
#endif // B_H_

View file

@ -0,0 +1,10 @@
/* 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.
*/
#include "c.h"
int funcC() {
return VALUE;
}

View file

@ -0,0 +1,13 @@
/* 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.
*/
#ifndef C_H_
#define C_H_
#include "c/generated.h"
int funcC();
#endif // C_H_

View file

@ -0,0 +1,11 @@
#!/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], 'wb')
f.write('/* Hello World */\n')
f.close()

View file

@ -0,0 +1,53 @@
# Copyright (c) 2010 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': [
# This first target generates a header.
{
'target_name': 'generate_header',
'type': 'none',
'msvs_cygwin_shell': '0',
'actions': [
{
'action_name': 'generate header',
'inputs': [],
'outputs': ['<(SHARED_INTERMEDIATE_DIR)/generated/header.h'],
'action': [
'python', '-c', 'open(<(_outputs), "w")'
]
},
],
'all_dependent_settings': {
'include_dirs': [
'<(SHARED_INTERMEDIATE_DIR)',
],
},
},
# This intermediate target does nothing other than pull in a
# dependency on the above generated target.
{
'target_name': 'chain',
'type': 'none',
'dependencies': [
'generate_header',
],
},
# This final target is:
# - a static library (so gyp doesn't transitively pull in dependencies);
# - that relies on the generated file two dependencies away.
{
'target_name': 'chained',
'type': 'static_library',
'dependencies': [
'chain',
],
'sources': [
'chained.c',
],
},
],
}

View file

@ -0,0 +1,5 @@
#include "generated/header.h"
int main(void) {
return 0;
}

View file

@ -0,0 +1,30 @@
#!/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 files generated by two-steps-removed actions are built before
dependent compile steps.
"""
import os
import sys
import TestGyp
# This test is Ninja-specific in that:
# - the bug only showed nondeterministically in parallel builds;
# - it relies on a ninja-specific output file path.
test = TestGyp.TestGyp(formats=['ninja'])
# xcode-ninja doesn't support building single object files by design.
if test.format == 'xcode-ninja':
test.skip_test()
test.run_gyp('chained-dependency.gyp')
objext = '.obj' if sys.platform == 'win32' else '.o'
test.build('chained-dependency.gyp',
os.path.join('obj', 'chained.chained' + objext))
# The test passes if the .o file builds successfully.
test.pass_test()

View file

@ -0,0 +1,23 @@
#!/usr/bin/env python
# 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.
"""
Verifies a phony target isn't output if a target exists with the same name that
was output.
"""
import TestGyp
test = TestGyp.TestGyp(formats=['ninja'])
# Reset xcode_ninja_target_pattern to its default for this test.
test.run_gyp('test.gyp', '-G', 'xcode_ninja_target_pattern=^$')
# Check for both \r and \n to cover both windows and linux.
test.must_not_contain('out/Default/build.ninja', 'build empty_target: phony\r')
test.must_not_contain('out/Default/build.ninja', 'build empty_target: phony\n')
test.pass_test()

View file

@ -0,0 +1,19 @@
# 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.
{
'targets': [
{
'target_name': 'empty_target',
'type': 'executable',
'sources': [
'test.cc',
],
},
{
'target_name': 'included_empty_target',
'type': 'none',
},
],
}

View file

@ -0,0 +1,19 @@
# 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.
{
'targets': [
{
'target_name': 'All',
'type': 'none',
'dependencies': [
'subdir/included.gyp:included_empty_target'
]
},
{
'target_name': 'empty_target',
'type': 'none',
},
],
}

View file

@ -0,0 +1,46 @@
#!/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.
"""
Make sure paths are normalized with VS macros properly expanded on Windows.
"""
import TestGyp
import sys
if sys.platform == 'win32':
test = TestGyp.TestGyp(formats=['ninja'])
test.run_gyp('normalize-paths.gyp')
# We can't use existence tests because any case will pass, so we check the
# contents of ninja files directly since that's what we're most concerned
# with anyway.
subninja = open(test.built_file_path('obj/some_target.ninja')).read()
if '$!product_dir' in subninja:
test.fail_test()
if 'out\\Default' in subninja:
test.fail_test()
second = open(test.built_file_path('obj/second.ninja')).read()
if ('..\\..\\things\\AnotherName.exe' in second or
'AnotherName.exe' not in second):
test.fail_test()
copytarget = open(test.built_file_path('obj/copy_target.ninja')).read()
if '$(VSInstallDir)' in copytarget:
test.fail_test()
action = open(test.built_file_path('obj/action.ninja')).read()
if '..\\..\\out\\Default' in action:
test.fail_test()
if '..\\..\\SomethingElse' in action or 'SomethingElse' not in action:
test.fail_test()
if '..\\..\\SomeOtherInput' in action or 'SomeOtherInput' not in action:
test.fail_test()
test.pass_test()

View file

@ -0,0 +1,7 @@
// 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.
int main() {
return 0;
}

View file

@ -0,0 +1,68 @@
# Copyright (c) 2010 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': 'Some_Target',
'type': 'executable',
'msvs_settings': {
'VCLinkerTool': {
'OutputFile': '<(PRODUCT_DIR)/stuff/AnotherName.exe',
},
},
'sources': [
'HeLLo.cc',
'blOrP.idl',
],
},
{
'target_name': 'second',
'type': 'executable',
'msvs_settings': {
'VCLinkerTool': {
'OutputFile': '$(OutDir)\\things\\AnotherName.exe',
},
},
'sources': [
'HeLLo.cc',
],
},
{
'target_name': 'Copy_Target',
'type': 'none',
'copies': [
{
'destination': '<(PRODUCT_DIR)',
'files': [
'$(VSInstallDir)\\bin\\cl.exe',
],
},
],
},
{
'target_name': 'action',
'type': 'none',
'msvs_cygwin_shell': '0',
'actions': [
{
'inputs': [
'$(IntDir)\\SomeInput',
'$(OutDir)\\SomeOtherInput',
],
'outputs': [
'<(PRODUCT_DIR)/ReSuLt',
'<(SHARED_INTERMEDIATE_DIR)/TempFile',
'$(OutDir)\SomethingElse',
],
'action_name': 'Test action',
# Unfortunately, we can't normalize this field because it's
# free-form. Fortunately, ninja doesn't inspect it at all (only the
# inputs and outputs) so it's not mandatory.
'action': [],
},
],
},
],
}

View file

@ -0,0 +1 @@
# This file intentionally left blank.

View file

@ -0,0 +1,42 @@
#!/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.
"""
Verify that .s files don't always trigger a rebuild, as would happen if depfiles
were used for them (since clang & gcc ignore -MMD when building .s->.o on
linux).
"""
import os
import sys
import TestCommon
import TestGyp
# NOTE(fischman): Each generator uses depfiles (or not) differently, so this is
# a ninja-specific test.
test = TestGyp.TestGyp(formats=['ninja'])
if sys.platform == 'win32' or sys.platform == 'win64':
# This test is about clang/gcc vs. depfiles; VS gets a pass.
test.pass_test()
sys.exit(0)
test.run_gyp('s-needs-no-depfiles.gyp')
# Build the library, grab its timestamp, rebuild the library, ensure timestamp
# hasn't changed.
test.build('s-needs-no-depfiles.gyp', 'empty')
empty_dll = test.built_file_path('empty', test.SHARED_LIB)
test.built_file_must_exist(empty_dll)
pre_stat = os.stat(test.built_file_path(empty_dll))
test.sleep()
test.build('s-needs-no-depfiles.gyp', 'empty')
post_stat = os.stat(test.built_file_path(empty_dll))
if pre_stat.st_mtime != post_stat.st_mtime:
test.fail_test()
else:
test.pass_test()

View file

@ -0,0 +1,13 @@
# 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': [
{
'target_name': 'empty',
'type': 'shared_library',
'sources': [ 'empty.s' ],
},
],
}

View file

@ -0,0 +1,46 @@
#!/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.
"""
Verify that relinking a solib doesn't relink a dependent executable if the
solib's public API hasn't changed.
"""
import os
import sys
import TestCommon
import TestGyp
# NOTE(fischman): This test will not work with other generators because the
# API-hash-based-mtime-preservation optimization is only implemented in
# ninja.py. It could be extended to the make.py generator as well pretty
# easily, probably.
# (also, it tests ninja-specific out paths, which would have to be generalized
# if this was extended to other generators).
test = TestGyp.TestGyp(formats=['ninja'])
if not os.environ.get('ProgramFiles(x86)'):
# TODO(scottmg)
print 'Skipping test on x86, http://crbug.com/365833'
test.pass_test()
test.run_gyp('solibs_avoid_relinking.gyp')
# Build the executable, grab its timestamp, touch the solib's source, rebuild
# executable, ensure timestamp hasn't changed.
test.build('solibs_avoid_relinking.gyp', 'b')
test.built_file_must_exist('b' + TestCommon.exe_suffix)
pre_stat = os.stat(test.built_file_path('b' + TestCommon.exe_suffix))
os.utime(os.path.join(test.workdir, 'solib.cc'),
(pre_stat.st_atime, pre_stat.st_mtime + 100))
test.sleep()
test.build('solibs_avoid_relinking.gyp', 'b')
post_stat = os.stat(test.built_file_path('b' + TestCommon.exe_suffix))
if pre_stat.st_mtime != post_stat.st_mtime:
test.fail_test()
else:
test.pass_test()

View file

@ -0,0 +1,5 @@
extern int foo();
int main() {
return foo();
}

View file

@ -0,0 +1,8 @@
#ifdef _MSC_VER
__declspec(dllexport)
#else
__attribute__((visibility("default")))
#endif
int foo() {
return 42;
}

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.
{
'targets': [
{
'target_name': 'a',
'type': 'shared_library',
'sources': [ 'solib.cc' ],
# Incremental linking enabled so that .lib timestamp is maintained when
# exports are unchanged.
'msvs_settings': {
'VCLinkerTool': {
'LinkIncremental': '2',
}
},
},
{
'target_name': 'b',
'type': 'executable',
'sources': [ 'main.cc' ],
'dependencies': [ 'a' ],
'msvs_settings': {
'VCLinkerTool': {
'LinkIncremental': '2',
}
},
},
],
'conditions': [
['OS=="linux"', {
'target_defaults': {
'cflags': ['-fPIC'],
},
}],
],
}

View file

@ -0,0 +1,5 @@
# 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.
This is a dummy file for rule/action input.

View file

@ -0,0 +1,29 @@
#!/usr/bin/env python
# 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.
"""
Make sure 'ninja_use_console' is supported in actions and rules.
"""
import TestGyp
test = TestGyp.TestGyp(formats=['ninja'])
test.run_gyp('use-console.gyp')
no_pool = open(test.built_file_path('obj/no_pool.ninja')).read()
if 'pool =' in no_pool:
test.fail_test()
action_pool = open(test.built_file_path('obj/action_pool.ninja')).read()
if 'pool = console' not in action_pool:
test.fail_test()
rule_pool = open(test.built_file_path('obj/rule_pool.ninja')).read()
if 'pool = console' not in rule_pool:
test.fail_test()
test.pass_test()

View file

@ -0,0 +1,60 @@
# 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.
{
'targets': [
{
'target_name': 'no_pool',
'type': 'none',
'actions': [
{
'action_name': 'some_action',
'action': ['echo', 'hello'],
'inputs': ['foo.bar'],
'outputs': ['dummy'],
},
],
'rules': [
{
'rule_name': 'some_rule',
'extension': 'bar',
'action': ['echo', 'hello'],
'outputs': ['dummy'],
},
],
'sources': [
'foo.bar',
],
},
{
'target_name': 'action_pool',
'type': 'none',
'actions': [
{
'action_name': 'some_action',
'action': ['echo', 'hello'],
'inputs': ['foo.bar'],
'outputs': ['dummy'],
'ninja_use_console': 1,
},
],
},
{
'target_name': 'rule_pool',
'type': 'none',
'rules': [
{
'rule_name': 'some_rule',
'extension': 'bar',
'action': ['echo', 'hello'],
'outputs': ['dummy'],
'ninja_use_console': 1,
},
],
'sources': [
'foo.bar',
],
},
],
}

View file

@ -0,0 +1,28 @@
#!/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.
"""
Make sure environment files can be suppressed.
"""
import TestGyp
import os
import sys
if sys.platform == 'win32':
test = TestGyp.TestGyp(formats=['ninja'])
test.run_gyp('use-custom-environment-files.gyp',
'-G', 'ninja_use_custom_environment_files')
# Make sure environment files do not exist.
if os.path.exists(test.built_file_path('environment.x86')):
test.fail_test()
if os.path.exists(test.built_file_path('environment.x64')):
test.fail_test()
test.pass_test()

View file

@ -0,0 +1,7 @@
// 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.
int main() {
return 0;
}

View file

@ -0,0 +1,15 @@
# Copyright (c) 2010 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_use_custom_environment_files',
'type': 'executable',
'sources': [
'use-custom-environment-files.cc',
],
},
],
}