thread/test/self_contained_header.cpp
Andrey Semashev 9342fe3f25 Added tests for self-contained headers.
The new set of tests iterates over Boost.Thread public headers and verifies that
each header is self-contained, i.e. doesn't have any missing includes and
contains syntactically correct content. On Windows and Cygwin, a second test
per each header is generated, which includes the header after windows.h. This
verifies that the header doesn't have conflicts with Windows SDK and that
includeing windows.h does not break platform detection in Boost.Thread.

This set of tests would have detected the bug fixed by
https://github.com/boostorg/thread/pull/263.
2019-01-19 19:04:25 +03:00

27 lines
711 B
C++

/*
* Copyright Andrey Semashev 2019.
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
*/
/*!
* \file self_contained_header.cpp
* \author Andrey Semashev
* \date 2019-01-19
*
* \brief This file contains a test boilerplate for checking that every public header is self-contained and does not have any missing #includes.
*/
#if defined(BOOST_THREAD_TEST_POST_WINDOWS_H)
#include <windows.h>
#endif
#define BOOST_THREAD_TEST_INCLUDE_HEADER() <boost/thread/BOOST_THREAD_TEST_HEADER>
#include BOOST_THREAD_TEST_INCLUDE_HEADER()
int main(int, char*[])
{
return 0;
}