mirror of
https://github.com/gulrak/filesystem.git
synced 2026-07-30 08:16:12 +08:00
Merge branch 'feature-200-fstream-test'
This commit is contained in:
commit
6dfddd981e
@ -239,6 +239,7 @@ you might use:
|
||||
|
||||
#ifdef GHC_USE_STD_FS
|
||||
#include <filesystem>
|
||||
#include <fstream>
|
||||
namespace fs {
|
||||
using namespace std::filesystem;
|
||||
using ifstream = std::ifstream;
|
||||
@ -318,6 +319,7 @@ switching like this:
|
||||
|
||||
#ifdef GHC_USE_STD_FS
|
||||
#include <filesystem>
|
||||
#include <fstream>
|
||||
namespace fs {
|
||||
using namespace std::filesystem;
|
||||
using ifstream = std::ifstream;
|
||||
|
||||
@ -58,6 +58,7 @@
|
||||
|
||||
#ifdef GHC_USE_STD_FS
|
||||
#include <filesystem>
|
||||
#include <fstream>
|
||||
namespace fs {
|
||||
using namespace std::filesystem;
|
||||
using ifstream = std::ifstream;
|
||||
|
||||
@ -60,6 +60,7 @@
|
||||
|
||||
#ifdef GHC_USE_STD_FS
|
||||
#include <filesystem>
|
||||
#include <fstream>
|
||||
namespace fs {
|
||||
using namespace std::filesystem;
|
||||
using ifstream = std::ifstream;
|
||||
|
||||
@ -97,6 +97,14 @@ if(CMAKE_CXX_COMPILER_ID MATCHES MSVC)
|
||||
endif()
|
||||
add_test(fwd_impl_test fwd_impl_test)
|
||||
|
||||
if("cxx_std_17" IN_LIST GHC_FILESYSTEM_TEST_COMPILE_FEATURES)
|
||||
add_executable(fs_std_header_test fs_std_header_test.cpp fs_std_fwd_header_test.cpp)
|
||||
target_link_libraries(fs_std_header_test ghc_filesystem)
|
||||
target_compile_features(fs_std_header_test PRIVATE cxx_std_17)
|
||||
SetTestCompileOptions(fs_std_header_test)
|
||||
add_test(fs_std_header_test fs_std_header_test)
|
||||
endif()
|
||||
|
||||
add_executable(exception exception.cpp)
|
||||
if(MSVC)
|
||||
# MSVC 2015 warns for noexcept declarations when exception handling is disabled.
|
||||
|
||||
8
test/fs_std_fwd_header_test.cpp
Normal file
8
test/fs_std_fwd_header_test.cpp
Normal file
@ -0,0 +1,8 @@
|
||||
#define GHC_USE_STD_FS
|
||||
#include <ghc/fs_std_fwd.hpp>
|
||||
|
||||
bool fs_std_fwd_header_test()
|
||||
{
|
||||
fs::fstream stream;
|
||||
return stream.is_open();
|
||||
}
|
||||
10
test/fs_std_header_test.cpp
Normal file
10
test/fs_std_header_test.cpp
Normal file
@ -0,0 +1,10 @@
|
||||
#define GHC_USE_STD_FS
|
||||
#include <ghc/fs_std.hpp>
|
||||
|
||||
bool fs_std_fwd_header_test();
|
||||
|
||||
int main()
|
||||
{
|
||||
fs::ifstream stream;
|
||||
return stream.is_open() || fs_std_fwd_header_test() ? 1 : 0;
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user