diff options
Diffstat (limited to 'Source/ThirdParty/gyp/test/hello')
-rw-r--r-- | Source/ThirdParty/gyp/test/hello/gyptest-all.py | 24 | ||||
-rw-r--r-- | Source/ThirdParty/gyp/test/hello/gyptest-default.py | 24 | ||||
-rw-r--r-- | Source/ThirdParty/gyp/test/hello/gyptest-disable-regyp.py | 32 | ||||
-rw-r--r-- | Source/ThirdParty/gyp/test/hello/gyptest-regyp.py | 32 | ||||
-rwxr-xr-x | Source/ThirdParty/gyp/test/hello/gyptest-target.py | 24 | ||||
-rw-r--r-- | Source/ThirdParty/gyp/test/hello/hello.c | 11 | ||||
-rw-r--r-- | Source/ThirdParty/gyp/test/hello/hello.gyp | 15 | ||||
-rw-r--r-- | Source/ThirdParty/gyp/test/hello/hello2.c | 11 | ||||
-rw-r--r-- | Source/ThirdParty/gyp/test/hello/hello2.gyp | 15 |
9 files changed, 188 insertions, 0 deletions
diff --git a/Source/ThirdParty/gyp/test/hello/gyptest-all.py b/Source/ThirdParty/gyp/test/hello/gyptest-all.py new file mode 100644 index 000000000..9ecff556e --- /dev/null +++ b/Source/ThirdParty/gyp/test/hello/gyptest-all.py @@ -0,0 +1,24 @@ +#!/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 simplest-possible build of a "Hello, world!" program +using an explicit build target of 'all'. +""" + +import TestGyp + +test = TestGyp.TestGyp() + +test.run_gyp('hello.gyp') + +test.build('hello.gyp', test.ALL) + +test.run_built_executable('hello', stdout="Hello, world!\n") + +test.up_to_date('hello.gyp', test.ALL) + +test.pass_test() diff --git a/Source/ThirdParty/gyp/test/hello/gyptest-default.py b/Source/ThirdParty/gyp/test/hello/gyptest-default.py new file mode 100644 index 000000000..76fffb3ea --- /dev/null +++ b/Source/ThirdParty/gyp/test/hello/gyptest-default.py @@ -0,0 +1,24 @@ +#!/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 simplest-possible build of a "Hello, world!" program +using the default build target. +""" + +import TestGyp + +test = TestGyp.TestGyp() + +test.run_gyp('hello.gyp') + +test.build('hello.gyp') + +test.run_built_executable('hello', stdout="Hello, world!\n") + +test.up_to_date('hello.gyp', test.DEFAULT) + +test.pass_test() diff --git a/Source/ThirdParty/gyp/test/hello/gyptest-disable-regyp.py b/Source/ThirdParty/gyp/test/hello/gyptest-disable-regyp.py new file mode 100644 index 000000000..1e4b30667 --- /dev/null +++ b/Source/ThirdParty/gyp/test/hello/gyptest-disable-regyp.py @@ -0,0 +1,32 @@ +#!/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 Makefiles don't get rebuilt when a source gyp file changes and +the disable_regeneration generator flag is set. +""" + +import TestGyp + +test = TestGyp.TestGyp() + +test.run_gyp('hello.gyp', '-Gauto_regeneration=0') + +test.build('hello.gyp', test.ALL) + +test.run_built_executable('hello', stdout="Hello, world!\n") + +# Sleep so that the changed gyp file will have a newer timestamp than the +# previously generated build files. +test.sleep() +test.write('hello.gyp', test.read('hello2.gyp')) + +test.build('hello.gyp', test.ALL) + +# Should still be the old executable, as regeneration was disabled. +test.run_built_executable('hello', stdout="Hello, world!\n") + +test.pass_test() diff --git a/Source/ThirdParty/gyp/test/hello/gyptest-regyp.py b/Source/ThirdParty/gyp/test/hello/gyptest-regyp.py new file mode 100644 index 000000000..827c7235c --- /dev/null +++ b/Source/ThirdParty/gyp/test/hello/gyptest-regyp.py @@ -0,0 +1,32 @@ +#!/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 Makefiles get rebuilt when a source gyp file changes. +""" + +import TestGyp + +# Regenerating build files when a gyp file changes is currently only supported +# by the make generator. +test = TestGyp.TestGyp(formats=['make']) + +test.run_gyp('hello.gyp') + +test.build('hello.gyp', test.ALL) + +test.run_built_executable('hello', stdout="Hello, world!\n") + +# Sleep so that the changed gyp file will have a newer timestamp than the +# previously generated build files. +test.sleep() +test.write('hello.gyp', test.read('hello2.gyp')) + +test.build('hello.gyp', test.ALL) + +test.run_built_executable('hello', stdout="Hello, two!\n") + +test.pass_test() diff --git a/Source/ThirdParty/gyp/test/hello/gyptest-target.py b/Source/ThirdParty/gyp/test/hello/gyptest-target.py new file mode 100755 index 000000000..2f0a2a33d --- /dev/null +++ b/Source/ThirdParty/gyp/test/hello/gyptest-target.py @@ -0,0 +1,24 @@ +#!/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 simplest-possible build of a "Hello, world!" program +using an explicit build target of 'hello'. +""" + +import TestGyp + +test = TestGyp.TestGyp() + +test.run_gyp('hello.gyp') + +test.build('hello.gyp', 'hello') + +test.run_built_executable('hello', stdout="Hello, world!\n") + +test.up_to_date('hello.gyp', 'hello') + +test.pass_test() diff --git a/Source/ThirdParty/gyp/test/hello/hello.c b/Source/ThirdParty/gyp/test/hello/hello.c new file mode 100644 index 000000000..8dbecc049 --- /dev/null +++ b/Source/ThirdParty/gyp/test/hello/hello.c @@ -0,0 +1,11 @@ +/* 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. */ + +#include <stdio.h> + +int main(int argc, char *argv[]) +{ + printf("Hello, world!\n"); + return 0; +} diff --git a/Source/ThirdParty/gyp/test/hello/hello.gyp b/Source/ThirdParty/gyp/test/hello/hello.gyp new file mode 100644 index 000000000..1974d51cc --- /dev/null +++ b/Source/ThirdParty/gyp/test/hello/hello.gyp @@ -0,0 +1,15 @@ +# 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': 'hello', + 'type': 'executable', + 'sources': [ + 'hello.c', + ], + }, + ], +} diff --git a/Source/ThirdParty/gyp/test/hello/hello2.c b/Source/ThirdParty/gyp/test/hello/hello2.c new file mode 100644 index 000000000..19ef3fbd5 --- /dev/null +++ b/Source/ThirdParty/gyp/test/hello/hello2.c @@ -0,0 +1,11 @@ +/* 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. */ + +#include <stdio.h> + +int main(int argc, char *argv[]) +{ + printf("Hello, two!\n"); + return 0; +} diff --git a/Source/ThirdParty/gyp/test/hello/hello2.gyp b/Source/ThirdParty/gyp/test/hello/hello2.gyp new file mode 100644 index 000000000..25b08caf3 --- /dev/null +++ b/Source/ThirdParty/gyp/test/hello/hello2.gyp @@ -0,0 +1,15 @@ +# 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': 'hello', + 'type': 'executable', + 'sources': [ + 'hello2.c', + ], + }, + ], +} |