diff options
author | Andrew Geissler <andrewg@us.ibm.com> | 2011-05-10 17:20:10 -0500 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2011-05-16 16:51:41 -0500 |
commit | e604f02230c3decedbdd56a3cfef66b0709b74dc (patch) | |
tree | 85ebf5ba3dd090bd80d8651fdf4b4855a2022a30 /src/include/usr | |
parent | f25d156f4a222923d70563ba960858f4e42a80c8 (diff) | |
download | talos-hostboot-e604f02230c3decedbdd56a3cfef66b0709b74dc.tar.gz talos-hostboot-e604f02230c3decedbdd56a3cfef66b0709b74dc.zip |
Base cxxtest class and some examples.
Change-Id: I8ff2fdffe8be34f5ece9a5e4b2f5d07a4bc73d73
Reviewed-on: http://gfwr801.rchland.ibm.com:8080/gerrit/71
Tested-by: Jenkins Server
Reviewed-by: Mark W. Wenning <wenning@us.ibm.com>
Diffstat (limited to 'src/include/usr')
-rwxr-xr-x | src/include/usr/cxxtest/TestSuite.H | 54 | ||||
-rw-r--r-- | src/include/usr/example/example.H | 18 |
2 files changed, 72 insertions, 0 deletions
diff --git a/src/include/usr/cxxtest/TestSuite.H b/src/include/usr/cxxtest/TestSuite.H new file mode 100755 index 000000000..3cba6eeac --- /dev/null +++ b/src/include/usr/cxxtest/TestSuite.H @@ -0,0 +1,54 @@ +// Imported from FSP tree - /src/test/cxxtest/cxxtest/ + +#ifndef __cxxtest__TestSuite_h__ +#define __cxxtest__TestSuite_h__ + +// +// class TestSuite is the base class for all test suites. +// To define a test suite, derive from this class and add +// member functions called void test*(); +// + +namespace CxxTest +{ + class TestSuite + { + public: + virtual ~TestSuite(); + virtual void setUp(); + virtual void tearDown(); + }; + + class AbortTest {}; + + void doTrace( const char *file, unsigned line, const char *message ); + void doWarn( const char *file, unsigned line, const char *message ); + void doFailTest( const char *file, unsigned line, const char *message ); + void doFailAssert( const char *file, unsigned line, const char *expression, const char *message ); + + + +# define _TS_TRY +# define ___TSM_CATCH(f,l,m) +# define __TSM_CATCH(f,l,m) +# define __TS_CATCH(f,l) +# define _TS_CATCH +# define _TS_CATCH_TYPE(t, b) +# define _TS_LAST_CATCH(b) +# define _TS_CATCH_ABORT(b) + + // TS_TRACE +# define _TS_TRACE(f,l,e) CxxTest::doTrace( (f), (l), e ) +# define TS_TRACE(e) _TS_TRACE( __FILE__, __LINE__, e ) + + // TS_WARN +# define _TS_WARN(f,l,e) CxxTest::doWarn( (f), (l), e ) +# define TS_WARN(e) _TS_WARN( __FILE__, __LINE__, e ) + + // TS_FAIL +# define _TS_FAIL(f,l,e) CxxTest::doFailTest( (f), (l), e ) +# define TS_FAIL(e) _TS_FAIL( __FILE__, __LINE__, e ) + +} + +#endif // __cxxtest__TestSuite_h__ diff --git a/src/include/usr/example/example.H b/src/include/usr/example/example.H new file mode 100644 index 000000000..1444893b2 --- /dev/null +++ b/src/include/usr/example/example.H @@ -0,0 +1,18 @@ +// This file is where you export all external module interfaces (i.e. +// interfaces required by other modules) + +#ifndef __EXAMPLE_EXAMPLE_H +#define __EXAMPLE_EXAMPLE_H + + + /** + * @brief Example Function + * + * Some more details on the example function. + * + * @return 0 on success, otherwise a failure code. + * + */ +uint64_t example1_function(); + +#endif |