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

Unified Diff: pylib/gyp/system_test.py

Issue 10990023: make: drop all system tests (Closed) Base URL: http://git.chromium.org/external/gyp.git@master
Patch Set: Created 8 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
« no previous file with comments | « pylib/gyp/generator/ninja.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pylib/gyp/system_test.py
diff --git a/pylib/gyp/system_test.py b/pylib/gyp/system_test.py
deleted file mode 100755
index 51c71e36bee97fc2fef4f5eefbe8035b933bce46..0000000000000000000000000000000000000000
--- a/pylib/gyp/system_test.py
+++ /dev/null
@@ -1,68 +0,0 @@
-#!/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.
-
-import os
-import tempfile
-import shutil
-import subprocess
-
-
-def TestCommands(commands, files={}, env={}):
- """Run commands in a temporary directory, returning true if they all succeed.
- Return false on failures or if any commands produce output.
-
- Arguments:
- commands: an array of shell-interpretable commands, e.g. ['ls -l', 'pwd']
- each will be expanded with Python %-expansion using env first.
- files: a dictionary mapping filename to contents;
- files will be created in the temporary directory before running
- the command.
- env: a dictionary of strings to expand commands with.
- """
- tempdir = tempfile.mkdtemp()
- try:
- for name, contents in files.items():
- f = open(os.path.join(tempdir, name), 'wb')
- f.write(contents)
- f.close()
- for command in commands:
- proc = subprocess.Popen(command % env, shell=True,
- stdout=subprocess.PIPE,
- stderr=subprocess.STDOUT,
- cwd=tempdir)
- output = proc.communicate()[0]
- if proc.returncode != 0 or output:
- return False
- return True
- finally:
- shutil.rmtree(tempdir)
- return False
-
-
-def TestArSupportsT(ar_command='ar', cc_command='cc'):
- """Test whether 'ar' supports the 'T' flag."""
- return TestCommands(['%(cc)s -c test.c',
- '%(ar)s crsT test.a test.o',
- '%(cc)s test.a'],
- files={'test.c': 'int main(){}'},
- env={'ar': ar_command, 'cc': cc_command})
-
-
-def main():
- # Run the various test functions and print the results.
- def RunTest(description, function, **kwargs):
- print "Testing " + description + ':',
- if function(**kwargs):
- print 'ok'
- else:
- print 'fail'
- RunTest("ar 'T' flag", TestArSupportsT)
- RunTest("ar 'T' flag with ccache", TestArSupportsT, cc_command='ccache cc')
- return 0
-
-
-if __name__ == '__main__':
- sys.exit(main())
« no previous file with comments | « pylib/gyp/generator/ninja.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698