diff options
author | Michael Ellerman <michael@ellerman.id.au> | 2013-08-06 17:42:36 +1000 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2013-08-14 14:57:07 +1000 |
commit | 2fae0d7ced53ef2e7b4d87d84986ec3ff7cf798f (patch) | |
tree | e8ed1accab4920d9e2256f7c9d96f52989d897b3 /tools/testing/selftests/powerpc/utils.h | |
parent | 0e56dacdda49940ff6e24e504f11468a27922416 (diff) | |
download | linux-2fae0d7ced53ef2e7b4d87d84986ec3ff7cf798f.tar.gz linux-2fae0d7ced53ef2e7b4d87d84986ec3ff7cf798f.tar.bz2 linux-2fae0d7ced53ef2e7b4d87d84986ec3ff7cf798f.zip |
selftests: Add support files for powerpc tests
This commit adds support code used by upcoming powerpc tests.
Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'tools/testing/selftests/powerpc/utils.h')
-rw-r--r-- | tools/testing/selftests/powerpc/utils.h | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/tools/testing/selftests/powerpc/utils.h b/tools/testing/selftests/powerpc/utils.h new file mode 100644 index 000000000000..5851c4b0f553 --- /dev/null +++ b/tools/testing/selftests/powerpc/utils.h @@ -0,0 +1,34 @@ +/* + * Copyright 2013, Michael Ellerman, IBM Corp. + * Licensed under GPLv2. + */ + +#ifndef _SELFTESTS_POWERPC_UTILS_H +#define _SELFTESTS_POWERPC_UTILS_H + +#include <stdint.h> +#include <stdbool.h> + +/* Avoid headaches with PRI?64 - just use %ll? always */ +typedef unsigned long long u64; +typedef signed long long s64; + +/* Just for familiarity */ +typedef uint32_t u32; +typedef uint8_t u8; + + +int test_harness(int (test_function)(void), char *name); + + +/* Yes, this is evil */ +#define FAIL_IF(x) \ +do { \ + if ((x)) { \ + fprintf(stderr, \ + "[FAIL] Test FAILED on line %d\n", __LINE__); \ + return 1; \ + } \ +} while (0) + +#endif /* _SELFTESTS_POWERPC_UTILS_H */ |