Skip to content

Commit

Permalink
Merge branch 'master' of git@github.com:mongodb/mongo
Browse files Browse the repository at this point in the history
  • Loading branch information
dwight committed Sep 18, 2009
2 parents 926eecc + 9780f30 commit 696f6ca
Show file tree
Hide file tree
Showing 26 changed files with 470 additions and 182 deletions.
15 changes: 1 addition & 14 deletions README
Expand Up @@ -16,19 +16,6 @@ BUILDING

http://www.mongodb.org/display/DOCS/Building


- Pre-requisite for 'test' binary, the MongoDB unit test suite:
This is not required for building or running the database

To compile the unit tests, you need to install the unit test framework from:
http://unittest.red-bean.com/

$ cd ..
$ svn co http://svn.red-bean.com/unittest/trunk/ unittest
$ cd unittest
$ ./configure
$ make
$ sudo make install

- Then use scons to build.

Expand All @@ -41,7 +28,7 @@ BUILDING
$ scons

To install

$ scons --prefix=/opt/mongo install

RUNNING
Expand Down
16 changes: 0 additions & 16 deletions bin/buildDeps

This file was deleted.

17 changes: 0 additions & 17 deletions bin/run.tcsh

This file was deleted.

3 changes: 0 additions & 3 deletions bin/start.tcsh

This file was deleted.

4 changes: 3 additions & 1 deletion db/dbcommands.cpp
Expand Up @@ -1250,6 +1250,8 @@ namespace mongo {
if ( n == 0 ){
n = map.size();
s->setObject( "$key" , key , true );

uassert( "group() can't handle more than 10000 unique keys" , n < 10000 );
}

s->setObject( "obj" , obj , true );
Expand All @@ -1258,7 +1260,7 @@ namespace mongo {
throw UserException( (string)"reduce invoke failed: " + s->getError() );
}
}

if (!finalize.empty()){
s->exec( "$finalize = " + finalize , "finalize define" , false , true , true , 100 );
ScriptingFunction g = s->createFunction(
Expand Down
10 changes: 5 additions & 5 deletions dbtests/basictests.cpp
Expand Up @@ -49,13 +49,13 @@ namespace BasicTests {

class All : public Suite {
public:
All() {
All() : Suite( "basic" ){
}

void setupTests(){
add< Rarely >();
}
};
} myall;

} // namespace BasicTests

UnitTest::TestPtr basicTests() {
return UnitTest::createSuite< BasicTests::All >();
}
12 changes: 6 additions & 6 deletions dbtests/btreetests.cpp
Expand Up @@ -213,19 +213,19 @@ namespace BtreeTests {
}
};

class All : public UnitTest::Suite {
class All : public Suite {
public:
All() {
All() : Suite( "btree" ){
}

void setupTests(){
add< Create >();
add< SimpleInsertDelete >();
add< SplitRightHeavyBucket >();
add< SplitLeftHeavyBucket >();
add< MissingLocate >();
add< MissingLocateMultiBucket >();
}
};
} myall;
}

UnitTest::TestPtr btreeTests() {
return UnitTest::createSuite< BtreeTests::All >();
}
12 changes: 5 additions & 7 deletions dbtests/cursortests.cpp
Expand Up @@ -194,18 +194,16 @@ namespace CursorTests {

} // namespace MultiBtreeCursorTests

class All : public ::Suite {
class All : public Suite {
public:
All() {
All() : Suite( "cursor" ){}

void setupTests(){
add< IdSetTests::BasicSize >();
add< IdSetTests::Upgrade >();
add< BtreeCursorTests::MultiRange >();
add< BtreeCursorTests::MultiRangeGap >();
add< BtreeCursorTests::MultiRangeReverse >();
}
};
} myall;
} // namespace CursorTests

UnitTest::TestPtr cursorTests() {
return UnitTest::createSuite< CursorTests::All >();
}
35 changes: 5 additions & 30 deletions dbtests/dbtests.cpp
Expand Up @@ -22,8 +22,6 @@
#include "../db/instance.h"
#include "../util/file_allocator.h"

#include <unittest/Registry.hpp>

#if !defined(_WIN32)
#include <sys/file.h>
#endif
Expand All @@ -34,14 +32,10 @@ using namespace std;

namespace mongo {
extern string dbpath;
} // namespace mongo
string dbpathSpec = "/tmp/unittest/";

Suite::~Suite() {
DBDirectClient c;
c.dropDatabase( "unittests" );
}

string dbpathSpec = "/tmp/unittest/";

void usage() {
string instructions =
"dbtests usage:\n"
Expand Down Expand Up @@ -97,29 +91,10 @@ int main( int argc, char** argv ) {
out() << "random seed: " << seed << endl;

theFileAllocator().start();


UnitTest::Registry tests;

// NOTE Starting JNI changes global state (for example, locale and FPU precision);
// make sure all tests run with this setup, by running javajs tests first.
tests.add( jsTests(), "js" );

tests.add( basicTests(), "basic" );
tests.add( btreeTests(), "btree" );
tests.add( cursorTests(), "cursor" );
tests.add( jsobjTests(), "jsobj" );
tests.add( jsonTests(), "json" );
tests.add( matcherTests(), "matcher" );
tests.add( namespaceTests(), "namespace" );
tests.add( pairingTests(), "pairing" );
tests.add( pdfileTests(), "pdfile" );
tests.add( queryTests(), "query" );
tests.add( queryOptimizerTests(), "queryoptimizer" );
tests.add( replTests(), "repl" );
tests.add( sockTests(), "sock" );
tests.add( updateTests(), "update" );

int ret = tests.run( argc, argv );

int ret = mongo::regression::Suite::run( argc, argv );

#if !defined(_WIN32) && !defined(__sunos__)
flock( lockFile, LOCK_UN );
Expand Down
24 changes: 2 additions & 22 deletions dbtests/dbtests.h
Expand Up @@ -17,28 +17,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#include <unittest/UnitTest.hpp>
#include "framework.h"

using namespace mongo;
using namespace mongo::regression;

// Utility class to handle per suite cleanup
class Suite : public UnitTest::Suite {
public:
~Suite();
};

UnitTest::TestPtr basicTests();
UnitTest::TestPtr btreeTests();
UnitTest::TestPtr cursorTests();
UnitTest::TestPtr jsTests();
UnitTest::TestPtr jsobjTests();
UnitTest::TestPtr jsonTests();
UnitTest::TestPtr matcherTests();
UnitTest::TestPtr namespaceTests();
UnitTest::TestPtr pairingTests();
UnitTest::TestPtr pdfileTests();
UnitTest::TestPtr queryTests();
UnitTest::TestPtr queryOptimizerTests();
UnitTest::TestPtr replTests();
UnitTest::TestPtr sockTests();
UnitTest::TestPtr updateTests();

0 comments on commit 696f6ca

Please sign in to comment.