Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F143621163
D35721.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D35721.diff
View Options
diff --git a/libexec/atf/atf-pytest-wrapper/atf_pytest_wrapper.cpp b/libexec/atf/atf-pytest-wrapper/atf_pytest_wrapper.cpp
--- a/libexec/atf/atf-pytest-wrapper/atf_pytest_wrapper.cpp
+++ b/libexec/atf/atf-pytest-wrapper/atf_pytest_wrapper.cpp
@@ -1,3 +1,5 @@
+// vim: ts=2 sw=2 et
+
#include <format>
#include <iostream>
#include <map>
@@ -181,7 +183,7 @@
}
}
- int Run(std::string binary, std::vector<std::string> args) {
+ bool Run(std::string binary, std::vector<std::string> args) {
if (flag_debug) {
PrintVector("OUT", args);
}
@@ -191,12 +193,27 @@
// work around 'char *const *'
arr[i] = strdup(args[i].c_str());
}
- return (execvp(binary.c_str(), arr) != 0);
+ return execvp(binary.c_str(), arr) == 0;
+ }
+
+ void ReportError() {
+ if (flag_list) {
+ std::cout << "Content-Type: application/X-atf-tp; version=\"1\"";
+ std::cout << std::endl << std::endl;
+ std::cout << "ident: __test_cases_list_"<< kPytestName << "_binary_" <<
+ "not_found__" << std::endl;
+ } else {
+ std::cout << "execvp(" << kPytestName << ") failed: " <<
+ std::strerror(errno) << std::endl;
+ }
}
int Process() {
SetEnv();
- return Run(kPytestName, BuildArgs());
+ if (!Run(kPytestName, BuildArgs())) {
+ ReportError();
+ }
+ return 0;
}
};
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Feb 1, 2:22 AM (16 h, 37 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28249913
Default Alt Text
D35721.diff (1 KB)
Attached To
Mode
D35721: testing: provide meaningful error when pytest is not available
Attached
Detach File
Event Timeline
Log In to Comment