0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-11-30 17:10:48 +01:00

Merge branch 'master' of git@github.com:mongodb/mongo

This commit is contained in:
Aaron 2009-02-20 11:08:35 -05:00
commit cf2a7284d1
4 changed files with 60 additions and 25 deletions

View File

@ -3,7 +3,7 @@
// //
var files = listFiles("jstests"); var files = listFiles("jstests");
db.runCommand( "closeAllDatabases" ); db.getSisterDB( "admin" ).runCommand( "closeAllDatabases" );
prev = db.runCommand( "meminfo" ); prev = db.runCommand( "meminfo" );
print( "START : " + tojson( prev ) ); print( "START : " + tojson( prev ) );
@ -33,5 +33,5 @@ files.forEach(
db.runCommand( "closeAllDatabases" ); db.getSisterDB( "admin" ).runCommand( "closeAllDatabases" );
print( "END : " + tojson( db.runCommand( "meminfo" ) ) ); print( "END : " + tojson( db.runCommand( "meminfo" ) ) );

View File

@ -0,0 +1,40 @@
//
// simple runner to run toplevel tests in jstests
//
var files = listFiles("jstests");
db.getSisterDB( "admin" ).runCommand( "closeAllDatabases" );
prev = db.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( db.getSisterDB( "admin" ).runCommand( "closeAllDatabases" ).ok == 1 , "closeAllDatabases failed" );
var now = db.runCommand( "meminfo" );
if ( now.virtual > prev.virtual )
print( " LEAK : " + prev.virtual + " -->> " + now.virtual );
prev = now;
}
);
db.getSisterDB( "admin" ).runCommand( "closeAllDatabases" );
print( "END : " + tojson( db.runCommand( "meminfo" ) ) );

View File

@ -68,26 +68,3 @@ assert( asserted );
dd( "g" ); dd( "g" );
/*
* dbEval tested via collections count function
*/
/*
* db group
*/
db.getCollection( "test" ).drop();
db.getCollection( "test" ).save({a:1});
db.getCollection( "test" ).save({a:1});
var f = db.group(
{
ns: "test",
key: { a:true},
cond: { a:1 },
reduce: function(obj,prev) { prev.csum++; } ,
initial: { csum: 0}
}
);
assert(f[0].a == 1 && f[0].csum == 2);

18
jstests/eval2.js Normal file
View File

@ -0,0 +1,18 @@
t = db.test;
t.drop();
t.save({a:1});
t.save({a:1});
var f = db.group(
{
ns: "test",
key: { a:true},
cond: { a:1 },
reduce: function(obj,prev) { prev.csum++; } ,
initial: { csum: 0}
}
);
assert(f[0].a == 1 && f[0].csum == 2);