MCPcopy Create free account
hub / github.com/boostorg/filesystem / cpp_main

Function cpp_main

test/deprecated_test.cpp:76–134  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

74//--------------------------------------------------------------------------------------//
75
76int cpp_main(int /*argc*/, char* /*argv*/[])
77{
78 // The choice of platform is make at runtime rather than compile-time
79 // so that compile errors for all platforms will be detected even though
80 // only the current platform is runtime tested.
81 platform = (platform == "Win32" || platform == "Win64") ? "Windows" : "POSIX";
82 std::cout << "Platform is " << platform << '\n';
83
84 l.push_back('s');
85 l.push_back('t');
86 l.push_back('r');
87 l.push_back('i');
88 l.push_back('n');
89 l.push_back('g');
90
91 wl.push_back(L'w');
92 wl.push_back(L's');
93 wl.push_back(L't');
94 wl.push_back(L'r');
95 wl.push_back(L'i');
96 wl.push_back(L'n');
97 wl.push_back(L'g');
98
99 v.push_back('f');
100 v.push_back('u');
101 v.push_back('z');
102
103 wv.push_back(L'w');
104 wv.push_back(L'f');
105 wv.push_back(L'u');
106 wv.push_back(L'z');
107
108 BOOST_TEST(fs::initial_path() == fs::current_path());
109
110 //path::default_name_check(fs::no_check);
111
112 fs::directory_entry de("foo.bar", fs::file_status(fs::regular_file, fs::owner_all), fs::file_status(fs::directory_file, fs::group_all));
113
114 BOOST_TEST(de.path() == "foo.bar");
115 BOOST_TEST(de.status() == fs::file_status(fs::regular_file, fs::owner_all));
116 BOOST_TEST(de.symlink_status() == fs::file_status(fs::directory_file, fs::group_all));
117 BOOST_TEST(de < fs::directory_entry("goo.bar", fs::file_status(), fs::file_status()));
118 BOOST_TEST(de == fs::directory_entry("foo.bar", fs::file_status(), fs::file_status()));
119 BOOST_TEST(de != fs::directory_entry("goo.bar", fs::file_status(), fs::file_status()));
120 de.replace_filename("bar.foo", fs::file_status(), fs::file_status());
121 BOOST_TEST(de.path() == "bar.foo");
122
123 const fs::path temp_dir(fs::current_path() / ".." / fs::unique_path("deprecated_test-%%%%-%%%%-%%%%"));
124 std::cout << "temp_dir is " << temp_dir.string() << std::endl;
125
126 fs::create_directory(temp_dir);
127
128 path_container_ctor_test();
129
130 std::cout << "post-test removal of " << temp_dir << std::endl;
131 BOOST_TEST(fs::remove_all(temp_dir) != 0);
132
133 return ::boost::report_errors();

Callers

nothing calls this directly

Calls 13

file_statusClass · 0.85
path_container_ctor_testFunction · 0.85
pathMethod · 0.80
statusMethod · 0.80
symlink_statusMethod · 0.80
replace_filenameMethod · 0.80
stringMethod · 0.80
initial_pathFunction · 0.50
current_pathFunction · 0.50
directory_entryFunction · 0.50
unique_pathFunction · 0.50
create_directoryFunction · 0.50

Tested by

no test coverage detected