EmbUnit library for mbed. EmbUnit is a unit testing framework for embedded software. (more info: http://embunit.sourceforge.net/ )

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers TestListener.h Source File

TestListener.h

00001 /*
00002  * COPYRIGHT AND PERMISSION NOTICE
00003  * 
00004  * Copyright (c) 2003 Embedded Unit Project
00005  * 
00006  * All rights reserved.
00007  * 
00008  * Permission is hereby granted, free of charge, to any person obtaining 
00009  * a copy of this software and associated documentation files (the 
00010  * "Software"), to deal in the Software without restriction, including 
00011  * without limitation the rights to use, copy, modify, merge, publish, 
00012  * distribute, and/or sell copies of the Software, and to permit persons 
00013  * to whom the Software is furnished to do so, provided that the above 
00014  * copyright notice(s) and this permission notice appear in all copies 
00015  * of the Software and that both the above copyright notice(s) and this 
00016  * permission notice appear in supporting documentation.
00017  * 
00018  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 
00019  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 
00020  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT 
00021  * OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR 
00022  * HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY 
00023  * SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER 
00024  * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF 
00025  * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 
00026  * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
00027  * 
00028  * Except as contained in this notice, the name of a copyright holder 
00029  * shall not be used in advertising or otherwise to promote the sale, 
00030  * use or other dealings in this Software without prior written 
00031  * authorization of the copyright holder.
00032  *
00033  * $Id: TestListener.h,v 1.4 2004/02/10 16:19:29 arms22 Exp $
00034  */
00035 #ifndef __TESTLISTENER_H__
00036 #define __TESTLISTENER_H__
00037 
00038 typedef struct __TestListnerImplement   TestListnerImplement;
00039 typedef struct __TestListnerImplement*  TestListnerImplementRef;/*downward compatible*/
00040 
00041 typedef void(*TestListnerStartTestCallBack)(void*,void*);
00042 typedef void(*TestListnerEndTestCallBack)(void*,void*);
00043 typedef void(*TestListnerAddFailureCallBack)(void*,void*,const char*,int,const char*);
00044 
00045 struct __TestListnerImplement {
00046     TestListnerStartTestCallBack startTest;
00047     TestListnerEndTestCallBack endTest;
00048     TestListnerAddFailureCallBack addFailure;
00049 };
00050 
00051 /*typedef struct __TestListner  TestListner;*/  /*->TestResult.h*/
00052 /*typedef struct __TestListner* TestListnerRef;*/   /*->TestResult.h*/
00053 
00054 struct __TestListner {
00055     TestListnerImplement* isa;
00056 };
00057 
00058 #define TestListner_startTest(s,t)          ((TestListner*)s)->isa->startTest(s,t)
00059 #define TestListner_endTest(s,t)            ((TestListner*)s)->isa->endTest(s,t)
00060 #define TestListner_addFailure(s,t,m,l,f)   ((TestListner*)s)->isa->addFailure(s,t,m,l,f)
00061 
00062 #endif/*__TESTLISTENER_H__*/