mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-03 05:47:29 +09:00
import FIREFOX_52_6_0esr_RELEASE from mozilla-esr52 hg repo
This commit is contained in:
commit
dcd9973243
150858 changed files with 23884658 additions and 0 deletions
|
|
@ -0,0 +1,14 @@
|
|||
# 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': 'main',
|
||||
'type': 'executable',
|
||||
'sources': [ 'main.cc', ],
|
||||
'msvs_prebuild': r'echo starting',
|
||||
'msvs_postbuild': r'echo finished',
|
||||
},
|
||||
],
|
||||
}
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
#!/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 msvs_prebuild and msvs_postbuild can be specified in both
|
||||
VS 2008 and 2010.
|
||||
"""
|
||||
|
||||
import TestGyp
|
||||
|
||||
test = TestGyp.TestGyp(formats=['msvs'], workdir='workarea_all')
|
||||
|
||||
test.run_gyp('buildevents.gyp', '-G', 'msvs_version=2008')
|
||||
test.must_contain('main.vcproj', 'Name="VCPreBuildEventTool"')
|
||||
test.must_contain('main.vcproj', 'Name="VCPostBuildEventTool"')
|
||||
|
||||
test.run_gyp('buildevents.gyp', '-G', 'msvs_version=2010')
|
||||
test.must_contain('main.vcxproj', '<PreBuildEvent>')
|
||||
test.must_contain('main.vcxproj', '<PostBuildEvent>')
|
||||
|
||||
test.pass_test()
|
||||
|
|
@ -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.
|
||||
|
||||
"""
|
||||
Verifies that ninja errors out when encountering msvs_prebuild/msvs_postbuild.
|
||||
"""
|
||||
|
||||
import sys
|
||||
import TestCmd
|
||||
import TestGyp
|
||||
|
||||
|
||||
if sys.platform == 'win32':
|
||||
test = TestGyp.TestGyp(formats=['ninja'])
|
||||
|
||||
test.run_gyp('buildevents.gyp',
|
||||
status=1,
|
||||
stderr=r'.*msvs_prebuild not supported \(target main\).*',
|
||||
match=TestCmd.match_re_dotall)
|
||||
|
||||
test.run_gyp('buildevents.gyp',
|
||||
status=1,
|
||||
stderr=r'.*msvs_postbuild not supported \(target main\).*',
|
||||
match=TestCmd.match_re_dotall)
|
||||
|
||||
test.pass_test()
|
||||
|
|
@ -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.
|
||||
|
||||
int main() {}
|
||||
|
|
@ -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 msvs_configuration_attributes and
|
||||
msbuild_configuration_attributes are applied by using
|
||||
them to set the OutputDirectory.
|
||||
"""
|
||||
|
||||
import TestGyp
|
||||
import os
|
||||
|
||||
import sys
|
||||
|
||||
if sys.platform == 'win32':
|
||||
print "This test is currently disabled: https://crbug.com/483696."
|
||||
sys.exit(0)
|
||||
|
||||
|
||||
|
||||
test = TestGyp.TestGyp(workdir='workarea_all',formats=['msvs'])
|
||||
|
||||
vc_version = 'VC90'
|
||||
|
||||
if os.getenv('GYP_MSVS_VERSION'):
|
||||
vc_version = ['VC90','VC100'][int(os.getenv('GYP_MSVS_VERSION')) >= 2010]
|
||||
|
||||
expected_exe_file = os.path.join(test.workdir, vc_version, 'hello.exe')
|
||||
|
||||
test.run_gyp('hello.gyp')
|
||||
|
||||
test.build('hello.gyp')
|
||||
|
||||
test.must_exist(expected_exe_file)
|
||||
|
||||
test.pass_test()
|
||||
11
media/webrtc/trunk/tools/gyp/test/msvs/config_attrs/hello.c
Normal file
11
media/webrtc/trunk/tools/gyp/test/msvs/config_attrs/hello.c
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
/* 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>
|
||||
|
||||
int main(void)
|
||||
{
|
||||
printf("Hello, world!\n");
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
# 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': 'hello',
|
||||
'type': 'executable',
|
||||
'sources': [
|
||||
'hello.c',
|
||||
],
|
||||
'msvs_configuration_attributes': {
|
||||
'OutputDirectory':'$(SolutionDir)VC90/'
|
||||
},
|
||||
'msbuild_configuration_attributes': {
|
||||
'OutputDirectory':'$(SolutionDir)VC100/',
|
||||
},
|
||||
},
|
||||
],
|
||||
}
|
||||
22
media/webrtc/trunk/tools/gyp/test/msvs/express/base/base.gyp
Normal file
22
media/webrtc/trunk/tools/gyp/test/msvs/express/base/base.gyp
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
# 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': 'a',
|
||||
'type': 'static_library',
|
||||
'sources': [
|
||||
'a.c',
|
||||
],
|
||||
},
|
||||
{
|
||||
'target_name': 'b',
|
||||
'type': 'static_library',
|
||||
'sources': [
|
||||
'b.c',
|
||||
],
|
||||
},
|
||||
],
|
||||
}
|
||||
19
media/webrtc/trunk/tools/gyp/test/msvs/express/express.gyp
Normal file
19
media/webrtc/trunk/tools/gyp/test/msvs/express/express.gyp
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
# 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': 'express',
|
||||
'type': 'executable',
|
||||
'dependencies': [
|
||||
'base/base.gyp:a',
|
||||
'base/base.gyp:b',
|
||||
],
|
||||
'sources': [
|
||||
'main.c',
|
||||
],
|
||||
},
|
||||
],
|
||||
}
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
#!/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 that flat solutions get generated for Express versions of
|
||||
Visual Studio.
|
||||
"""
|
||||
|
||||
import TestGyp
|
||||
|
||||
test = TestGyp.TestGyp(formats=['msvs'])
|
||||
|
||||
test.run_gyp('express.gyp', '-G', 'msvs_version=2005')
|
||||
test.must_contain('express.sln', '(base)')
|
||||
|
||||
test.run_gyp('express.gyp', '-G', 'msvs_version=2008')
|
||||
test.must_contain('express.sln', '(base)')
|
||||
|
||||
test.run_gyp('express.gyp', '-G', 'msvs_version=2005e')
|
||||
test.must_not_contain('express.sln', '(base)')
|
||||
|
||||
test.run_gyp('express.gyp', '-G', 'msvs_version=2008e')
|
||||
test.must_not_contain('express.sln', '(base)')
|
||||
|
||||
|
||||
test.pass_test()
|
||||
|
|
@ -0,0 +1,68 @@
|
|||
# Copyright (c) 2013 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': {
|
||||
# the test driver switches this flag when testing external builder
|
||||
'use_external_builder%': 0,
|
||||
},
|
||||
'targets': [
|
||||
{
|
||||
'target_name': 'external',
|
||||
'type': 'executable',
|
||||
'sources': [
|
||||
'hello.cpp',
|
||||
'hello.z',
|
||||
],
|
||||
'rules': [
|
||||
{
|
||||
'rule_name': 'test_rule',
|
||||
'extension': 'z',
|
||||
'outputs': [
|
||||
'msbuild_rule.out',
|
||||
],
|
||||
'action': [
|
||||
'python',
|
||||
'msbuild_rule.py',
|
||||
'<(RULE_INPUT_PATH)',
|
||||
'a', 'b', 'c',
|
||||
],
|
||||
'msvs_cygwin_shell': 0,
|
||||
},
|
||||
],
|
||||
'actions': [
|
||||
{
|
||||
'action_name': 'test action',
|
||||
'inputs': [
|
||||
'msbuild_action.py',
|
||||
],
|
||||
'outputs': [
|
||||
'msbuild_action.out',
|
||||
],
|
||||
'action': [
|
||||
'python',
|
||||
'<@(_inputs)',
|
||||
'x', 'y', 'z',
|
||||
],
|
||||
'msvs_cygwin_shell': 0,
|
||||
},
|
||||
],
|
||||
'conditions': [
|
||||
['use_external_builder==1', {
|
||||
'msvs_external_builder': 'test',
|
||||
'msvs_external_builder_build_cmd': [
|
||||
'python',
|
||||
'external_builder.py',
|
||||
'build', '1', '2', '3',
|
||||
],
|
||||
'msvs_external_builder_clean_cmd': [
|
||||
'python',
|
||||
'external_builder.py',
|
||||
'clean', '4', '5',
|
||||
],
|
||||
}],
|
||||
],
|
||||
},
|
||||
],
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
# Copyright (c) 2013 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
|
||||
|
||||
with open('external_builder.out', 'w') as f:
|
||||
f.write(' '.join(sys.argv))
|
||||
|
||||
|
|
@ -0,0 +1,59 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
# Copyright (c) 2013 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 msvs_external_builder being set will invoke the provided
|
||||
msvs_external_builder_build_cmd and msvs_external_builder_clean_cmd, and will
|
||||
not invoke MSBuild actions and rules.
|
||||
"""
|
||||
|
||||
import os
|
||||
import sys
|
||||
import TestGyp
|
||||
|
||||
if int(os.environ.get('GYP_MSVS_VERSION', 0)) < 2010:
|
||||
sys.exit(0)
|
||||
|
||||
test = TestGyp.TestGyp(formats=['msvs'], workdir='workarea_all')
|
||||
|
||||
# without the flag set
|
||||
test.run_gyp('external.gyp')
|
||||
test.build('external.gyp', target='external')
|
||||
test.must_not_exist('external_builder.out')
|
||||
test.must_exist('msbuild_rule.out')
|
||||
test.must_exist('msbuild_action.out')
|
||||
test.must_match('msbuild_rule.out', 'msbuild_rule.py hello.z a b c')
|
||||
test.must_match('msbuild_action.out', 'msbuild_action.py x y z')
|
||||
os.remove('msbuild_rule.out')
|
||||
os.remove('msbuild_action.out')
|
||||
|
||||
# with the flag set, using Build
|
||||
try:
|
||||
os.environ['GYP_DEFINES'] = 'use_external_builder=1'
|
||||
test.run_gyp('external.gyp')
|
||||
test.build('external.gyp', target='external')
|
||||
finally:
|
||||
del os.environ['GYP_DEFINES']
|
||||
test.must_not_exist('msbuild_rule.out')
|
||||
test.must_not_exist('msbuild_action.out')
|
||||
test.must_exist('external_builder.out')
|
||||
test.must_match('external_builder.out', 'external_builder.py build 1 2 3')
|
||||
os.remove('external_builder.out')
|
||||
|
||||
# with the flag set, using Clean
|
||||
try:
|
||||
os.environ['GYP_DEFINES'] = 'use_external_builder=1'
|
||||
test.run_gyp('external.gyp')
|
||||
test.build('external.gyp', target='external', clean=True)
|
||||
finally:
|
||||
del os.environ['GYP_DEFINES']
|
||||
test.must_not_exist('msbuild_rule.out')
|
||||
test.must_not_exist('msbuild_action.out')
|
||||
test.must_exist('external_builder.out')
|
||||
test.must_match('external_builder.out', 'external_builder.py clean 4 5')
|
||||
os.remove('external_builder.out')
|
||||
|
||||
test.pass_test()
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
// 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>
|
||||
|
||||
int main(void) {
|
||||
printf("Hello, world!\n");
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
# Copyright (c) 2013 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 file will be passed to the test rule.
|
||||
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
# Copyright (c) 2013 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
|
||||
|
||||
with open('msbuild_action.out', 'w') as f:
|
||||
f.write(' '.join(sys.argv))
|
||||
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
# Copyright (c) 2013 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, os.path
|
||||
|
||||
sys.argv[1] = os.path.basename(sys.argv[1])
|
||||
|
||||
with open('msbuild_rule.out', 'w') as f:
|
||||
f.write(' '.join(sys.argv))
|
||||
|
||||
47
media/webrtc/trunk/tools/gyp/test/msvs/filters/filters.gyp
Normal file
47
media/webrtc/trunk/tools/gyp/test/msvs/filters/filters.gyp
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
# 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_source_files',
|
||||
'type': 'none',
|
||||
'sources': [ ],
|
||||
},
|
||||
{
|
||||
'target_name': 'one_source_file',
|
||||
'type': 'executable',
|
||||
'sources': [
|
||||
'../folder/a.c',
|
||||
],
|
||||
},
|
||||
{
|
||||
'target_name': 'two_source_files',
|
||||
'type': 'executable',
|
||||
'sources': [
|
||||
'../folder/a.c',
|
||||
'../folder/b.c',
|
||||
],
|
||||
},
|
||||
{
|
||||
'target_name': 'three_files_in_two_folders',
|
||||
'type': 'executable',
|
||||
'sources': [
|
||||
'../folder1/a.c',
|
||||
'../folder1/b.c',
|
||||
'../folder2/c.c',
|
||||
],
|
||||
},
|
||||
{
|
||||
'target_name': 'nested_folders',
|
||||
'type': 'executable',
|
||||
'sources': [
|
||||
'../folder1/nested/a.c',
|
||||
'../folder2/d.c',
|
||||
'../folder1/nested/b.c',
|
||||
'../folder1/other/c.c',
|
||||
],
|
||||
},
|
||||
],
|
||||
}
|
||||
|
|
@ -0,0 +1,68 @@
|
|||
#!/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 that extra filters are pruned correctly for Visual Studio 2008.
|
||||
"""
|
||||
|
||||
import re
|
||||
import TestGyp
|
||||
|
||||
|
||||
def strip_ws(str):
|
||||
return re.sub('^ +', '', str, flags=re.M).replace('\n', '')
|
||||
|
||||
|
||||
test = TestGyp.TestGyp(formats=['msvs'])
|
||||
|
||||
test.run_gyp('filters.gyp', '-G', 'standalone', '-G', 'msvs_version=2008')
|
||||
|
||||
test.must_contain('no_source_files.vcproj', '<Files/>')
|
||||
|
||||
test.must_contain('one_source_file.vcproj', strip_ws('''\
|
||||
<Files>
|
||||
<File RelativePath="..\\folder\\a.c"/>
|
||||
</Files>
|
||||
'''))
|
||||
|
||||
test.must_contain('two_source_files.vcproj', strip_ws('''\
|
||||
<Files>
|
||||
<File RelativePath="..\\folder\\a.c"/>
|
||||
<File RelativePath="..\\folder\\b.c"/>
|
||||
</Files>
|
||||
'''))
|
||||
|
||||
test.must_contain('three_files_in_two_folders.vcproj', strip_ws('''\
|
||||
<Files>
|
||||
<Filter Name="folder1">
|
||||
<File RelativePath="..\\folder1\\a.c"/>
|
||||
<File RelativePath="..\\folder1\\b.c"/>
|
||||
</Filter>
|
||||
<Filter Name="folder2">
|
||||
<File RelativePath="..\\folder2\\c.c"/>
|
||||
</Filter>
|
||||
</Files>
|
||||
'''))
|
||||
|
||||
test.must_contain('nested_folders.vcproj', strip_ws('''\
|
||||
<Files>
|
||||
<Filter Name="folder1">
|
||||
<Filter Name="nested">
|
||||
<File RelativePath="..\\folder1\\nested\\a.c"/>
|
||||
<File RelativePath="..\\folder1\\nested\\b.c"/>
|
||||
</Filter>
|
||||
<Filter Name="other">
|
||||
<File RelativePath="..\\folder1\\other\\c.c"/>
|
||||
</Filter>
|
||||
</Filter>
|
||||
<Filter Name="folder2">
|
||||
<File RelativePath="..\\folder2\\d.c"/>
|
||||
</Filter>
|
||||
</Files>
|
||||
'''))
|
||||
|
||||
|
||||
test.pass_test()
|
||||
|
|
@ -0,0 +1,57 @@
|
|||
#!/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 that extra filters are pruned correctly for Visual Studio 2010
|
||||
and later.
|
||||
"""
|
||||
|
||||
import TestGyp
|
||||
|
||||
|
||||
test = TestGyp.TestGyp(formats=['msvs'])
|
||||
|
||||
test.run_gyp('filters.gyp', '-G', 'standalone', '-G', 'msvs_version=2010')
|
||||
|
||||
test.must_not_exist('no_source_files.vcxproj.filters')
|
||||
|
||||
test.must_not_exist('one_source_file.vcxproj.filters')
|
||||
|
||||
test.must_not_exist('two_source_files.vcxproj.filters')
|
||||
|
||||
test.must_contain('three_files_in_two_folders.vcxproj.filters', '''\
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\\folder1\\a.c">
|
||||
<Filter>folder1</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\\folder1\\b.c">
|
||||
<Filter>folder1</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\\folder2\\c.c">
|
||||
<Filter>folder2</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
'''.replace('\n', '\r\n'))
|
||||
|
||||
test.must_contain('nested_folders.vcxproj.filters', '''\
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\\folder1\\nested\\a.c">
|
||||
<Filter>folder1\\nested</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\\folder2\\d.c">
|
||||
<Filter>folder2</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\\folder1\\nested\\b.c">
|
||||
<Filter>folder1\\nested</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\\folder1\\other\\c.c">
|
||||
<Filter>folder1\\other</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
'''.replace('\n', '\r\n'))
|
||||
|
||||
|
||||
test.pass_test()
|
||||
|
|
@ -0,0 +1,51 @@
|
|||
#!/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 msvs_list_excluded_files=0 doesn't list files that would
|
||||
normally be in _excluded_files, and that if that flag is not set, then they
|
||||
are still listed.
|
||||
"""
|
||||
|
||||
import os
|
||||
import TestGyp
|
||||
|
||||
test = TestGyp.TestGyp(formats=['msvs'], workdir='workarea_all')
|
||||
|
||||
|
||||
# with the flag set to 0
|
||||
try:
|
||||
os.environ['GYP_GENERATOR_FLAGS'] = 'msvs_list_excluded_files=0'
|
||||
test.run_gyp('hello_exclude.gyp')
|
||||
finally:
|
||||
del os.environ['GYP_GENERATOR_FLAGS']
|
||||
if test.uses_msbuild:
|
||||
test.must_not_contain('hello.vcxproj', 'hello_mac')
|
||||
else:
|
||||
test.must_not_contain('hello.vcproj', 'hello_mac')
|
||||
|
||||
|
||||
# with the flag not set
|
||||
test.run_gyp('hello_exclude.gyp')
|
||||
if test.uses_msbuild:
|
||||
test.must_contain('hello.vcxproj', 'hello_mac')
|
||||
else:
|
||||
test.must_contain('hello.vcproj', 'hello_mac')
|
||||
|
||||
|
||||
# with the flag explicitly set to 1
|
||||
try:
|
||||
os.environ['GYP_GENERATOR_FLAGS'] = 'msvs_list_excluded_files=1'
|
||||
test.run_gyp('hello_exclude.gyp')
|
||||
finally:
|
||||
del os.environ['GYP_GENERATOR_FLAGS']
|
||||
if test.uses_msbuild:
|
||||
test.must_contain('hello.vcxproj', 'hello_mac')
|
||||
else:
|
||||
test.must_contain('hello.vcproj', 'hello_mac')
|
||||
|
||||
|
||||
test.pass_test()
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
// 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>
|
||||
|
||||
int main(void) {
|
||||
printf("Hello, world!\n");
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
# 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': 'hello',
|
||||
'type': 'executable',
|
||||
'sources': [
|
||||
'hello.cpp',
|
||||
'hello_mac.cpp',
|
||||
],
|
||||
'conditions': [
|
||||
['OS!="mac"', {'sources!': ['hello_mac.cpp']}],
|
||||
]
|
||||
},
|
||||
],
|
||||
}
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
// 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>
|
||||
|
||||
int hello2() {
|
||||
printf("Hello, two!\n");
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
#!/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 missing 'sources' files are treated as fatal errors when the
|
||||
the generator flag 'msvs_error_on_missing_sources' is set.
|
||||
"""
|
||||
|
||||
import TestGyp
|
||||
import os
|
||||
import sys
|
||||
|
||||
if sys.platform == 'win32':
|
||||
test = TestGyp.TestGyp(formats=['msvs', 'ninja'], workdir='workarea_all')
|
||||
|
||||
# With the flag not set
|
||||
test.run_gyp('hello_missing.gyp')
|
||||
|
||||
# With the flag explicitly set to 0
|
||||
try:
|
||||
os.environ['GYP_GENERATOR_FLAGS'] = 'msvs_error_on_missing_sources=0'
|
||||
test.run_gyp('hello_missing.gyp')
|
||||
finally:
|
||||
del os.environ['GYP_GENERATOR_FLAGS']
|
||||
|
||||
# With the flag explicitly set to 1
|
||||
try:
|
||||
os.environ['GYP_GENERATOR_FLAGS'] = 'msvs_error_on_missing_sources=1'
|
||||
# Test to make sure GYP raises an exception (exit status 1). Since this will
|
||||
# also print a backtrace, ensure that TestGyp is not checking that stderr is
|
||||
# empty by specifying None, which means do not perform any checking.
|
||||
# Instead, stderr is checked below to ensure it contains the expected
|
||||
# output.
|
||||
test.run_gyp('hello_missing.gyp', status=1, stderr=None)
|
||||
finally:
|
||||
del os.environ['GYP_GENERATOR_FLAGS']
|
||||
test.must_contain_any_line(test.stderr(),
|
||||
["Missing input files:"])
|
||||
|
||||
test.pass_test()
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
# 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': 'hello',
|
||||
'type': 'executable',
|
||||
'sources': [
|
||||
'hello_missing.cpp',
|
||||
],
|
||||
},
|
||||
],
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
# 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
|
||||
|
||||
sys.exit(1)
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
# 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
|
||||
|
||||
sys.exit(0)
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
# 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': 'actions-test',
|
||||
'type': 'none',
|
||||
'actions': [
|
||||
{
|
||||
'action_name': 'first action (fails)',
|
||||
'inputs': [
|
||||
'action_fail.py',
|
||||
],
|
||||
'outputs': [
|
||||
'ALWAYS_OUT_OF_DATE',
|
||||
],
|
||||
'action': [
|
||||
'python', '<@(_inputs)'
|
||||
],
|
||||
'msvs_cygwin_shell': 0,
|
||||
},
|
||||
{
|
||||
'action_name': 'second action (succeeds)',
|
||||
'inputs': [
|
||||
'action_succeed.py',
|
||||
],
|
||||
'outputs': [
|
||||
'ALWAYS_OUT_OF_DATE',
|
||||
],
|
||||
'action': [
|
||||
'python', '<@(_inputs)'
|
||||
],
|
||||
'msvs_cygwin_shell': 0,
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
}
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
#!/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 that failing actions make the build fail reliably, even when there
|
||||
are multiple actions in one project.
|
||||
"""
|
||||
|
||||
import os
|
||||
import sys
|
||||
import TestGyp
|
||||
import TestCmd
|
||||
|
||||
test = TestGyp.TestGyp(formats=['msvs'], workdir='workarea_all')
|
||||
|
||||
test.run_gyp('actions.gyp')
|
||||
test.build('actions.gyp',
|
||||
target='actions-test',
|
||||
status=1,
|
||||
stdout=r'.*"cmd\.exe" exited with code 1\..*',
|
||||
match=TestCmd.match_re_dotall)
|
||||
|
||||
test.pass_test()
|
||||
14
media/webrtc/trunk/tools/gyp/test/msvs/props/AppName.props
Normal file
14
media/webrtc/trunk/tools/gyp/test/msvs/props/AppName.props
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup Label="UserMacros">
|
||||
<AppName>Greet</AppName>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<BuildMacro Include="AppName">
|
||||
<Value>$(AppName)</Value>
|
||||
</BuildMacro>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
11
media/webrtc/trunk/tools/gyp/test/msvs/props/AppName.vsprops
Normal file
11
media/webrtc/trunk/tools/gyp/test/msvs/props/AppName.vsprops
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioPropertySheet
|
||||
ProjectType="Visual C++"
|
||||
Version="8.00"
|
||||
Name="Common"
|
||||
>
|
||||
<UserMacro
|
||||
Name="AppName"
|
||||
Value="Greet"
|
||||
/>
|
||||
</VisualStudioPropertySheet>
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
#!/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 props files are added by using a
|
||||
props file to set the name of the built executable.
|
||||
"""
|
||||
|
||||
import TestGyp
|
||||
|
||||
test = TestGyp.TestGyp(workdir='workarea_all', formats=['msvs'])
|
||||
|
||||
test.run_gyp('hello.gyp')
|
||||
|
||||
test.build('hello.gyp')
|
||||
|
||||
test.built_file_must_exist('Greet.exe')
|
||||
|
||||
test.pass_test()
|
||||
11
media/webrtc/trunk/tools/gyp/test/msvs/props/hello.c
Normal file
11
media/webrtc/trunk/tools/gyp/test/msvs/props/hello.c
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
/* 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>
|
||||
|
||||
int main(void)
|
||||
{
|
||||
printf("Hello, world!\n");
|
||||
return 0;
|
||||
}
|
||||
22
media/webrtc/trunk/tools/gyp/test/msvs/props/hello.gyp
Normal file
22
media/webrtc/trunk/tools/gyp/test/msvs/props/hello.gyp
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
# 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': 'hello',
|
||||
'product_name': '$(AppName)',
|
||||
'type': 'executable',
|
||||
'sources': [
|
||||
'hello.c',
|
||||
],
|
||||
'msvs_props': [
|
||||
'$(SolutionDir)AppName.vsprops'
|
||||
],
|
||||
'msbuild_props': [
|
||||
'$(SolutionDir)AppName.props'
|
||||
],
|
||||
},
|
||||
],
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
# Copyright (c) 2015 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.
|
||||
|
||||
A dummy file with the .bar extension (used for stderr rule).
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
# Copyright (c) 2015 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.
|
||||
|
||||
A dummy file with the .foo extension (used for stdout rule).
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
# Copyright (c) 2015 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 stdout and stderr from rules get logged in the build's
|
||||
stdout."""
|
||||
|
||||
import sys
|
||||
import TestGyp
|
||||
|
||||
if sys.platform == 'win32':
|
||||
test = TestGyp.TestGyp(formats=['msvs'])
|
||||
|
||||
test.run_gyp('rules-stdout-stderr.gyp')
|
||||
test.build('rules-stdout-stderr.gyp', test.ALL)
|
||||
|
||||
expected_stdout_lines = [
|
||||
'testing stdout',
|
||||
'This will go to stdout',
|
||||
|
||||
# Note: stderr output from rules will go to the build's stdout.
|
||||
'testing stderr',
|
||||
'This will go to stderr',
|
||||
]
|
||||
test.must_contain_all_lines(test.stdout(), expected_stdout_lines)
|
||||
|
||||
test.pass_test()
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
#!/usr/bin/env python
|
||||
# Copyright (c) 2015 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
|
||||
print >>sys.stderr, "This will go to stderr"
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
#!/usr/bin/env python
|
||||
# Copyright (c) 2015 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.
|
||||
|
||||
print "This will go to stdout"
|
||||
|
|
@ -0,0 +1,52 @@
|
|||
# Copyright (c) 2015 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': 'none',
|
||||
'sources': [
|
||||
'dummy.foo',
|
||||
'dummy.bar',
|
||||
],
|
||||
'rules': [
|
||||
{
|
||||
'rule_name': 'test_stdout',
|
||||
'extension': 'foo',
|
||||
'message': 'testing stdout',
|
||||
'msvs_cygwin_shell': 0,
|
||||
'inputs': [
|
||||
'rule_stdout.py',
|
||||
],
|
||||
'outputs': [
|
||||
'dummy.foo_output',
|
||||
],
|
||||
'action': [
|
||||
'python',
|
||||
'rule_stdout.py',
|
||||
'<(RULE_INPUT_PATH)',
|
||||
],
|
||||
},
|
||||
{
|
||||
'rule_name': 'test_stderr',
|
||||
'extension': 'bar',
|
||||
'message': 'testing stderr',
|
||||
'msvs_cygwin_shell': 0,
|
||||
'inputs': [
|
||||
'rule_stderr.py',
|
||||
],
|
||||
'outputs': [
|
||||
'dummy.bar_output',
|
||||
],
|
||||
'action': [
|
||||
'python',
|
||||
'rule_stderr.py',
|
||||
'<(RULE_INPUT_PATH)',
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
}
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
# 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.
|
||||
|
||||
{
|
||||
'target_defaults': {
|
||||
'default_configuration': 'Baz',
|
||||
'configurations': {
|
||||
'Baz': {
|
||||
'msvs_configuration_attributes': {
|
||||
'OutputDirectory': '<(DEPTH)/foo',
|
||||
'IntermediateDirectory': '$(OutDir)/bar',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
#!/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.
|
||||
|
||||
"""
|
||||
Test checking that IntermediateDirectory can be defined in terms of
|
||||
OutputDirectory. We previously had emitted the definition of
|
||||
IntermediateDirectory before the definition of OutputDirectory.
|
||||
This is required so that $(IntDir) can be based on $(OutDir).
|
||||
"""
|
||||
|
||||
import TestGyp
|
||||
import os
|
||||
|
||||
# NOTE: This test really is vcbuild/msbuild specific (not applicable to windows
|
||||
# ninja), as it is testing the msvs output location when opening an .sln
|
||||
# other than all.sln.
|
||||
test = TestGyp.TestGyp(workdir='workarea_shared_output', formats=['msvs'])
|
||||
|
||||
test.run_gyp('hello.gyp')
|
||||
test.set_configuration('Baz')
|
||||
|
||||
test.build('there/there.gyp', test.ALL)
|
||||
test.must_exist(os.path.join(test.workdir, 'foo', 'there.exe'))
|
||||
test.must_exist(os.path.join(test.workdir, 'foo', 'bar', 'there.obj'))
|
||||
|
||||
test.build('hello.gyp', test.ALL)
|
||||
test.must_exist(os.path.join(test.workdir, 'foo', 'hello.exe'))
|
||||
test.must_exist(os.path.join(test.workdir, 'foo', 'bar', 'hello.obj'))
|
||||
|
||||
if test.format == 'msvs':
|
||||
if test.uses_msbuild:
|
||||
test.must_contain('pull_in_there.vcxproj',
|
||||
'<IntDir>$(OutDir)bar\\</IntDir>')
|
||||
else:
|
||||
test.must_contain('pull_in_there.vcproj',
|
||||
'IntermediateDirectory="$(OutDir)bar\\"')
|
||||
|
||||
test.pass_test()
|
||||
12
media/webrtc/trunk/tools/gyp/test/msvs/shared_output/hello.c
Normal file
12
media/webrtc/trunk/tools/gyp/test/msvs/shared_output/hello.c
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
/*
|
||||
* 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>
|
||||
|
||||
int main(void) {
|
||||
printf("Hello, world!\n");
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
# 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.
|
||||
|
||||
{
|
||||
'includes': ['common.gypi'],
|
||||
'targets': [
|
||||
{
|
||||
'target_name': 'pull_in_there',
|
||||
'type': 'none',
|
||||
'dependencies': ['there/there.gyp:*'],
|
||||
},
|
||||
{
|
||||
'target_name': 'hello',
|
||||
'type': 'executable',
|
||||
'sources': [
|
||||
'hello.c',
|
||||
],
|
||||
},
|
||||
],
|
||||
}
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
/*
|
||||
* 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>
|
||||
|
||||
int main(void) {
|
||||
printf("Hello, world!\n");
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
# 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.
|
||||
|
||||
{
|
||||
'includes': ['../common.gypi'],
|
||||
'targets': [
|
||||
{
|
||||
'target_name': 'there',
|
||||
'type': 'executable',
|
||||
'sources': [
|
||||
'there.c',
|
||||
],
|
||||
},
|
||||
],
|
||||
}
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
#!/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 uldi can be disabled on a per-project-reference basis in vs2010.
|
||||
"""
|
||||
|
||||
import TestGyp
|
||||
|
||||
test = TestGyp.TestGyp(formats=['msvs'], workdir='workarea_all')
|
||||
|
||||
test.run_gyp('hello.gyp')
|
||||
|
||||
if test.uses_msbuild:
|
||||
test.must_contain('hello.vcxproj', '<UseLibraryDependencyInputs>false')
|
||||
|
||||
test.pass_test()
|
||||
13
media/webrtc/trunk/tools/gyp/test/msvs/uldi2010/hello.c
Normal file
13
media/webrtc/trunk/tools/gyp/test/msvs/uldi2010/hello.c
Normal 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. */
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
extern int hello2();
|
||||
|
||||
int main(void) {
|
||||
printf("Hello, world!\n");
|
||||
hello2();
|
||||
return 0;
|
||||
}
|
||||
26
media/webrtc/trunk/tools/gyp/test/msvs/uldi2010/hello.gyp
Normal file
26
media/webrtc/trunk/tools/gyp/test/msvs/uldi2010/hello.gyp
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
# 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': 'hello',
|
||||
'type': 'executable',
|
||||
'sources': [
|
||||
'hello.c',
|
||||
],
|
||||
'dependencies': [
|
||||
'hellolib',
|
||||
]
|
||||
},
|
||||
{
|
||||
'target_name': 'hellolib',
|
||||
'type': 'static_library',
|
||||
'sources': [
|
||||
'hello2.c',
|
||||
],
|
||||
'msvs_2010_disable_uldi_when_referenced': 1,
|
||||
},
|
||||
],
|
||||
}
|
||||
10
media/webrtc/trunk/tools/gyp/test/msvs/uldi2010/hello2.c
Normal file
10
media/webrtc/trunk/tools/gyp/test/msvs/uldi2010/hello2.c
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
/* 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>
|
||||
|
||||
int hello2() {
|
||||
printf("Hello, two!\n");
|
||||
return 0;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue