pingcap / mysql-tester

A Golang implementation of MySQL Test Framework
Apache License 2.0
61 stars 62 forks source link

Add support for the source command #128

Open dveeden opened 1 month ago

dveeden commented 1 month ago
dvaneeden@dve-carbon:~/dev/pingcap/mysql-tester$ cat t/source.test 
--echo first line
--source include/hello.inc
--echo last line
dvaneeden@dve-carbon:~/dev/pingcap/mysql-tester$ cat include/hello.inc 
--echo Hello from the included file
dvaneeden@dve-carbon:~/dev/pingcap/mysql-tester$ cat r/source.result 
first line
Hello from the included file
last line

Related:

Existing tests

This disables --source by default and emits a warning like this:

WARN[0000] source command disabled, add '--enable_source' to your file to enable  line="./t/source.test:8"

So when porting tests one has to add --enable-source to the top of the file. It would probably good to change this in the future to make it enabled by default and require --disable-source to disable it for files where it breaks (or remove /fix the --source lines)