Permalink
Browse files

move tests to the tests/ directory

  • Loading branch information...
1 parent 6357f7d commit f6165b413433727827895e4375e5044e22f8ac17 @orlandov committed Mar 29, 2010
View
@@ -1,18 +0,0 @@
-#!/usr/bin/python
-# Wait for changes to relevant files, then compile and run test. And
-# do this forever.
-
-import os, sys, time
-
-filenames = ["sqlite3_bindings.cc", "wscript", "sqlite.js", "test.js"]
-
-mtime = []
-while True:
- m = [os.stat(filename).st_mtime for filename in filenames]
- if mtime != m:
- os.system("clear; rm -f test.db")
- os.system("node-waf build && node test.js && sleep 1 && sqlite3 test.db .dump");
- mtime = m
-
- time.sleep(1)
-
View
@@ -1,18 +0,0 @@
--- Used to create mydatabase.db
-
-CREATE TABLE foo (
- bar TEXT,
- baz INT
-);
-
-INSERT INTO foo (bar, baz) VALUES ('hello', 0);
-INSERT INTO foo (bar, baz) VALUES ('world', 1);
-INSERT INTO foo (bar, baz) VALUES ('shazbot', 2);
-INSERT INTO foo (bar, baz) VALUES ('shazbot', 3);
-INSERT INTO foo (bar, baz) VALUES ('shazbot', 4);
-INSERT INTO foo (bar, baz) VALUES ('shazbot', 5);
-INSERT INTO foo (bar, baz) VALUES ('shazbot', 6);
-INSERT INTO foo (bar, baz) VALUES ('shazbot', 7);
-INSERT INTO foo (bar, baz) VALUES ('shazbot', 8);
-INSERT INTO foo (bar, baz) VALUES ('shazbot', 9);
-INSERT INTO foo (bar, baz) VALUES ('shazbot', 10);
Binary file not shown.
View
Binary file not shown.
@@ -1,4 +1,4 @@
-var sqlite = require('./sqlite3_bindings');
+var sqlite = require('../sqlite3_bindings');
var sys = require('sys');
var puts = sys.puts;
File renamed without changes.
@@ -1,6 +1,6 @@
var fs = require("fs"),
sys = require("sys"),
- sqlite = require("./sqlite");
+ sqlite = require("../sqlite");
var puts = sys.puts;
var inspect = sys.inspect;
View
@@ -0,0 +1,24 @@
+require 'sqlite3'
+
+db = SQLite3::Database.new(":memory:")
+
+
+db.execute("CREATE TABLE t1 (alpha INTEGER)") do |row|
+
+end
+
+count = 1000000;
+
+t0 = Time.new;
+1.upto(count) do
+ db.execute("INSERT INTO t1 VALUES (1)") do
+ end
+end
+d = Time.new - t0;
+puts "Took #{d}s (#{count/d} inserts/s)";
+
+t0 = Time.new;
+db.execute("SELECT * FROM t1") do |row|
+end
+d = Time.new - t0;
+puts "Took #{d} (#{count/d} rows/s)";
File renamed without changes.
View
@@ -0,0 +1,24 @@
+require 'sqlite3'
+
+db = SQLite3::Database.new(":memory:")
+
+
+db.execute("CREATE TABLE t1 (alpha INTEGER, beta TEXT, pi FLOAT)") do |row|
+
+end
+
+count = 100000;
+
+t0 = Time.new;
+1.upto(count) do
+ db.execute("INSERT INTO t1 VALUES (1, 'hello', 3.141)") do
+ end
+end
+d = Time.new - t0;
+puts "Took #{d}s (#{count/d} inserts/s)";
+
+t0 = Time.new;
+db.execute("SELECT * FROM t1") do |row|
+end
+d = Time.new - t0;
+puts "Took #{d} (#{count/d} rows/s)";
File renamed without changes.
File renamed without changes.

0 comments on commit f6165b4

Please sign in to comment.