2
0
mirror of https://github.com/boostorg/atomic.git synced 2026-02-01 20:12:09 +00:00

[CMake] Add test for cmake file

This commit is contained in:
Mike Dev
2019-01-02 15:29:35 +03:00
committed by Andrey Semashev
parent 1dd9dd831b
commit 04ddfdeb19
3 changed files with 61 additions and 2 deletions

View File

@@ -0,0 +1,22 @@
# Copyright 2018 Mike Dev
# 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
#
# NOTE: This does NOT run the unit tests for Boost.Atomic.
# It only tests, if the CMakeLists.txt file in it's root works as expected
cmake_minimum_required( VERSION 3.5 )
project( BoostAtomicCMakeSelfTest )
add_definitions( -DBOOST_ALL_NO_LIB )
add_subdirectory( ../../../assert ${CMAKE_CURRENT_BINARY_DIR}/libs/assert )
add_subdirectory( ../../../config ${CMAKE_CURRENT_BINARY_DIR}/libs/config )
add_subdirectory( ../../../static_assert ${CMAKE_CURRENT_BINARY_DIR}/libs/static_assert )
add_subdirectory( ../../../type_traits ${CMAKE_CURRENT_BINARY_DIR}/libs/type_traits )
add_subdirectory( ../.. ${CMAKE_CURRENT_BINARY_DIR}/libs/boost_atomic )
add_executable( boost_atomic_cmake_self_test main.cpp )
target_link_libraries( boost_atomic_cmake_self_test Boost::atomic )

22
test/test_cmake/main.cpp Normal file
View File

@@ -0,0 +1,22 @@
// Copyright (c) 2018 Mike Dev
//
// 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)
#include <boost/atomic.hpp>
struct Dummy
{
int x[128];
};
int main()
{
Dummy d = {};
boost::atomic<Dummy> ad;
// this operation requires functions from
// the compiled part of Boost.Atomic
ad = d;
}