tests: Avoid printing the entire test database

Message ID 20261026201637.574025-1-valter.jansons@gmail.com
State New
Headers
Series tests: Avoid printing the entire test database |

Commit Message

Valters Jansons 26 Oct 2026, 8:16 p.m. UTC
Lua tests currently iterate the database, and dump all of its contents
into the runner's log. This might be beneficial in testing, however it
does not necessarily help during regular builds.

This commit retains the reverse_pointer() invocation, but instead of
printing simply counts the number of entries and asserts at at least
something existed.
---
 tests/lua/main.lua.in | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
  

Patch

diff --git a/tests/lua/main.lua.in b/tests/lua/main.lua.in
index c947334..290e832 100755
--- a/tests/lua/main.lua.in
+++ b/tests/lua/main.lua.in
@@ -219,9 +219,14 @@  function test_list_networks()
 	db = location.Database.open(ENV_TEST_DATABASE)
 	luaunit.assertNotNil(db)
 
+	local count = 0
+
 	for network in db:list_networks() do
-		print(network, network:reverse_pointer())
+		network:reverse_pointer()
+		count = count + 1
 	end
+
+	luaunit.assertTrue(count > 0)
 end
 
 os.exit(luaunit.LuaUnit.run())