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

Unified Diff: test/prune_targets/gyptest-prune-targets.py

Issue 24803004: Add an option to prune unwanted targets (Closed) Base URL: http://gyp.googlecode.com/svn/trunk
Patch Set: prune based on a set of root targets instead of build_files Created 7 years, 3 months 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
Index: test/prune_targets/gyptest-prune-targets.py
diff --git a/test/prune_targets/gyptest-prune-targets.py b/test/prune_targets/gyptest-prune-targets.py
new file mode 100644
index 0000000000000000000000000000000000000000..c0e91e4a2d4ed5511a18056bb4c7692d24f151d0
--- /dev/null
+++ b/test/prune_targets/gyptest-prune-targets.py
@@ -0,0 +1,55 @@
+#!/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 --target removes the unnecessary targets.
+"""
+
+import TestGyp
+
+test = TestGyp.TestGyp()
+
+# By default, everything will be included.
+test.run_gyp('test1.gyp')
+test.build('test1.gyp', 'lib1')
+test.build('test1.gyp', 'lib2')
+test.build('test1.gyp', 'lib3')
+test.build('test1.gyp', 'lib_indirect')
+test.build('test1.gyp', 'program1')
+test.build('test1.gyp', 'program2')
+test.build('test1.gyp', 'program3')
+
+# With deep dependencies of program1 only.
+test.run_gyp('test1.gyp', '--target=program1')
+test.build('test1.gyp', 'lib1')
+test.build('test1.gyp', 'lib2', status=[1,2], stderr=None)
+test.build('test1.gyp', 'lib3', status=[1,2], stderr=None)
+test.build('test1.gyp', 'lib_indirect')
+test.build('test1.gyp', 'program1')
+test.build('test1.gyp', 'program2', status=[1,2], stderr=None)
+test.build('test1.gyp', 'program3', status=[1,2], stderr=None)
+
+# With deep dependencies of program2 only.
+test.run_gyp('test1.gyp', '--target=program2')
+test.build('test1.gyp', 'lib1', status=[1,2], stderr=None)
+test.build('test1.gyp', 'lib2')
+test.build('test1.gyp', 'lib3', status=[1,2], stderr=None)
+test.build('test1.gyp', 'lib_indirect')
+test.build('test1.gyp', 'program1', status=[1,2], stderr=None)
+test.build('test1.gyp', 'program2')
+test.build('test1.gyp', 'program3', status=[1,2], stderr=None)
+
+# With deep dependencies of program1 and program2.
+test.run_gyp('test1.gyp', '--target=program1', '--target=program2')
+test.build('test1.gyp', 'lib1')
+test.build('test1.gyp', 'lib2')
+test.build('test1.gyp', 'lib3', status=[1,2], stderr=None)
+test.build('test1.gyp', 'lib_indirect')
+test.build('test1.gyp', 'program1')
+test.build('test1.gyp', 'program2')
+test.build('test1.gyp', 'program3', status=[1,2], stderr=None)
+
+test.pass_test()

Powered by Google App Engine
This is Rietveld 408576698