Skip to content

Commit eb2636e

Browse files
authored
Update help text (#199)
Signed-off-by: Dave Thaler <[email protected]>
1 parent 7d59494 commit eb2636e

File tree

1 file changed

+37
-7
lines changed

1 file changed

+37
-7
lines changed

src/runner.cc

Lines changed: 37 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,12 @@ _get_test_files(const std::filesystem::path& test_file_directory)
6262

6363
static const std::map<std::string, bpf_conformance_groups_t> _conformance_groups = {
6464
{"atomic32", bpf_conformance_groups_t::atomic32},
65-
{"atomic64", bpf_conformance_groups_t::atomic64},
65+
{"atomic64", bpf_conformance_groups_t::atomic32 | bpf_conformance_groups_t::atomic64},
6666
{"base32", bpf_conformance_groups_t::base32},
67-
{"base64", bpf_conformance_groups_t::base64},
67+
{"base64", bpf_conformance_groups_t::base32 | bpf_conformance_groups_t::base64},
6868
{"callx", bpf_conformance_groups_t::callx},
6969
{"divmul32", bpf_conformance_groups_t::divmul32},
70-
{"divmul64", bpf_conformance_groups_t::divmul64},
70+
{"divmul64", bpf_conformance_groups_t::divmul32 | bpf_conformance_groups_t::divmul64},
7171
{"packet", bpf_conformance_groups_t::packet}};
7272

7373
static std::optional<bpf_conformance_groups_t>
@@ -79,6 +79,19 @@ _get_conformance_group_by_name(std::string group)
7979
return _conformance_groups.find(group)->second;
8080
}
8181

82+
static std::string
83+
_get_conformance_group_names()
84+
{
85+
std::string result;
86+
for (const auto& entry : _conformance_groups) {
87+
if (!result.empty()) {
88+
result += ", ";
89+
}
90+
result += entry.first;
91+
}
92+
return result;
93+
}
94+
8295
int
8396
main(int argc, char** argv)
8497
{
@@ -98,13 +111,13 @@ main(int argc, char** argv)
98111
"debug", boost::program_options::value<bool>(), "Print debug information")(
99112
"xdp_prolog", boost::program_options::value<bool>(), "XDP prolog")(
100113
"elf", boost::program_options::value<bool>(), "ELF format")(
101-
"cpu_version", boost::program_options::value<std::string>(), "CPU version")(
114+
"cpu_version", boost::program_options::value<std::string>(), "CPU version (valid values: v1, v2, v3, v4), default is v3")(
102115
"include_groups",
103116
boost::program_options::value<std::vector<std::string>>()->multitoken(),
104-
"Include conformance groups")(
117+
("Include conformance groups (valid group names: " + _get_conformance_group_names() + ")").c_str())(
105118
"exclude_groups",
106119
boost::program_options::value<std::vector<std::string>>()->multitoken(),
107-
"Exclude conformance groups")(
120+
"Exclude conformance groups, where callx and packet are excluded by default")(
108121
"include_regex", boost::program_options::value<std::string>(), "Include regex")(
109122
"exclude_regex", boost::program_options::value<std::string>(), "Exclude regex");
110123

@@ -113,7 +126,24 @@ main(int argc, char** argv)
113126
boost::program_options::notify(vm);
114127

115128
if (vm.count("help")) {
116-
std::cout << desc << std::endl;
129+
std::cout << "Usage: bpf_conformance_runner [options]" << std::endl;
130+
std::cout << std::endl << desc;
131+
std::cout << R"(
132+
Examples:
133+
bpf_conformance_runner --test_file_directory ./tests --plugin_path ./my_plugin --exclude_groups atomic64
134+
Run all tests in the ./tests directory, allowing instructions in cpu version 3
135+
but without the atomic64 (or atomic32 which is a subset of atomic64), callx, or packet
136+
conformance groups.
137+
138+
bpf_conformance_runner --test_file_directory ./tests --plugin_path ./my_plugin --cpu_version v2 --include_groups callx atomic64 --exclude_groups atomic32
139+
Run all tests in the ./tests directory, allowing instructions in cpu version 2
140+
plus the callx and atomic64 conformance groups, except for those in atomic32 or packet.
141+
142+
bpf_conformance_runner --test_file_directory ./tests --plugin_path ./my_plugin --exclude_regex "lock+"
143+
Run all tests in the ./tests directory, allowing instructions in cpu version 3
144+
but without the callx or packet conformance group, skipping any tests whose
145+
filenames contain "loc" followed by one or more "k"s.
146+
)";
117147
return 1;
118148
}
119149

0 commit comments

Comments
 (0)