1// Copyright 2021 Peter Dimov
2// Distributed under the Boost Software License, Version 1.0.
3// See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt
4
5#include <boost/iostreams/device/file_descriptor.hpp>
6#include <boost/iostreams/device/back_inserter.hpp>
7#include <boost/iostreams/copy.hpp>
8#include <boost/core/lightweight_test.hpp>
9
10namespace io = boost::iostreams;
11
12int main()
13{
14 io::file_descriptor_source fs( "test.txt" );
15
16 std::string s;
17 io::copy( src: fs, snk: io::back_inserter( cnt&: s ) );
18
19 BOOST_TEST( s == "=== reference output ===" );
20
21 return boost::report_errors();
22}
23

source code of boost/libs/iostreams/test/cmake_install_test/test_fd.cpp