Page MenuHomeFreeBSD

D37894.diff
No OneTemporary

D37894.diff

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
@@ -65,7 +65,7 @@
// * without schebang args
// atf_wrap /path/to/script -l
// Running test:
- // atf_wrap '-P /path' /path/to/script -r /path1 -s /path2 -vk1=v1 testname
+ // atf_wrap '-P /path' /path/to/script -r /path1 -s /path2 -vk1=v1 testname
void Parse(int argc, char **argv) {
if (flag_debug) {
PrintVector("IN", ToVector(argc, argv));
@@ -89,34 +89,34 @@
// The next argument is a script name. Copy and keep argc/argv the same
// Show usage for empty args
if (argc == 0) {
- Usage("Must provide a test case name", true);
+ Usage("Must provide a test case name", true);
}
script_path = std::string(argv[0]);
int c;
while ((c = getopt(argc, argv, "lr:s:v:")) != -1) {
switch (c) {
- case 'l':
- flag_list = true;
- break;
- case 's':
- src_dir = std::string(optarg);
- break;
- case 'r':
- dst_file = std::string(optarg);
- break;
- case 'v':
- {
- std::string kv = std::string(optarg);
- size_t splitter = kv.find("=");
- if (splitter == std::string::npos) {
- Usage("Unknown variable: " + kv, true);
- }
- kv_map[kv.substr(0, splitter)] = kv.substr(splitter + 1);
- }
- break;
- default:
- Usage("Unknown option -" + std::string(1, static_cast<char>(c)), true);
+ case 'l':
+ flag_list = true;
+ break;
+ case 's':
+ src_dir = std::string(optarg);
+ break;
+ case 'r':
+ dst_file = std::string(optarg);
+ break;
+ case 'v':
+ {
+ std::string kv = std::string(optarg);
+ size_t splitter = kv.find("=");
+ if (splitter == std::string::npos) {
+ Usage("Unknown variable: " + kv, true);
+ }
+ kv_map[kv.substr(0, splitter)] = kv.substr(splitter + 1);
+ }
+ break;
+ default:
+ Usage("Unknown option -" + std::string(1, static_cast<char>(c)), true);
}
}
argc -= optind;
@@ -138,7 +138,8 @@
}
std::vector<std::string> BuildArgs() {
- std::vector<std::string> args = {"pytest", "-p", "no:cacheprovider", "-s", "--atf"};
+ std::vector<std::string> args = {"pytest", "-vv", "-p",
+ "no:cacheprovider", "-s", "--atf"};
if (flag_list) {
args.push_back("--co");
@@ -179,7 +180,7 @@
// Pass ATF kv pairs as env variables to avoid dealing with
// pytest parser
for (auto [k, v]: kv_map) {
- setenv((kAtfVar + k).c_str(), v.c_str(), 1);
+ setenv((kAtfVar + k).c_str(), v.c_str(), 1);
}
}
@@ -190,7 +191,7 @@
// allocate array with final NULL
char **arr = new char*[args.size() + 1]();
for (unsigned long i = 0; i < args.size(); i++) {
- // work around 'char *const *'
+ // work around 'char *const *'
arr[i] = strdup(args[i].c_str());
}
return execvp(binary.c_str(), arr) == 0;
@@ -204,7 +205,7 @@
"not_found__" << std::endl;
} else {
std::cout << "execvp(" << kPytestName << ") failed: " <<
- std::strerror(errno) << std::endl;
+ std::strerror(errno) << std::endl;
}
}

File Metadata

Mime Type
text/plain
Expires
Mon, Jan 20, 7:35 PM (21 h, 50 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15982605
Default Alt Text
D37894.diff (3 KB)

Event Timeline