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,39 @@
#!/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 .so files that are order only dependencies are specified by
their install location rather than by their alias.
"""
# Python 2.5 needs this for the with statement.
from __future__ import with_statement
import os
import TestGyp
test = TestGyp.TestGyp(formats=['make'])
test.run_gyp('shared_dependency.gyp',
chdir='src')
test.relocate('src', 'relocate/src')
test.build('shared_dependency.gyp', test.ALL, chdir='relocate/src')
makefile_path = 'relocate/src/Makefile'
with open(makefile_path) as makefile:
make_contents = makefile.read()
# If we remove the code to generate lib1, Make should still be able
# to build lib2 since lib1.so already exists.
make_contents = make_contents.replace('include lib1.target.mk', '')
with open(makefile_path, 'w') as makefile:
makefile.write(make_contents)
test.build('shared_dependency.gyp', test.ALL, chdir='relocate/src')
test.pass_test()

View file

@ -0,0 +1,84 @@
#!/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.
"""
Verifies simple build of a "Hello, world!" program with shared libraries,
including verifying that libraries are rebuilt correctly when functions
move between libraries.
"""
import TestGyp
test = TestGyp.TestGyp()
test.run_gyp('library.gyp',
'-Dlibrary=shared_library',
'-Dmoveable_function=lib1',
chdir='src')
test.relocate('src', 'relocate/src')
test.build('library.gyp', test.ALL, chdir='relocate/src')
expect = """\
Hello from program.c
Hello from lib1.c
Hello from lib2.c
Hello from lib1_moveable.c
"""
test.run_built_executable('program', chdir='relocate/src', stdout=expect)
test.run_gyp('library.gyp',
'-Dlibrary=shared_library',
'-Dmoveable_function=lib2',
chdir='relocate/src')
# Update program.c to force a rebuild.
test.sleep()
contents = test.read('relocate/src/program.c')
contents = contents.replace('Hello', 'Hello again')
test.write('relocate/src/program.c', contents)
test.build('library.gyp', test.ALL, chdir='relocate/src')
expect = """\
Hello again from program.c
Hello from lib1.c
Hello from lib2.c
Hello from lib2_moveable.c
"""
test.run_built_executable('program', chdir='relocate/src', stdout=expect)
test.run_gyp('library.gyp',
'-Dlibrary=shared_library',
'-Dmoveable_function=lib1',
chdir='relocate/src')
# Update program.c to force a rebuild.
test.sleep()
contents = test.read('relocate/src/program.c')
contents = contents.replace('again', 'again again')
test.write('relocate/src/program.c', contents)
# TODO(sgk): we have to force a rebuild of lib2 so that it weeds out
# the "moved" module. This should be done in gyp by adding a dependency
# on the generated .vcproj file itself.
test.touch('relocate/src/lib2.c')
test.build('library.gyp', test.ALL, chdir='relocate/src')
expect = """\
Hello again again from program.c
Hello from lib1.c
Hello from lib2.c
Hello from lib1_moveable.c
"""
test.run_built_executable('program', chdir='relocate/src', stdout=expect)
test.pass_test()

View file

@ -0,0 +1,84 @@
#!/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.
"""
Verifies simple build of a "Hello, world!" program with static libraries,
including verifying that libraries are rebuilt correctly when functions
move between libraries.
"""
import TestGyp
test = TestGyp.TestGyp()
test.run_gyp('library.gyp',
'-Dlibrary=static_library',
'-Dmoveable_function=lib1',
chdir='src')
test.relocate('src', 'relocate/src')
test.build('library.gyp', test.ALL, chdir='relocate/src')
expect = """\
Hello from program.c
Hello from lib1.c
Hello from lib2.c
Hello from lib1_moveable.c
"""
test.run_built_executable('program', chdir='relocate/src', stdout=expect)
test.run_gyp('library.gyp',
'-Dlibrary=static_library',
'-Dmoveable_function=lib2',
chdir='relocate/src')
# Update program.c to force a rebuild.
test.sleep()
contents = test.read('relocate/src/program.c')
contents = contents.replace('Hello', 'Hello again')
test.write('relocate/src/program.c', contents)
test.build('library.gyp', test.ALL, chdir='relocate/src')
expect = """\
Hello again from program.c
Hello from lib1.c
Hello from lib2.c
Hello from lib2_moveable.c
"""
test.run_built_executable('program', chdir='relocate/src', stdout=expect)
test.run_gyp('library.gyp',
'-Dlibrary=static_library',
'-Dmoveable_function=lib1',
chdir='relocate/src')
# Update program.c and lib2.c to force a rebuild.
test.sleep()
contents = test.read('relocate/src/program.c')
contents = contents.replace('again', 'again again')
test.write('relocate/src/program.c', contents)
# TODO(sgk): we have to force a rebuild of lib2 so that it weeds out
# the "moved" module. This should be done in gyp by adding a dependency
# on the generated .vcproj file itself.
test.touch('relocate/src/lib2.c')
test.build('library.gyp', test.ALL, chdir='relocate/src')
expect = """\
Hello again again from program.c
Hello from lib1.c
Hello from lib2.c
Hello from lib1_moveable.c
"""
test.run_built_executable('program', chdir='relocate/src', stdout=expect)
test.pass_test()

View file

@ -0,0 +1,10 @@
#include <stdio.h>
#ifdef _WIN32
__declspec(dllexport)
#endif
void lib1_function(void)
{
fprintf(stdout, "Hello from lib1.c\n");
fflush(stdout);
}

View file

@ -0,0 +1,10 @@
#include <stdio.h>
#ifdef _WIN32
__declspec(dllexport)
#endif
void moveable_function(void)
{
fprintf(stdout, "Hello from lib1_moveable.c\n");
fflush(stdout);
}

View file

@ -0,0 +1,10 @@
#include <stdio.h>
#ifdef _WIN32
__declspec(dllexport)
#endif
void lib2_function(void)
{
fprintf(stdout, "Hello from lib2.c\n");
fflush(stdout);
}

View file

@ -0,0 +1,10 @@
#include <stdio.h>
#ifdef _WIN32
__declspec(dllexport)
#endif
void moveable_function(void)
{
fprintf(stdout, "Hello from lib2_moveable.c\n");
fflush(stdout);
}

View file

@ -0,0 +1,58 @@
# 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.
{
'variables': {
'moveable_function%': 0,
},
'targets': [
{
'target_name': 'program',
'type': 'executable',
'dependencies': [
'lib1',
'lib2',
],
'sources': [
'program.c',
],
},
{
'target_name': 'lib1',
'type': '<(library)',
'sources': [
'lib1.c',
],
'conditions': [
['moveable_function=="lib1"', {
'sources': [
'lib1_moveable.c',
],
}],
],
},
{
'target_name': 'lib2',
'type': '<(library)',
'sources': [
'lib2.c',
],
'conditions': [
['moveable_function=="lib2"', {
'sources': [
'lib2_moveable.c',
],
}],
],
},
],
'conditions': [
['OS=="linux"', {
'target_defaults': {
# Support 64-bit shared libs (also works fine for 32-bit).
'cflags': ['-fPIC'],
},
}],
],
}

View file

@ -0,0 +1,15 @@
#include <stdio.h>
extern void lib1_function(void);
extern void lib2_function(void);
extern void moveable_function(void);
int main(void)
{
fprintf(stdout, "Hello from program.c\n");
fflush(stdout);
lib1_function();
lib2_function();
moveable_function();
return 0;
}

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': 'lib1',
'type': 'shared_library',
'sources': [
'lib1.c',
],
},
{
'target_name': 'lib2',
'type': 'shared_library',
'sources': [
'lib2.c',
],
'dependencies': [
'lib1',
],
},
],
'conditions': [
['OS=="linux"', {
'target_defaults': {
# Support 64-bit shared libs (also works fine for 32-bit).
'cflags': ['-fPIC'],
},
}],
],
}