Skip to content

Commit

Permalink
Handle all cases of the function parameter in sct_testing (#1310)
Browse files Browse the repository at this point in the history
The previous solution introduced a regression bug. This corrects the regression

Fixes #473
  • Loading branch information
peristeri committed May 10, 2017
1 parent 2b29289 commit 4e2e4da
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions scripts/sct_testing.py
Expand Up @@ -97,11 +97,13 @@ def main(args=None):

# get list of all scripts to test
functions = fill_functions()
if not function_to_test in functions:
sct.printv('Function "%s" is not part of the list of testing functions' % function_to_test, type='warning')

# loop across all functions and test them
status = [test_function(f) for f in functions if function_to_test == f]
if function_to_test:
if not function_to_test in functions:
sct.printv('Function "%s" is not part of the list of testing functions' % function_to_test, type='warning')
# loop across all functions and test them
status = [test_function(f) for f in functions if function_to_test == f]
else:
status = [test_function(f) for f in functions]
print 'status: ' + str(status)

# display elapsed time
Expand Down

0 comments on commit 4e2e4da

Please sign in to comment.