Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
ca1bf4b2
Commit
ca1bf4b2
authored
Aug 29, 2006
by
mkindahl@dl145h.mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Various fixes to make MyTAP build on all platforms.
parent
e49db547
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
7 deletions
+27
-7
unittest/Makefile.am
unittest/Makefile.am
+2
-4
unittest/mytap/tap.h
unittest/mytap/tap.h
+25
-3
No files found.
unittest/Makefile.am
View file @
ca1bf4b2
SUBDIRS
=
mytap
.
mysys examples
SUBDIRS
=
mytap
.
mysys examples
noinst_SCRIPTS
=
unit
EXTRA_DIST
=
unit.pl
EXTRA_DIST
=
unit.pl
CLEANFILES
=
unit
CLEANFILES
=
unit
...
@@ -9,6 +8,5 @@ unittests = mytap mysys
...
@@ -9,6 +8,5 @@ unittests = mytap mysys
test
:
test
:
perl unit.pl run
$(unittests)
perl unit.pl run
$(unittests)
unit
:
$(srcdir)/unit.pl
test-verbose
:
install
$(srcdir)
/unit.pl
$@
HARNESS_VERBOSE
=
1 perl unit.pl run
$(unittests)
unittest/mytap/tap.h
View file @
ca1bf4b2
...
@@ -21,9 +21,11 @@
...
@@ -21,9 +21,11 @@
#ifndef TAP_H
#ifndef TAP_H
#define TAP_H
#define TAP_H
/*
#include "my_global.h"
@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)
#define NO_PLAN (0)
...
@@ -34,6 +36,7 @@
...
@@ -34,6 +36,7 @@
@internal We are using the "typedef struct X { ... } X" idiom to
@internal We are using the "typedef struct X { ... } X" idiom to
create class/struct X both in C and C++.
create class/struct X both in C and C++.
*/
*/
typedef
struct
TEST_DATA
{
typedef
struct
TEST_DATA
{
/**
/**
Number of tests that is planned to execute.
Number of tests that is planned to execute.
...
@@ -71,6 +74,7 @@ extern "C" {
...
@@ -71,6 +74,7 @@ extern "C" {
@param count The planned number of tests to run.
@param count The planned number of tests to run.
*/
*/
void
plan
(
int
count
);
void
plan
(
int
count
);
...
@@ -89,9 +93,11 @@ void plan(int count);
...
@@ -89,9 +93,11 @@ void plan(int count);
@param fmt Format string in printf() format. NULL is allowed, in
@param fmt Format string in printf() format. NULL is allowed, in
which case nothing is printed.
which case nothing is printed.
*/
*/
void
ok
(
int
pass
,
char
const
*
fmt
,
...)
void
ok
(
int
pass
,
char
const
*
fmt
,
...)
__attribute__
((
format
(
printf
,
2
,
3
)));
__attribute__
((
format
(
printf
,
2
,
3
)));
/**
/**
Skip a determined number of tests.
Skip a determined number of tests.
...
@@ -116,6 +122,7 @@ void ok(int pass, char const *fmt, ...)
...
@@ -116,6 +122,7 @@ void ok(int pass, char const *fmt, ...)
@param how_many Number of tests that are to be skipped.
@param how_many Number of tests that are to be skipped.
@param reason A reason for skipping the tests
@param reason A reason for skipping the tests
*/
*/
void
skip
(
int
how_many
,
char
const
*
reason
,
...)
void
skip
(
int
how_many
,
char
const
*
reason
,
...)
__attribute__
((
format
(
printf
,
2
,
3
)));
__attribute__
((
format
(
printf
,
2
,
3
)));
...
@@ -136,17 +143,21 @@ void skip(int how_many, char const *reason, ...)
...
@@ -136,17 +143,21 @@ void skip(int how_many, char const *reason, ...)
@see skip
@see skip
*/
*/
#define SKIP_BLOCK_IF(SKIP_IF_TRUE, COUNT, REASON) \
#define SKIP_BLOCK_IF(SKIP_IF_TRUE, COUNT, REASON) \
if (SKIP_IF_TRUE) skip((COUNT),(REASON)); else
if (SKIP_IF_TRUE) skip((COUNT),(REASON)); else
/**
/**
Print a diagnostics message.
Print a diagnostics message.
@param fmt Diagnostics message in printf() format.
@param fmt Diagnostics message in printf() format.
*/
*/
void
diag
(
char
const
*
fmt
,
...)
void
diag
(
char
const
*
fmt
,
...)
__attribute__
((
format
(
printf
,
1
,
2
)));
__attribute__
((
format
(
printf
,
1
,
2
)));
/**
/**
Print a bail out message.
Print a bail out message.
...
@@ -155,6 +166,10 @@ void diag(char const *fmt, ...)
...
@@ -155,6 +166,10 @@ void diag(char const *fmt, ...)
The test will exit with status 255. This function does not return.
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
@note A bail out message is printed if a signal that generates a
core is raised.
core is raised.
...
@@ -180,6 +195,7 @@ void BAIL_OUT(char const *fmt, ...)
...
@@ -180,6 +195,7 @@ void BAIL_OUT(char const *fmt, ...)
@returns EXIT_SUCCESS if all tests passed, EXIT_FAILURE if one or
@returns EXIT_SUCCESS if all tests passed, EXIT_FAILURE if one or
more tests failed.
more tests failed.
*/
*/
int
exit_status
(
void
);
int
exit_status
(
void
);
...
@@ -190,9 +206,11 @@ int exit_status(void);
...
@@ -190,9 +206,11 @@ int exit_status(void);
automatically call exit(), so there is no need to have checks
automatically call exit(), so there is no need to have checks
around it.
around it.
*/
*/
void
skip_all
(
char
const
*
reason
,
...)
void
skip_all
(
char
const
*
reason
,
...)
__attribute__
((
noreturn
,
format
(
printf
,
1
,
2
)));
__attribute__
((
noreturn
,
format
(
printf
,
1
,
2
)));
/**
/**
Start section of tests that are not yet ready.
Start section of tests that are not yet ready.
...
@@ -213,14 +231,18 @@ void skip_all(char const *reason, ...)
...
@@ -213,14 +231,18 @@ void skip_all(char const *reason, ...)
@param message Message that will be printed before the todo tests.
@param message Message that will be printed before the todo tests.
*/
*/
void
todo_start
(
char
const
*
message
,
...)
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.
End a section of tests that are not yet ready.
*/
*/
void
todo_end
();
void
todo_end
();
#ifdef __cplusplus
#ifdef __cplusplus
}
}
#endif
#endif
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment