/* SPDX-License-Identifier: GPL-2.0 */1/*2* KUnit API to allow symbols to be conditionally visible during KUnit3* testing4*5* Copyright (C) 2022, Google LLC.6* Author: Rae Moar <[email protected]>7*/89#ifndef _KUNIT_VISIBILITY_H10#define _KUNIT_VISIBILITY_H1112#if IS_ENABLED(CONFIG_KUNIT)13/**14* VISIBLE_IF_KUNIT - A macro that sets symbols to be static if15* CONFIG_KUNIT is not enabled. Otherwise if CONFIG_KUNIT is enabled16* there is no change to the symbol definition.17*/18#define VISIBLE_IF_KUNIT19/**20* EXPORT_SYMBOL_IF_KUNIT(symbol) - Exports symbol into21* EXPORTED_FOR_KUNIT_TESTING namespace only if CONFIG_KUNIT is22* enabled. Must use MODULE_IMPORT_NS("EXPORTED_FOR_KUNIT_TESTING")23* in test file in order to use symbols.24* @symbol: the symbol identifier to export25*/26#define EXPORT_SYMBOL_IF_KUNIT(symbol) EXPORT_SYMBOL_NS(symbol, "EXPORTED_FOR_KUNIT_TESTING")27#else28#define VISIBLE_IF_KUNIT static29#define EXPORT_SYMBOL_IF_KUNIT(symbol)30#endif3132#endif /* _KUNIT_VISIBILITY_H */333435