diff --git a/benchmark_gae_test.go b/benchmark_gae_test.go new file mode 100644 index 0000000..6ef4e11 --- /dev/null +++ b/benchmark_gae_test.go @@ -0,0 +1,30 @@ +// Copyright (c) 2012-2013 Jason McVetta. This is Free Software, released under +// the terms of the GPL v3. See http://www.gnu.org/copyleft/gpl.html for details. +// Resist intellectual serfdom - the ownership of ideas is akin to slavery. + +// +build appengine + +package neoism + +import ( + "log" + "testing" + + "appengine/aetest" +) + +func connectBench(b *testing.B) *Database { + gaeContext, err := aetest.NewContext(nil) + if err != nil { + b.Fatal(err) + } + defer gaeContext.Close() + + log.SetFlags(log.Ltime | log.Lshortfile) + db, err := Connect("http://localhost:7474/db/data", gaeContext) + + if err != nil { + b.Fatal(err) + } + return db +} diff --git a/benchmark_standalone_test.go b/benchmark_standalone_test.go new file mode 100644 index 0000000..24ffa97 --- /dev/null +++ b/benchmark_standalone_test.go @@ -0,0 +1,21 @@ +// Copyright (c) 2012-2013 Jason McVetta. This is Free Software, released under +// the terms of the GPL v3. See http://www.gnu.org/copyleft/gpl.html for details. +// Resist intellectual serfdom - the ownership of ideas is akin to slavery. + +// +build !appengine + +package neoism + +import ( + "log" + "testing" +) + +func connectBench(b *testing.B) *Database { + log.SetFlags(log.Ltime | log.Lshortfile) + db, err := Connect("http://localhost:7474/db/data") + if err != nil { + b.Fatal(err) + } + return db +}