summaryrefslogtreecommitdiff
path: root/utests/utest.hpp
diff options
context:
space:
mode:
authorYi Sun <yi.sun@intel.com>2013-09-04 10:48:48 +0800
committerZhigang Gong <zhigang.gong@linux.intel.com>2013-09-04 14:30:41 +0800
commitc72251dfb74db37fa058d1979b198fee8658428e (patch)
treef48b8cb4f872eb1f8a4c7c832d5f36907dad45f3 /utests/utest.hpp
parent98df3ca0d785a5d08699b4fd9d3644d56271dcbd (diff)
downloadbeignet-c72251dfb74db37fa058d1979b198fee8658428e.tar.gz
Utests_run: Add known issue cases support.
Add some arguments: -c <casename>: run sub-case named 'casename' -l : list all the available case name -a : run all test cases -n : run all test cases without known issue -h : display this usage Add a alternate macro named MAKE_UTEST_FROM_FUNCTION_WITH_ISSUE to register a new test case, which has some known issue to be fixed till now. While utest_run running, only cases which registered by MAKE_UTEST_FROM_FUNCTION will be involved by defalut. If you want to run all the test cases including those with known issue, you should use argument '-a'. Besides, you can use option '-c' to run any test case. Signed-off-by: Yi Sun <yi.sun@intel.com> Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
Diffstat (limited to 'utests/utest.hpp')
-rw-r--r--utests/utest.hpp16
1 files changed, 13 insertions, 3 deletions
diff --git a/utests/utest.hpp b/utests/utest.hpp
index 93b3d875..d3a6a6fa 100644
--- a/utests/utest.hpp
+++ b/utests/utest.hpp
@@ -39,19 +39,23 @@ struct UTest
/*! Empty test */
UTest(void);
/*! Build a new unit test and append it to the unit test list */
- UTest(Function fn, const char *name);
+ UTest(Function fn, const char *name, bool haveIssue = false);
/*! Function to execute */
Function fn;
/*! Name of the test */
const char *name;
+ /*! Indicate whether current test cases has issue to be fixes */
+ bool haveIssue;
/*! The tests that are registered */
static std::vector<UTest> *utestList;
/*! Run the test with the given name */
static void run(const char *name);
+ /*! Run all the tests without known issue*/
+ static void runAllNoIssue(void);
/*! Run all the tests */
static void runAll(void);
- /*! List all the tests */
- static void listAll(void);
+ /*! List all test cases */
+ static void listAllCases(void);
};
/*! Register a new unit test */
@@ -62,6 +66,12 @@ struct UTest
static void __ANON__##FN##__(void) { UTEST_EXPECT_SUCCESS(FN()); } \
static const UTest __##FN##__(__ANON__##FN##__, #FN);
+/*! Register a test case which has issue to be fixed */
+#define MAKE_UTEST_FROM_FUNCTION_WITH_ISSUE(FN) \
+ static void __ANON__##FN##__(void) { UTEST_EXPECT_SUCCESS(FN()); } \
+ static const UTest __##FN##__(__ANON__##FN##__, #FN, true);
+
+
/*! No assert is expected */
#define UTEST_EXPECT_SUCCESS(EXPR) \
do { \