You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using gtest on Windows, I'm seeing sporadic messages saying "Unable to create a temporary file in " and the path to the temp folder. These messages are coming from third_party/gtest/src/gtest-port.cc, L1045. I would like this line to include a call to GetLastError so that I can get more information from the operating system about what exactly is going wrong so I can fix my sporadic error.
Requested addition:
GTEST_CHECK_(success != 0)
<< "Unable to create a temporary file in " << temp_dir_path << ". Error code: " << ::GetLastError();
set TMP=E:\badtemppath
cd googletest\Debug
sample1_unittest.exe
It should show the last error message and exits with 3.
Running main() from E:\googletest\googletest\src\gtest_main.cc
[==========] Running 6 tests from 2 test suites.
[----------] Global test environment set-up.
[----------] 3 tests from FactorialTest
[ RUN ] FactorialTest.Negative
[ FATAL ] E:\googletest\googletest\src/gtest-port.cc(1044):: Condition success != 0 failed. Unable to create a temporary file in E:\badtemppath. Error code: 267
Without the GetLastError change, it shows the following and exits with 3.
Running main() from E:\googletest\googletest\src\gtest_main.cc
[==========] Running 6 tests from 2 test suites.
[----------] Global test environment set-up.
[----------] 3 tests from FactorialTest
[ RUN ] FactorialTest.Negative
[ FATAL ] E:\googletest\googletest\src/gtest-port.cc(1044):: Condition success != 0 failed. Unable to create a temporary file in E:\badtemppath\
What version of GoogleTest are you using?
v1.14.0
What operating system and version are you using?
Windows Server 2022, 10.0.20348
Windows 11, 10.0.22631
What compiler and version are you using?
MSVC 19.40.33811.0
What build system are you using?
cmake version 3.27.1
Additional context
No response
The text was updated successfully, but these errors were encountered:
Describe the issue
When using gtest on Windows, I'm seeing sporadic messages saying "Unable to create a temporary file in " and the path to the temp folder. These messages are coming from third_party/gtest/src/gtest-port.cc, L1045. I would like this line to include a call to
GetLastError
so that I can get more information from the operating system about what exactly is going wrong so I can fix my sporadic error.Requested addition:
Steps to reproduce the problem
Download the git repo at https://github.com/BenSluis/googletest, checkout the
error_code_temp_file
branch.Build samples:
Run sample1 with the custom changes from https://github.com/BenSluis/googletest/tree/error_code_temp_file .
It should show the last error message and exits with 3.
Without the GetLastError change, it shows the following and exits with 3.
What version of GoogleTest are you using?
v1.14.0
What operating system and version are you using?
What compiler and version are you using?
MSVC 19.40.33811.0
What build system are you using?
cmake version 3.27.1
Additional context
No response
The text was updated successfully, but these errors were encountered: