MySQL Test Creator
Contents |
[edit] Synopsis
MySQL Test Creator is a tool to create test scripts while using a database normally.
The ideal case would be that you use the database in your favorite tool, and see the result on the screen immediately
mysql> start; # This is a macro from the magic tool Query OK, 0 rows affected (0.00 sec) mysql> drop table if exists t1; Query OK, 0 rows affected, 1 warning (0.00 sec) mysql> create table t1 (id int, c char(10)); Query OK, 0 rows affected (0.02 sec) mysql> insert into t1 values (1,'a'), (2,'b'); Query OK, 2 rows affected (0.00 sec) Records: 2 Duplicates: 0 Warnings: 0 mysql> select * from t1; +------+------+ | id | c | +------+------+ | 1 | a | | 2 | b | +------+------+ 2 rows in set (0.01 sec) mysql> stop; # another macro. The tool stops recording now Query OK, 0 rows affected (0.01 sec) mysql> exit
And in the background there is something that creates both the test and the result scripts, ready to plug to the test suite.
$ cat creator.test --disable_warnings DROP TABLES if exists t1; --enable_warnings create table t1 (id int, c char(10)); insert into t1 values (1), (2); insert into t1 values (1,'a'), (2,'b'); select * from t1; $ cat creator.result DROP TABLES if exists t1; create table t1 (id int, c char(10)); insert into t1 values (1,'a'), (2,'b'); select * from t1; id c 1 a 2 b
[edit] Project
The MySQL Test Creator Project is part of the Summer of Code effort.