diff options
author | John Hodge <tpg@ucc.asn.au> | 2017-11-25 15:46:40 +0800 |
---|---|---|
committer | John Hodge <tpg@ucc.asn.au> | 2017-11-25 15:46:40 +0800 |
commit | 2196e071b7657d39f561bccc91fa9170a7fe57b4 (patch) | |
tree | 785a0235aba64ffab5634f639798926a808dca63 /tools | |
parent | e317059743ac8ff8b2dfced629e84c0fc220c1b0 (diff) | |
download | mrust-2196e071b7657d39f561bccc91fa9170a7fe57b4.tar.gz |
testrunner - Sort tests before running
Diffstat (limited to 'tools')
-rw-r--r-- | tools/testrunner/main.cpp | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/tools/testrunner/main.cpp b/tools/testrunner/main.cpp index 067a63e3..1bdec235 100644 --- a/tools/testrunner/main.cpp +++ b/tools/testrunner/main.cpp @@ -244,12 +244,21 @@ int main(int argc, const char* argv[]) td.m_path = test_file_path; tests.push_back(td); +#ifndef _WIN32 + } + closedir(dp); +#else + } while( FindNextFile(find_handle, &find_data) ); + FindClose(find_handle); +#endif - // --- - - auto test = td; + // Sort tests before running + ::std::sort(tests.begin(), tests.end(), [](const auto& a, const auto& b){ return a.m_name < b.m_name; }); - if( ::std::find(skip_list.begin(), skip_list.end(), td.m_name) != skip_list.end() ) + // --- + for(const auto& test : tests) + { + if( ::std::find(skip_list.begin(), skip_list.end(), test.m_name) != skip_list.end() ) { DEBUG(">> SKIP " << test.m_name); continue ; @@ -285,13 +294,7 @@ int main(int argc, const char* argv[]) DEBUG("RUN FAIL " << test.m_name); return 1; } -#ifndef _WIN32 } - closedir(dp); -#else - } while( FindNextFile(find_handle, &find_data) ); - FindClose(find_handle); -#endif } return 0; |