Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions tests/lib/GestureControllerTest.vala
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,3 @@ public class Gala.GestureControllerTest : MutterTestCase {
run_main_loop ();
}
}

public int main (string[] args) {
return new Gala.GestureControllerTest ().run (args);
}
29 changes: 29 additions & 0 deletions tests/lib/Main.vala
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*
* Copyright 2026 elementary, Inc. (https://elementary.io)
* SPDX-License-Identifier: GPL-3.0-or-later
*/

namespace Gala {
public int main (string[] args) {
var test_name = args[1];

var test_case = get_test_case (test_name);

if (test_case == null) {
warning ("TestCase %s not found", test_name);
return 1;
}

return test_case.run (args);
}

private TestCase? get_test_case (string name) {
switch (name) {
case "GestureControllerTest": return new GestureControllerTest ();
case "PropertyTargetTest": return new PropertyTargetTest ();
case "SetupTest": return new SetupTest ();
case "SwipeTriggerTest": return new SwipeTriggerTest ();
default: return null;
}
}
}
4 changes: 0 additions & 4 deletions tests/lib/PropertyTargetTest.vala
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,3 @@ public class Gala.PropertyTargetTest : TestCase {
assert_finalize_object<MockObject> (ref target);
}
}

public int main (string[] args) {
return new Gala.PropertyTargetTest ().run (args);
}
4 changes: 0 additions & 4 deletions tests/lib/SetupTest.vala
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,3 @@ public class Gala.SetupTest : MutterTestCase {
assert_cmpint (frames, GT, 0);
}
}

public int main (string[] args) {
return new Gala.SetupTest ().run (args);
}
4 changes: 0 additions & 4 deletions tests/lib/SwipeTriggerTest.vala
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,3 @@ public class Gala.SwipeTriggerTest : MutterTestCase {
assert_finalize_object (ref trigger);
}
}

public int main (string[] args) {
return new Gala.SwipeTriggerTest ().run (args);
}
29 changes: 20 additions & 9 deletions tests/lib/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,26 @@ tests = [
'SwipeTriggerTest',
]

test_sources = []
foreach test : tests
test_executable = executable(
test,
'@0@.vala'.format(test),
common_test_sources,
gala_lib_sources,
dependencies: gala_base_dep,
install: false,
)
test_sources += test + '.vala'
endforeach

lib_test_sources = [
'Main.vala'
]

test(test, test_executable, suite: ['Gala', 'Gala/lib'], is_parallel: false)
test_executable = executable(
'io.elementary.gala.tests',
common_test_sources,
lib_test_sources,
test_sources,
gala_lib_sources,
dependencies: gala_base_dep,
install: false,
)

foreach test : tests
test(test, test_executable, args: test, suite: ['Gala', 'Gala/lib'], is_parallel: false)
endforeach