1
0
Fork 0

- List the right available test cases for single client/server

- use our runInArangosh function instead of copying the code
 - only start an arangod if we know that we will try to run a test.
This commit is contained in:
Willi Goesgens 2014-10-16 12:10:34 +02:00
parent a3bb132fb1
commit 9e01c41c2a
1 changed files with 11 additions and 17 deletions

View File

@ -641,13 +641,13 @@ function performTests(options, testList, testname) {
return results;
}
function single_usage(testsuite) {
function single_usage (testsuite, list) {
print("single_" + testsuite + ": No test specified!\n Available tests:");
var filelist = "";
var list = fs.list(makePath("js/server/tests"));
for (var fileNo in list) {
if (/\.js$/.test(list[fileNo])) {
filelist += " js/server/tests/"+list[fileNo];
filelist += " " + list[fileNo];
}
}
print(filelist);
@ -658,9 +658,9 @@ function single_usage(testsuite) {
testFuncs.single_server = function (options) {
var instanceInfo = startInstance("tcp", options, [], "single_server");
var result = { };
if (options.test !== undefined) {
var instanceInfo = startInstance("tcp", options, [], "single_server");
var te = options.test;
print("\nTrying",te,"on server...");
result = {};
@ -671,32 +671,26 @@ testFuncs.single_server = function (options) {
return result;
}
else {
return single_usage("server");
findTests();
return single_usage("server", tests_shell_server);
}
};
testFuncs.single_client = function (options) {
var instanceInfo = startInstance("tcp", options, [], "single_client");
var result = { };
if (options.test !== undefined) {
var instanceInfo = startInstance("tcp", options, [], "single_client");
var te = options.test;
var topDir = findTopDir();
var args = makeTestingArgsClient(options);
args.push("--server.endpoint");
args.push(instanceInfo.endpoint);
args.push("--javascript.unit-tests");
args.push(fs.join(topDir,te));
print("\nTrying",te,"on client...");
var arangosh = fs.join("bin","arangosh");
result = {};
result[te] = executeAndWait(arangosh, args);
print("\nTrying ",te," on client...");
result[te] = runInArangosh(options, instanceInfo, te);
print("Shutting down...");
shutdownInstance(instanceInfo,options);
print("done.");
return result;
}
else {
return single_usage("client");
findTests();
return single_usage("client", tests_shell_client);
}
};