forked from webrtc/apprtc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Patrik Höglund
committed
Feb 18, 2015
1 parent
ff6ad6b
commit b6bd113
Showing
4 changed files
with
60 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/usr/bin/python | ||
|
||
import optparse | ||
import sys | ||
|
||
import test_file_herder | ||
|
||
|
||
def main(): | ||
parser = optparse.OptionParser('Usage: %prog path_to_tests') | ||
_, args = parser.parse_args() | ||
if len(args) != 1: | ||
parser.error('Expected precisely one argument.') | ||
|
||
return test_file_herder.RemoveTests(args[0]) | ||
|
||
if __name__ == '__main__': | ||
sys.exit(main()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/usr/bin/python | ||
|
||
"""Copies and deletes tests.""" | ||
|
||
import os | ||
import shutil | ||
|
||
|
||
def _IsPythonTest(filename): | ||
return 'test' in filename and filename.endswith('.py') | ||
|
||
|
||
def CopyTests(src_path, dest_path): | ||
if not os.path.exists(src_path): | ||
raise Exception('Failed to copy tests from %s; does not exist.' % src_path) | ||
|
||
for dirpath, _, files in os.walk(src_path): | ||
tests = [name for name in files if _IsPythonTest(name)] | ||
for test in tests: | ||
shutil.copy(os.path.join(dirpath, test), dest_path) | ||
|
||
|
||
def RemoveTests(path): | ||
if not os.path.exists(path): | ||
raise Exception('Failed to remove tests from %s; does not exist.' % path) | ||
|
||
for dirpath, _, files in os.walk(path): | ||
tests = [name for name in files if _IsPythonTest(name)] | ||
for test in tests: | ||
to_remove = os.path.join(dirpath, test) | ||
print 'Removing %s.' % to_remove | ||
os.remove(to_remove) |