mirror of
https://github.com/mongodb/mongo.git
synced 2024-11-30 17:10:48 +01:00
43 lines
1.3 KiB
JavaScript
43 lines
1.3 KiB
JavaScript
//
|
|
// simple runner to run toplevel tests in jstests
|
|
//
|
|
var files = listFiles("jstests");
|
|
|
|
var dummyDb = db.getSisterDB( "dummyDBdummydummy" );
|
|
|
|
dummyDb.getSisterDB( "admin" ).runCommand( "closeAllDatabases" );
|
|
prev = dummyDb.runCommand( "meminfo" );
|
|
|
|
print( "START : " + tojson( prev ) );
|
|
|
|
files.forEach(
|
|
function(x) {
|
|
|
|
if ( /_runner/.test(x.name) ||
|
|
/_lodeRunner/.test(x.name) ||
|
|
/jni/.test(x.name) ||
|
|
/eval/.test(x.name) ||
|
|
/where/.test(x.name) ||
|
|
! /\.js$/.test(x.name ) ){
|
|
print(" >>>>>>>>>>>>>>> skipping " + x.name);
|
|
return;
|
|
}
|
|
|
|
|
|
print(" *******************************************");
|
|
print(" Test : " + x.name + " ...");
|
|
print(" " + Date.timeFunc( function() { load(x.name); }, 1) + "ms");
|
|
|
|
assert( dummyDb.getSisterDB( "admin" ).runCommand( "closeAllDatabases" ).ok == 1 , "closeAllDatabases failed" );
|
|
var now = dummyDb.runCommand( "meminfo" );
|
|
if ( now.virtual > prev.virtual )
|
|
print( " LEAK : " + prev.virtual + " -->> " + now.virtual );
|
|
prev = now;
|
|
}
|
|
);
|
|
|
|
|
|
|
|
dummyDb.getSisterDB( "admin" ).runCommand( "closeAllDatabases" );
|
|
print( "END : " + tojson( dummyDb.runCommand( "meminfo" ) ) );
|