mirror of
https://github.com/darlinghq/xcbuild.git
synced 2024-12-02 09:06:23 +00:00
enable-on-demand-resources has YES/NO argument
This commit is contained in:
parent
a8f02e7b34
commit
7ebc1a4acd
@ -72,7 +72,7 @@ parseArgument(std::vector<std::string> const &args, std::vector<std::string>::co
|
||||
} else if (arg == "--launch-image") {
|
||||
return libutil::Options::NextString(&_launchImage, args, it);
|
||||
} else if (arg == "--enable-on-demand-resources") {
|
||||
return libutil::Options::MarkBool(&_enableOnDemandResources, arg);
|
||||
return libutil::Options::NextBool(&_enableOnDemandResources, args, it, true);
|
||||
} else if (arg == "--enable-incremental-distill") {
|
||||
return libutil::Options::MarkBool(&_enableIncrementalDistill, arg);
|
||||
} else if (arg == "--target-name") {
|
||||
|
@ -19,3 +19,20 @@ TEST(Options, InvalidDocumentedOptions)
|
||||
EXPECT_FALSE(result1.first);
|
||||
}
|
||||
|
||||
TEST(Options, OnDemandResourcesFlag)
|
||||
{
|
||||
Options invalid;
|
||||
auto result1 = libutil::Options::Parse<Options>(&invalid, { "--enable-on-demand-resources" });
|
||||
EXPECT_FALSE(result1.first);
|
||||
|
||||
Options yes;
|
||||
auto result2 = libutil::Options::Parse<Options>(&yes, { "--enable-on-demand-resources", "YES" });
|
||||
EXPECT_TRUE(result2.first);
|
||||
EXPECT_TRUE(yes.enableOnDemandResources());
|
||||
|
||||
Options no;
|
||||
auto result3 = libutil::Options::Parse<Options>(&no, { "--enable-on-demand-resources", "NO" });
|
||||
EXPECT_TRUE(result3.first);
|
||||
EXPECT_FALSE(no.enableOnDemandResources());
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user