add a setting to opt-in for selftests

This commit is contained in:
cora 2021-12-14 00:21:34 +01:00
parent 6f811b3cee
commit d0540c3a1c
2 changed files with 7 additions and 3 deletions

View File

@ -85,8 +85,6 @@ local test_minetest_find_nodes_in_area_can_count = function(dtime)
assert ( 0 == nodes_difference )
end
minetest.after( 0, test_minetest_find_nodes_in_area_can_count )
local test_minetest_find_nodes_in_area_crash = function(dtime)
-- And now for our feature presentation, where we call the
-- function “minetest.find_nodes_in_area()” with a position
@ -110,4 +108,7 @@ local test_minetest_find_nodes_in_area_crash = function(dtime)
-- That's all, folks!
end
minetest.after( 0, test_minetest_find_nodes_in_area_crash )
if minetest.settings:get_bool("mclRunSelftests") then
minetest.after( 0, test_minetest_find_nodes_in_area_can_count )
minetest.after( 0, test_minetest_find_nodes_in_area_crash )
end

View File

@ -146,3 +146,6 @@ basic_pseudobiome_villages (Enables very basic, and experimental "pseudobiome-ba
# If enabled, will run an LBM to fix the top 1/2 of double plants in mcimported worlds; defaults to true.
fix_doubleplants (Mcimport double plant fixes) bool true
# Run tests on startup, crash if they fail. Particularly useful for development.
mclRunSelftests (Run Selftests on Startup) bool false