branch: elpa/emacsql commit 1b5891298ae5f9b9146ef717d9101f85879f0624 Author: Christopher Wellons <well...@nullprogram.com> Commit: Christopher Wellons <well...@nullprogram.com>
Officially add MySQL to unit testing. --- README.md | 9 +++++++-- tests/emacsql-external-tests.el | 6 +++++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 28e6cdeb6c..e7381553ba 100644 --- a/README.md +++ b/README.md @@ -310,8 +310,13 @@ and unit testing. make test If the environment variable `PGDATABASE` is present then the unit -tests will also be run with PostgreSQL in addition to SQLite. Also -provide `PGHOST`, `PGPORT`, and `PGUSER` if needed. +tests will also be run with PostgreSQL. Also provide `PGHOST`, +`PGPORT`, and `PGUSER` if needed. + +If the environment variable `MYSQL_DBNAME` is present then the unit +tests will also be run with MySQL in the named database. Note that +this is not an official MySQL variable, just something made up for +Emacsql. ### Creating a New Front-end diff --git a/tests/emacsql-external-tests.el b/tests/emacsql-external-tests.el index 1438a219bc..8e3ef5d793 100644 --- a/tests/emacsql-external-tests.el +++ b/tests/emacsql-external-tests.el @@ -12,11 +12,15 @@ (defvar emacsql-tests-connection-factories (let ((factories ()) - (pgdatabase (getenv "PGDATABASE"))) + (pgdatabase (getenv "PGDATABASE")) + (mysql-dbname (getenv "MYSQL_DBNAME"))) (push (cons "sqlite" (apply-partially #'emacsql-sqlite nil)) factories) (when pgdatabase (push (cons "psql" (apply-partially #'emacsql-psql pgdatabase)) factories)) + (when mysql-dbname + (push (cons "mysql" (apply-partially #'emacsql-mysql mysql-dbname)) + factories)) (nreverse factories)) "List of connection factories to use in unit tests.")