tests: Move out KMS utils unit tests to its own executable

Better to split things up a bit, so one can with more ease run a
specific test.

In the KMS utils case, we don't even need a mutter context, making it
much lighter.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1927>
This commit is contained in:
Jonas Ådahl
2021-07-09 12:37:14 +02:00
committed by Marge Bot
parent ec390b68c5
commit 021a401bc8
4 changed files with 32 additions and 32 deletions

View File

@ -18,9 +18,8 @@
#include "config.h"
#include "tests/kms-utils-unit-tests.h"
#include <glib.h>
#include "tests/test-utils.h"
#include "backends/native/meta-kms-utils.h"
typedef struct {
@ -121,7 +120,7 @@ static const ModeInfoTestCase test_cases[] = {
};
static void
refresh_rate (void)
meta_test_kms_refresh_rate (void)
{
size_t index;
@ -138,8 +137,18 @@ refresh_rate (void)
}
}
void
static void
init_kms_utils_tests (void)
{
g_test_add_func ("/kms-utils/refresh-rate", refresh_rate);
g_test_add_func ("/backends/native/kms/refresh-rate",
meta_test_kms_refresh_rate);
}
int
main (int argc,
char **argv)
{
g_test_init (&argc, &argv, NULL);
init_kms_utils_tests ();
return g_test_run ();
}