github.com/agilebits/godog@v0.7.9/examples/db/Makefile (about) 1 2 define DB_SQL 3 CREATE TABLE users ( 4 `id` BIGINT UNSIGNED AUTO_INCREMENT NOT NULL, 5 `username` VARCHAR(32) NOT NULL, 6 `email` VARCHAR(255) NOT NULL, 7 PRIMARY KEY (`id`), 8 UNIQUE INDEX `uniq_email` (`email`) 9 ) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB; 10 endef 11 12 export DB_SQL 13 14 SQL := "$$DB_SQL" 15 16 test: 17 mysql -u root -e 'DROP DATABASE IF EXISTS `godog_test`' 18 mysql -u root -e 'CREATE DATABASE IF NOT EXISTS `godog_test`' 19 @mysql -u root godog_test -e $(SQL) 20 godog users.feature 21 22 .PHONY: test