Skip to content

Commit f756560

Browse files
committed
Mask out Bluetooth unit tests if libpicobt not present
1 parent 46ffdde commit f756560

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

tests/test_channel.c

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,23 @@
3131
*
3232
*/
3333

34+
#if HAVE_CONFIG_H
3435
#include "pico/config.h"
36+
#endif
3537

3638
#include <check.h>
3739
#include <pthread.h>
3840
#include "pico/channel.h"
3941
#include "pico/channel_rvp.h"
42+
43+
#ifdef HAVE_LIBPICOBT // Only build if Bluetooth is present
44+
4045
#include "pico/channel_bt.h"
4146
#include "pico/channel_btout.h"
4247
#include "mockbt/mockbt.h"
4348

49+
#endif // HAVE_LIBPICOBT // Only build if Bluetooth is present
50+
4451
// Defines
4552

4653
// Structure definitions
@@ -312,6 +319,8 @@ START_TEST (set_url) {
312319
}
313320
END_TEST
314321

322+
#ifdef HAVE_LIBPICOBT // Only build if Bluetooth is present
323+
315324
START_TEST (channel_set_bt_bluetooth_not_present) {
316325
RVPChannel * channel;
317326
bool result;
@@ -382,6 +391,8 @@ START_TEST (channel_set_bt_error_registering_service) {
382391
}
383392
END_TEST
384393

394+
#endif // HAVE_LIBPICOBT // Only build if Bluetooth is present
395+
385396
int main (void) {
386397
int number_failed;
387398
Suite * s;
@@ -395,8 +406,14 @@ int main (void) {
395406
tcase_add_test(tc, echo_test);
396407
tcase_add_test(tc, get_url);
397408
tcase_add_test(tc, set_url);
409+
410+
#ifdef HAVE_LIBPICOBT // Only build if Bluetooth is present
411+
398412
tcase_add_test(tc, channel_set_bt_bluetooth_not_present);
399413
tcase_add_test(tc, channel_set_bt_error_registering_service);
414+
415+
#endif // HAVE_LIBPICOBT // Only build if Bluetooth is present
416+
400417
suite_add_tcase(s, tc);
401418
sr = srunner_create(s);
402419

0 commit comments

Comments
 (0)