util/xmlconfig: Test values set via the environment

driconf options can also be set via environment variables.  This is a
simple touch-test of that feature.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12477>
This commit is contained in:
Ian Romanick 2021-08-16 11:20:56 -07:00 committed by Marge Bot
parent 1a6d1e9309
commit 2b4b31044d
1 changed files with 13 additions and 0 deletions

View File

@ -110,6 +110,19 @@ TEST_F(xmlconfig_test, enums)
EXPECT_EQ(driQueryOptioni(&options, "vblank_mode"), DRI_CONF_VBLANK_DEF_INTERVAL_1);
}
TEST_F(xmlconfig_test, enums_from_env)
{
driOptionDescription driconf[] = {
DRI_CONF_SECTION_MISCELLANEOUS
DRI_CONF_VBLANK_MODE(DRI_CONF_VBLANK_DEF_INTERVAL_1)
};
setenv("vblank_mode", "0", 1);
driParseOptionInfo(&options, driconf, ARRAY_SIZE(driconf));
EXPECT_EQ(0, driQueryOptioni(&options, "vblank_mode"));
}
TEST_F(xmlconfig_test, string)
{
driOptionDescription driconf[] = {