25
25
Tool used for executing a .test file
27
See the "DRIZZLE Test framework manual" for more information
28
http://dev.mysql.com/doc/drizzletest/en/index.html
27
See the "MySQL Test framework manual" for more information
28
http://dev.mysql.com/doc/mysqltest/en/index.html
30
30
Please keep the test framework tools identical in all versions!
82
82
#define PTR_BYTE_DIFF(A,B) (ptrdiff_t) (reinterpret_cast<const unsigned char*>(A) - reinterpret_cast<const unsigned char*>(B))
84
#ifndef DRIZZLE_RETURN_SERVER_GONE
85
#define DRIZZLE_RETURN_HANDSHAKE_FAILED DRIZZLE_RETURN_ERROR_CODE
87
84
namespace po= boost::program_options;
88
85
using namespace std;
89
86
using namespace drizzled;
4579
4576
returned a valid reponse. Don't allow 2013 or 2006 to trigger an
4580
4577
abort_not_supported_test
4582
if (err_errno == DRIZZLE_RETURN_SERVER_GONE)
4579
if (err_errno == DRIZZLE_RETURN_LOST_CONNECTION)
4583
4580
die("require query '%s' failed: %d: %s", command->query, err_errno, err_error);
4585
4582
/* Abort the run of this test, pass the failed query as reason */
4992
4989
if (user_config_dir.compare(0, 2, "~/") == 0)
4994
const char *homedir= getenv("HOME");
4995
if (homedir != NULL)
4991
if (const char *homedir= getenv("HOME"))
4996
4992
user_config_dir.replace(0, 1, homedir);
5498
5494
Time to compare result or save it to record file.
5499
5495
The entire output from test is now kept in ds_res.
5501
if (ds_res.length())
5503
if (not result_file_name.empty())
5505
/* A result file has been specified */
5509
/* Recording - dump the output from test to result file */
5510
str_to_file(result_file_name.c_str(), ds_res.c_str(), ds_res.length());
5514
/* Check that the output from test is equal to result file
5515
- detect missing result file
5516
- detect zero size result file
5518
check_result(ds_res);
5523
/* No result_file_name specified to compare with, print to stdout */
5524
printf("%s", ds_res.c_str());
5529
5498
die("The test didn't produce any output");
5499
if (result_file_name.empty())
5501
/* No result_file_name specified to compare with, print to stdout */
5502
printf("%s", ds_res.c_str());
5506
/* Recording - dump the output from test to result file */
5507
str_to_file(result_file_name.c_str(), ds_res.c_str(), ds_res.length());
5511
/* Check that the output from test is equal to result file
5512
- detect missing result file
5513
- detect zero size result file
5515
check_result(ds_res);
5532
5518
struct stat res_info;
5533
if (!command_executed && not result_file_name.empty() && not stat(result_file_name.c_str(), &res_info))
5519
if (not command_executed && not result_file_name.empty() && not stat(result_file_name.c_str(), &res_info))
5536
5522
my_stat() successful on result file. Check if we have not run a