mirror of
https://github.com/CLIUtils/CLI11.git
synced 2025-05-06 07:03:52 +00:00
Adding a test for coverage
This commit is contained in:
parent
067bb43a84
commit
b17f7ce63a
@ -9,13 +9,12 @@ format_file() {
|
|||||||
file="${1}"
|
file="${1}"
|
||||||
case "$file" in
|
case "$file" in
|
||||||
*.hpp | *.cpp | .c | *.cc | *.cu | *.h )
|
*.hpp | *.cpp | .c | *.cc | *.cu | *.h )
|
||||||
echo "Formatting: $file"
|
|
||||||
clang-format -i -style=file -sort-includes "${1}"
|
clang-format -i -style=file -sort-includes "${1}"
|
||||||
if git diff-file --quiet -- "${1}" ; then
|
if git diff-files --quiet -- "${1}" ; then
|
||||||
|
echo "Already formatted: ${1}"
|
||||||
|
else
|
||||||
git add "${1}"
|
git add "${1}"
|
||||||
echo "Reformatting file: ${1}"
|
echo "Reformatting file: ${1}"
|
||||||
else
|
|
||||||
echo "Already formatted: ${1}"
|
|
||||||
fi;
|
fi;
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
|
@ -331,13 +331,15 @@ TEST_F(TApp, OptionFromDefaultsSubcommands) {
|
|||||||
EXPECT_EQ(app2->option_defaults()->get_group(), "Something");
|
EXPECT_EQ(app2->option_defaults()->get_group(), "Something");
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(TApp, HelpFlagFromDefaultsSubcommands) {
|
TEST_F(TApp, GetNameCheck) {
|
||||||
app.set_help_flag("--that", "Wow");
|
int x;
|
||||||
|
auto a = app.add_flag("--that");
|
||||||
|
auto b = app.add_flag("-x");
|
||||||
|
auto c = app.add_option("pos", x);
|
||||||
|
|
||||||
auto app2 = app.add_subcommand("app2");
|
EXPECT_EQ(a->get_name(), "--that");
|
||||||
|
EXPECT_EQ(b->get_name(), "-x");
|
||||||
EXPECT_EQ(app2->get_help_ptr()->get_name(), "--that");
|
EXPECT_EQ(c->get_name(), "pos");
|
||||||
EXPECT_EQ(app2->get_help_ptr()->get_description(), "Wow");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(TApp, SubcommandDefaults) {
|
TEST_F(TApp, SubcommandDefaults) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user