File tree Expand file tree Collapse file tree 4 files changed +34
-0
lines changed
Expand file tree Collapse file tree 4 files changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -139,3 +139,19 @@ add_test(NAME c.segy.mmap COMMAND c.segy [c.segy] --test-mmap)
139139add_test (NAME c.segy.lsb COMMAND c.segy [c.segy] --test -lsb)
140140add_test (NAME c.segy.mmap.lsb COMMAND c.segy [c.segy] --test -mmap --test -lsb)
141141add_test (NAME cpp.segy COMMAND c.segy [c++])
142+
143+
144+ # These targets check if code that includes the public C and C++ header compile
145+ # correctly. This is done to detect issues like missing includes directives in
146+ # these headers of segyio. Missing includes may not be picked up by the tests
147+ # above because the test framework does include some C++ dependencies like
148+ # `cstdint` and `algorithm` that may be used in the segyio headers.
149+ add_executable (c-include .segy test /test -include .c)
150+ target_link_libraries (c-include .segy segyio)
151+ target_include_directories (c-include .segy PRIVATE src)
152+ add_test (NAME c-include .segy COMMAND c-include .segy)
153+
154+ add_executable (cpp-include .segy test /test -include .cpp)
155+ target_link_libraries (cpp-include .segy segyio::segyio)
156+ target_include_directories (cpp-include .segy PRIVATE experimental)
157+ add_test (NAME cpp-include .segy COMMAND cpp-include .segy)
Original file line number Diff line number Diff line change 11#ifndef SEGYIO_HPP
22#define SEGYIO_HPP
33
4+ #include < algorithm>
45#include < cerrno>
6+ #include < cstdint>
57#include < cstring>
68#include < exception>
79#include < functional>
810#include < iterator>
911#include < memory>
12+ #include < stdexcept>
1013#include < string>
1114#include < type_traits>
1215#include < utility>
Original file line number Diff line number Diff line change 1+ #include <segyio/segy.h>
2+
3+ int main (void ) {
4+ return 0 ;
5+ }
Original file line number Diff line number Diff line change 1+ #include < segyio/segyio.hpp>
2+
3+ int main () {
4+ // Open a SEG-Y file to avoid error about unused internal functions.
5+ segyio::basic_volume< segyio::readonly > tmp (
6+ segyio::path{ " test-data/small.sgy" },
7+ segyio::config{}
8+ );
9+ return 0 ;
10+ }
You can’t perform that action at this time.
0 commit comments