xref: /linux/tools/testing/selftests/powerpc/include/subunit.h (revision 15ec3997aa3bffc461f7b47ca9365d4b0323c671)
1*15ec3997SSimon Guo /*
2*15ec3997SSimon Guo  * Copyright 2013, Michael Ellerman, IBM Corp.
3*15ec3997SSimon Guo  * Licensed under GPLv2.
4*15ec3997SSimon Guo  */
5*15ec3997SSimon Guo 
6*15ec3997SSimon Guo #ifndef _SELFTESTS_POWERPC_SUBUNIT_H
7*15ec3997SSimon Guo #define _SELFTESTS_POWERPC_SUBUNIT_H
8*15ec3997SSimon Guo 
9*15ec3997SSimon Guo static inline void test_start(char *name)
10*15ec3997SSimon Guo {
11*15ec3997SSimon Guo 	printf("test: %s\n", name);
12*15ec3997SSimon Guo }
13*15ec3997SSimon Guo 
14*15ec3997SSimon Guo static inline void test_failure_detail(char *name, char *detail)
15*15ec3997SSimon Guo {
16*15ec3997SSimon Guo 	printf("failure: %s [%s]\n", name, detail);
17*15ec3997SSimon Guo }
18*15ec3997SSimon Guo 
19*15ec3997SSimon Guo static inline void test_failure(char *name)
20*15ec3997SSimon Guo {
21*15ec3997SSimon Guo 	printf("failure: %s\n", name);
22*15ec3997SSimon Guo }
23*15ec3997SSimon Guo 
24*15ec3997SSimon Guo static inline void test_error(char *name)
25*15ec3997SSimon Guo {
26*15ec3997SSimon Guo 	printf("error: %s\n", name);
27*15ec3997SSimon Guo }
28*15ec3997SSimon Guo 
29*15ec3997SSimon Guo static inline void test_skip(char *name)
30*15ec3997SSimon Guo {
31*15ec3997SSimon Guo 	printf("skip: %s\n", name);
32*15ec3997SSimon Guo }
33*15ec3997SSimon Guo 
34*15ec3997SSimon Guo static inline void test_success(char *name)
35*15ec3997SSimon Guo {
36*15ec3997SSimon Guo 	printf("success: %s\n", name);
37*15ec3997SSimon Guo }
38*15ec3997SSimon Guo 
39*15ec3997SSimon Guo static inline void test_finish(char *name, int status)
40*15ec3997SSimon Guo {
41*15ec3997SSimon Guo 	if (status)
42*15ec3997SSimon Guo 		test_failure(name);
43*15ec3997SSimon Guo 	else
44*15ec3997SSimon Guo 		test_success(name);
45*15ec3997SSimon Guo }
46*15ec3997SSimon Guo 
47*15ec3997SSimon Guo static inline void test_set_git_version(char *value)
48*15ec3997SSimon Guo {
49*15ec3997SSimon Guo 	printf("tags: git_version:%s\n", value);
50*15ec3997SSimon Guo }
51*15ec3997SSimon Guo 
52*15ec3997SSimon Guo #endif /* _SELFTESTS_POWERPC_SUBUNIT_H */
53