Below is the list of changes that have just been committed into a local
5.1 repository of mkindahl. When mkindahl does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet@stripped, 2006-08-29 09:41:21+02:00, mkindahl@stripped +1 -0
More robust check for the existance of the __attribute__ existance.
unittest/mytap/tap.h@stripped, 2006-08-29 09:41:14+02:00, mkindahl@stripped +31 -5
More robust definition of __attribute__ for platforms that does not have it.
Whitespace changes and new comments.
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: mkindahl
# Host: dl145h.mysql.com
# Root: /users/mkindahl/mysql-5.1-new-rpl
--- 1.7/unittest/mytap/tap.h 2006-08-29 09:41:48 +02:00
+++ 1.8/unittest/mytap/tap.h 2006-08-29 09:41:48 +02:00
@@ -21,14 +21,20 @@
#ifndef TAP_H
#define TAP_H
-#ifndef __GNUC__
-#define __attribute__(X)
+/*
+ This object-like macro will expand to 0 if not using a GCC compiler.
+ */
+#ifndef GCC_VERSION
+#define GCC_VERSION (__GNUC__ * 1000 + __GNUC_MINOR__)
#endif
+#if GCC_VERSION <= 2007
+#define __attribute__(X)
+#endif
/*
- @defgroup MyTAP MySQL support for performing unit tests according to TAP.
-
+ @defgroup MyTAP MySQL support for performing unit tests according to
+ the Test Anything Protocol (TAP).
*/
#define NO_PLAN (0)
@@ -39,6 +45,7 @@
@internal We are using the "typedef struct X { ... } X" idiom to
create class/struct X both in C and C++.
*/
+
typedef struct TEST_DATA {
/**
Number of tests that is planned to execute.
@@ -76,6 +83,7 @@
@param count The planned number of tests to run.
*/
+
void plan(int count);
@@ -94,9 +102,11 @@
@param fmt Format string in printf() format. NULL is allowed, in
which case nothing is printed.
*/
+
void ok(int pass, char const *fmt, ...)
__attribute__((format(printf,2,3)));
+
/**
Skip a determined number of tests.
@@ -121,6 +131,7 @@
@param how_many Number of tests that are to be skipped.
@param reason A reason for skipping the tests
*/
+
void skip(int how_many, char const *reason, ...)
__attribute__((format(printf,2,3)));
@@ -141,17 +152,21 @@
@see skip
*/
+
#define SKIP_BLOCK_IF(SKIP_IF_TRUE, COUNT, REASON) \
if (SKIP_IF_TRUE) skip((COUNT),(REASON)); else
+
/**
Print a diagnostics message.
@param fmt Diagnostics message in printf() format.
*/
+
void diag(char const *fmt, ...)
__attribute__((format(printf,1,2)));
+
/**
Print a bail out message.
@@ -160,6 +175,10 @@
The test will exit with status 255. This function does not return.
+ @code
+ BAIL_OUT("Lost connection to server %s", server_name);
+ @endcode
+
@note A bail out message is printed if a signal that generates a
core is raised.
@@ -185,6 +204,7 @@
@returns EXIT_SUCCESS if all tests passed, EXIT_FAILURE if one or
more tests failed.
*/
+
int exit_status(void);
@@ -195,9 +215,11 @@
automatically call exit(), so there is no need to have checks
around it.
*/
+
void skip_all(char const *reason, ...)
__attribute__((noreturn, format(printf, 1, 2)));
+
/**
Start section of tests that are not yet ready.
@@ -218,13 +240,17 @@
@param message Message that will be printed before the todo tests.
*/
+
void todo_start(char const *message, ...)
- __attribute__((format (printf, 1, 2)));
+ __attribute__((format(printf, 1, 2)));
+
/**
End a section of tests that are not yet ready.
*/
+
void todo_end();
+
#ifdef __cplusplus
}
| Thread |
|---|
| • bk commit into 5.1 tree (mkindahl:1.2256) | Mats Kindahl | 29 Aug |