tests: add test for cpp files exclude

This commit is contained in:
Alexandre Abadie
2019-12-04 20:10:55 +01:00
parent 72bed868db
commit 37f2d32914
10 changed files with 185 additions and 0 deletions
@@ -0,0 +1,5 @@
MODULE = module_exclude
SRCXXEXCLUDE := module_excluded.cpp
include $(RIOTBASE)/Makefile.base
@@ -0,0 +1 @@
FEATURES_REQUIRED += cpp
@@ -0,0 +1,3 @@
# Use an immediate variable to evaluate `MAKEFILE_LIST` now
USEMODULE_INCLUDES_module_exclude := $(abspath $(dir $(lastword $(MAKEFILE_LIST))))
USEMODULE_INCLUDES += $(USEMODULE_INCLUDES_module_exclude)
@@ -0,0 +1,32 @@
/*
* Copyright (C) 2019 Inria
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
*/
/**
* @ingroup tests
* @{
*
* @file
* @brief Sample module C++ class
*
* @author Alexandre Abadie <alexandre.abadie@inria.fr>
*
* @}
*/
#include <cstdio>
#include "module.hpp"
module_class::module_class() {}
module_class::~module_class() {}
void module_class::print_hello(void)
{
puts("Hello from C++ module");
}
@@ -0,0 +1,46 @@
/*
* Copyright (C) 2019 Inria
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
*/
/**
* @ingroup tests
* @{
*
* @file
* @brief Sample module C++ class
*
* @author Alexandre Abadie <alexandre.abadie@inria.fr>
*
* @}
*/
#ifndef MODULE_H
#define MODULE_H
#include <cstdio>
class module_class
{
public:
/**
* @brief constructor
*/
module_class();
/**
* @brief destructor
*/
~module_class();
/**
* @brief public function
*/
void print_hello(void);
};
/** @} */
#endif /* MODULE_H */
@@ -0,0 +1,34 @@
/*
* Copyright (C) 2019 Inria
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
*/
/**
* @ingroup tests
* @{
*
* @file
* @brief Sample module C++ class
*
* @author Alexandre Abadie <alexandre.abadie@inria.fr>
*
* @}
*/
#include <cstdio>
#include "module.hpp"
#error "This should not be built"
module_class::module_class() {}
module_class::~module_class() {}
void module_class::print(void)
{
puts("Hello from C++ module");
}