From 9c382e3555c55f475539d995e7b609e41c4441ab Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Tue, 11 Aug 2020 10:16:00 +0200 Subject: [PATCH] [libcalamares] Support switching public/private during tests --- src/libcalamares/DllMacro.h | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/libcalamares/DllMacro.h b/src/libcalamares/DllMacro.h index 2eeea331e..8613fa584 100644 --- a/src/libcalamares/DllMacro.h +++ b/src/libcalamares/DllMacro.h @@ -1,5 +1,5 @@ /* === This file is part of Calamares - === - * + * * SPDX-FileCopyrightText: 2014 Teo Mrnjavac * SPDX-FileCopyrightText: 2020 Adriaan de Groot * @@ -76,4 +76,16 @@ #endif #endif +/* + * For private functions that should be public for testing purposes, + * use PRIVATETEST, which is private except when building tests. + */ +#ifndef PRIVATETEST +#if defined( BUILD_AS_TEST ) +#define PRIVATETEST public +#else +#define PRIVATETEST private +#endif +#endif + #endif