Final cleanups.

This commit is contained in:
Alex Miller 2020-07-12 19:53:44 -07:00
parent 0a8f61b967
commit eb7ad07df0
2 changed files with 8 additions and 7 deletions

View File

@ -81,7 +81,7 @@ function(add_fdb_test)
set(test_type "test")
endif()
list(GET ADD_FDB_TEST_TEST_FILES 0 first_file)
string(REGEX REPLACE "^(.*)\\.txt$" "\\1" test_name ${first_file})
string(REGEX REPLACE "^(.*)\\.(txt|toml)$" "\\1" test_name ${first_file})
if("${test_name}" MATCHES "(-\\d)$")
string(REGEX REPLACE "(.*)(-\\d)$" "\\1" test_name_1 ${test_name})
message(STATUS "new testname ${test_name_1}")

View File

@ -18,12 +18,13 @@
* limitations under the License.
*/
#include <boost/algorithm/string/predicate.hpp>
#include <cinttypes>
#include <fstream>
#include <functional>
#include <map>
#include <boost/algorithm/string/predicate.hpp>
#include <toml.hpp>
#include "flow/ActorCollection.h"
#include "fdbrpc/sim_validation.h"
#include "fdbrpc/simulator.h"
@ -871,11 +872,6 @@ ACTOR Future<bool> runTest( Database cx, std::vector< TesterInterface > testers,
return ok;
}
std::vector<TestSpec> readTOMLTests( ifstream& ifs ) {
const toml::value file = toml::parse(ifs);
return {};
}
std::map<std::string, std::function<void(const std::string&)>> testSpecGlobalKeys = {
// These are read by SimulatedCluster and used before testers exist. Thus, they must
// be recognized and accepted, but there's no point in placing them into a testSpec.
@ -1353,7 +1349,12 @@ ACTOR Future<Void> runTests( Reference<ClusterConnectionFile> connFile, test_typ
if ( boost::algorithm::ends_with(fileName, ".txt") ) {
testSpecs = readTests( ifs );
} else if ( boost::algorithm::ends_with(fileName, ".toml") ) {
// TOML is weird about opening the file as binary on windows, so we
// just let TOML re-open the file instead of using ifs.
testSpecs = readTOMLTests( fileName );
} else {
TraceEvent(SevError, "TestHarnessFail").detail("Reason", "unknown tests specification extension").detail("File", fileName.c_str());
return Void();
}
ifs.close();
}