Skip to content
This repository has been archived by the owner on Jan 13, 2022. It is now read-only.

Added optional filedir command line argument. If it is passed, it will ... #52

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 18 additions & 2 deletions huxley/cmdline.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import glob
import json
import os
import fnmatch
import sys
import threading

Expand Down Expand Up @@ -117,6 +118,13 @@ def run_test(record, playback_only, save_diff, new_screenshots, file, config, te
'flag',
'e'
),
filedir=plac.Annotation(
'Specify a directory for test files to use',
'option',
'd',
str,
metavar="DIR"
),
version=plac.Annotation(
'Get the current version',
'flag',
Expand All @@ -130,13 +138,21 @@ def _main(
playback_only=False,
concurrency=1,
save_diff=False,
version=False
version=False,
filedir=None
):
if version:
print 'Huxley ' + __version__
return ExitCodes.OK

testfiles = glob.glob(testfile)
matches = []
if filedir is not None:
for root, dirnames, filenames in os.walk(filedir):
for filename in fnmatch.filter(filenames, testfile):
matches.append(os.path.join(root, filename))
testfiles= matches
else:
testfiles = glob.glob(testfile)
if len(testfiles) == 0:
print 'no Huxleyfile found'
return ExitCodes.ERROR
Expand Down
2 changes: 1 addition & 1 deletion huxley/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.

__version__ = '0.5'
__version__ = '0.5.1'