sort "CMDTEST_*.rb" files alphabetically

by sorting the result of Dir.glob().
This should make "CMDTEST_*.rb" being run in a well defined order.
This commit is contained in:
Johan Holmberg
2017-02-28 10:24:27 +01:00
parent fe5dbe704e
commit 04c31df479
2 changed files with 62 additions and 3 deletions

View File

@ -492,6 +492,10 @@ module Cmdtest
private
def _sorted_glob(str)
Dir.glob(str).sort
end
def _fs_test_filenames
if ! @argv.empty?
files = _expand_files_or_dirs(@argv)
@ -502,13 +506,13 @@ module Cmdtest
return files
end
try = Dir.glob("t/CMDTEST_*.rb")
try = _sorted_glob("t/CMDTEST_*.rb")
return try if ! try.empty?
try = Dir.glob("test/CMDTEST_*.rb")
try = _sorted_glob("test/CMDTEST_*.rb")
return try if ! try.empty?
try = Dir.glob("CMDTEST_*.rb")
try = _sorted_glob("CMDTEST_*.rb")
return try if ! try.empty?
puts "ERROR: no CMDTEST_*.rb files found"