Skip to content

Commit

Permalink
plz do not test benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
MacroModel committed Dec 16, 2024
1 parent 6e6310c commit e5baea0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion include/fast_io_hosted/process/process/posix.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ inline posix_wait_status posix_waitpid(pid_t pid)
#if defined(__linux__) && defined(__NR_wait4)
system_call_throw_error(system_call<__NR_wait4, int>(pid, __builtin_addressof(status.wait_loc), 0, nullptr));
#else
if (::fast_io::posix::libc_waitpid(pid, __builtin_addressof(status.wait_loc), 0) == -1)
if (::fast_io::posix::libc_waitpid(pid, __builtin_addressof(status.wait_loc), 0) == -1) [[unlikely]]
{
throw_posix_error();
}
Expand Down
19 changes: 11 additions & 8 deletions tests/0000.tests_prebuild/gentests.cc
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ inline void parse_prop_files(fast_io::native_file_loader &&file, file_property_t
}
}

inline bool gen_cmake_file(fast_io::native_io_observer nio, std::u8string_view prefix, file_entry_t prop);
inline bool gen_cmake_file(fast_io::native_io_observer nio, std::u8string_view prefix, file_entry_t prop, bool test);

inline void cmake_gen_rec_dir_def(fast_io::u8obuf_file &cmake_file, fast_io::native_io_observer nio, std::u8string_view filename, std::u8string_view prefix, file_entry_t const &prop)
{
Expand All @@ -298,7 +298,7 @@ inline void cmake_gen_rec_dir_def(fast_io::u8obuf_file &cmake_file, fast_io::nat
print(cmake_file, u8"include(${CMAKE_CURRENT_LIST_DIR}/", filename, u8"/CMakeLists.txt)\n");
}

inline void cmake_gen_file_def(fast_io::u8obuf_file &cmake_file, std::u8string_view targetname, auto &&filename, file_entry_t const &prop)
inline void cmake_gen_file_def(fast_io::u8obuf_file &cmake_file, std::u8string_view targetname, auto &&filename, file_entry_t const &prop, bool test)
{
if (prop.ignore || prop.will_fail == will_fail_t::compiletime)
{
Expand Down Expand Up @@ -328,13 +328,16 @@ inline void cmake_gen_file_def(fast_io::u8obuf_file &cmake_file, std::u8string_v
print(cmake_file, u8"set_target_properties(", targetname, u8" PROPERTIES CMAKE_CXX_FLAGS \"${CMAKE_CXX_FLAGS} -fsanitize=address\")\n");
}
}
print(cmake_file, u8"add_test(", targetname, u8" ", targetname, u8")\n");
if (test)
{
print(cmake_file, u8"add_test(", targetname, u8" ", targetname, u8")\n");
}
// // set_tests_properties does not work. why?
// if (prop.will_fail == will_fail_t::runtime)
// print(cmake_file, u8"set_tests_properties(", targetname, u8" PROPERTIES WILL_FAIL TRUE)\n");
}

inline bool gen_cmake_file(fast_io::native_io_observer nio, std::u8string_view prefix, file_entry_t prop)
inline bool gen_cmake_file(fast_io::native_io_observer nio, std::u8string_view prefix, file_entry_t prop, bool test)
{
bool generated{};
fast_io::u8obuf_file cmake_file;
Expand Down Expand Up @@ -382,7 +385,7 @@ inline bool gen_cmake_file(fast_io::native_io_observer nio, std::u8string_view p
std::u8string_view ext{u8extension(entry)};
if (ext == u8".cpp" || ext == u8".cc")
{
cmake_gen_file_def(cmake_file, fast_io::u8concat_std(prefix, u8stem(entry)), filename, curr_prop);
cmake_gen_file_def(cmake_file, fast_io::u8concat_std(prefix, u8stem(entry)), filename, curr_prop, test);
generated = true;
}
break;
Expand Down Expand Up @@ -439,7 +442,7 @@ int main(int argc, char *argv[])
fast_io::dir_file tests_dir{R"(./tests)"};
fast_io::dir_file examples_dir{R"(./examples)"};
fast_io::dir_file benchmark_dir{R"(./benchmark)"};
gen_cmake_file(tests_dir, u8"tests.", {});
gen_cmake_file(examples_dir, u8"examples.", {});
gen_cmake_file(benchmark_dir, u8"benchmark.", {});
gen_cmake_file(tests_dir, u8"tests.", {}, true);
gen_cmake_file(examples_dir, u8"examples.", {}, true);
gen_cmake_file(benchmark_dir, u8"benchmark.", {}, false);
}

0 comments on commit e5baea0

Please sign in to comment.