/* * Copyright (c) 2019 AVM GmbH . * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef __KTESTDRIVE_H__ #define __KTESTDRIVE_H__ #ifndef __KERNEL__ #error This header is intended for kernel space only #endif typedef const char *ktd_ret_t; struct ktd_suite; struct ktd_suite *ktd_suite_create(const char *name); void ktd_suite_destroy(struct ktd_suite *suite); int ktd_register(struct ktd_suite *suite, const char *name, ktd_ret_t(fn)(void *), void *arg); int ktd_register_concurrent(struct ktd_suite *suite, const char *name, ktd_ret_t(fn)(unsigned int cpuid)); #define KTD_PASSED ((ktd_ret_t)NULL) #define KTD_PASSED_STR "passed\n" #define KTD_EXPECT(expr) \ if (!(expr)) \ return __FILE__ ":" __stringify(__LINE__) ": expected '" #expr "'\n" #endif /* __KTESTDRIVE_H__ */