visit
Before starting our testing we consider how to install MariaDB properly. Because usual installation from the .exe
file using Windows installer is not useful for performing any kind of testing. We need to install it in debug mode. I'd like to explain that on the Windows platform which is the most popular in the world.
mkdir Test
cd Test
git init
git clone -b mariadb-10.5.15 //github.com/MariaDB/server.git
Now you downloaded the source code from the repository.
And then you need to move to the server folder, create a new folder bld
and move to it:
cd server
mkdir bld
cd bld
cmake ..
The build is finished:
The final step will be building Debug version. The installation will take a few minutes. It depends on your internet connection.
cmake --build . --config Debug
You should use the extension .test
then you are saving your test and put it in the folder c:\Test\server\mysql-test\main
But running out of our tests we will in the next path: c:\Test\server\bld\mysql-test
Open notepad and write our first test with the next code:
--echo #
--echo # Test #00001: avarage
--echo #
create table t1 (
pk int primary key,
height int
);
insert into t1 values
(0,9),
(1,5),
(2,4);
show create table t1;
select avg(height) from t1;
drop table t1;
Now we should save this file with extension .test
in my way, it will be sergei.test
mysql-test-run.pl sergei.test
Our test passed because no error in MariaDB and no error in the test script. Sometimes we need to record our results. Simple. Just run the test with the record option:
mysql-test-run.pl sergei.test --record
It will create another file with an extension .result
in the same directory as the test file with the same name. In my case it is sergei.result