Fix MakeFileBody/MakeFileProvider tests on Windows

These tests wrote to a hardcoded "/tmp/" path which does not exist on
Windows, causing the file write to silently fail and the subsequent
make_file_body / make_file_provider call to return zero-sized data.
Use a relative path under the test working directory instead so the
test runs identically on every platform.

Also dump the shard log when a shard's process exits non-zero even
when the gtest summary appears clean (e.g. sanitizer report after
the suite, or assertion-based abort) — previously such failures were
detected only via overall rc and showed no diagnostic output.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
yhiroseandClaude Opus 4.7 committed 2026-04-29 07:33:51 +09:00
1 parent b0866cff8f
commit f50bd311fb
2 files changed
+10 -8

No files matched your search

+2 -2
View File
@@ -12276,7 +12276,7 @@ TEST(MultipartFormDataTest, ManyItemsEndToEnd) {
TEST(MultipartFormDataTest, MakeFileProvider) {
// Verify make_file_provider sends a file's contents correctly.
const std::string file_content(4096, 'Z');
const std::string tmp_path = "/tmp/httplib_test_make_file_provider.bin";
const std::string tmp_path = "./httplib_test_make_file_provider.bin";
{
std::ofstream ofs(tmp_path, std::ios::binary);
ofs.write(file_content.data(),
@@ -12331,7 +12331,7 @@ TEST(MultipartFormDataTest, MakeFileProvider) {
TEST(MakeFileBodyTest, Basic) {
const std::string file_content(4096, 'Z');
const std::string tmp_path = "/tmp/httplib_test_make_file_body.bin";
const std::string tmp_path = "./httplib_test_make_file_body.bin";
{
std::ofstream ofs(tmp_path, std::ios::binary);
ofs.write(file_content.data(),