Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(461)

Unified Diff: test/rules-rebuild/gyptest-all.py

Issue 300016: Fix generators to make sure changes to rule inputs trigger correct rebuilds.... (Closed) Base URL: http://gyp.googlecode.com/svn/trunk/
Patch Set: add same_target.gyp Created 11 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pylib/gyp/generator/make.py ('k') | test/rules-rebuild/gyptest-default.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/rules-rebuild/gyptest-all.py
===================================================================
--- test/rules-rebuild/gyptest-all.py (revision 0)
+++ test/rules-rebuild/gyptest-all.py (revision 0)
@@ -0,0 +1,74 @@
+#!/usr/bin/env python
+
+"""
+Verifies that a rule that generates multiple outputs rebuilds
+correctly when the inputs change.
+"""
+
+import TestGyp
+
+test = TestGyp.TestGyp()
+
+if test.format == 'msvs':
+ msg = 'TODO: issue 120: disabled on MSVS due to test execution problems.\n'
+ test.skip_test(msg)
+
+if test.format == 'xcode':
+ msg = 'TODO: issue 94: disabled on Xcode due to rule timing issues.\n'
+ test.skip_test(msg)
+
+test.run_gyp('same_target.gyp', chdir='src')
+
+test.relocate('src', 'relocate/src')
+
+
+test.build('same_target.gyp', test.ALL, chdir='relocate/src')
+
+expect = """\
+Hello from main.c
+Hello from prog1.in!
+Hello from prog2.in!
+"""
+
+test.run_built_executable('program', chdir='relocate/src', stdout=expect)
+
+test.up_to_date('same_target.gyp', 'program', chdir='relocate/src')
+
+
+test.sleep()
+contents = test.read(['relocate', 'src', 'prog1.in'])
+contents = contents.replace('!', ' AGAIN!')
+test.write(['relocate', 'src', 'prog1.in'], contents)
+
+test.build('same_target.gyp', test.ALL, chdir='relocate/src')
+
+expect = """\
+Hello from main.c
+Hello from prog1.in AGAIN!
+Hello from prog2.in!
+"""
+
+test.run_built_executable('program', chdir='relocate/src', stdout=expect)
+
+test.up_to_date('same_target.gyp', 'program', chdir='relocate/src')
+
+
+test.sleep()
+contents = test.read(['relocate', 'src', 'prog2.in'])
+contents = contents.replace('!', ' AGAIN!')
+test.write(['relocate', 'src', 'prog2.in'], contents)
+
+test.build('same_target.gyp', test.ALL, chdir='relocate/src')
+
+expect = """\
+Hello from main.c
+Hello from prog1.in AGAIN!
+Hello from prog2.in AGAIN!
+"""
+
+test.run_built_executable('program', chdir='relocate/src', stdout=expect)
+
+test.up_to_date('same_target.gyp', 'program', chdir='relocate/src')
+
+
+test.pass_test()
« no previous file with comments | « pylib/gyp/generator/make.py ('k') | test/rules-rebuild/gyptest-default.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698