Skip to content

Commit

Permalink
Select tests from the unique list of test categories.
Browse files Browse the repository at this point in the history
Previously we were using the entire list of categories defined in
jobconfig.  For some cases (in particular, those making heavy use of the
run_concurrent option) which contain multiple entries for the same
category, this leads to a large number (N^2) costly comparisons.  We can
large avoid this by only checking the set, rather than list, of all
categories.

This change reduces the time taken by

$ testcode.py compare -q -c simple

for CASTEP 8.0 from 140s to 28s.
  • Loading branch information
James Spencer committed Feb 24, 2015
1 parent 58d9a6c commit 7ae3aa5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/testcode2/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ def select_tests(all_tests, test_categories, selected_categories, prefix=''):
tests = []
parent = lambda pdir, cdir: \
not os.path.relpath(cdir, start=pdir).startswith(os.pardir)
for cat in selected_categories:
for cat in compat.compat_set(selected_categories):
# test paths are relative to the config directory but absolute paths
# are stored .
found = False
Expand Down

0 comments on commit 7ae3aa5

Please sign in to comment.