-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tests for power tools
- Loading branch information
Showing
11 changed files
with
342 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,10 @@ | ||
on: [push, pull_request] | ||
name: luacheck | ||
on: [push, pull_request] | ||
jobs: | ||
lint: | ||
luacheck: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@master | ||
- name: lint | ||
uses: Roang-zero1/factorio-mod-luacheck@master | ||
with: | ||
luacheckrc_url: "" | ||
- name: Checkout | ||
uses: actions/checkout@master | ||
- name: Luacheck | ||
uses: lunarmodules/luacheck@master |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
mineunit:set_modpath("default", "spec/fixtures") | ||
|
||
local function register_node(name, groups, additional_definition) | ||
local definition = { | ||
description = name.." description", | ||
tiles = { "default_"..name }, | ||
groups = groups, | ||
} | ||
for k,v in pairs(additional_definition or {}) do definition[k] = v end | ||
minetest.register_node(":default:"..name, definition) | ||
end | ||
|
||
local function register_item(name) | ||
minetest.register_craftitem(":default:"..name, { | ||
description = name.." description", | ||
}) | ||
end | ||
|
||
-- Register some basic nodes for cutting, grinding, digging, registering recipes etc. | ||
register_node("stone", {cracky = 3, stone = 1}, {is_ground_content = true, drop = "default:cobble"}) | ||
register_node("cobble", {cracky=3, stone = 2}) | ||
register_node("sand", {snappy=2, choppy=2, oddly_breakable_by_hand=2}) | ||
register_node("wood", {tree=1, choppy=2, oddly_breakable_by_hand=2}) | ||
register_node("dirt", {crumbly = 3, soil = 1}) | ||
register_node("sandstone", {crumbly = 1, cracky = 3}) | ||
register_node("steelblock", {cracky = 1, level = 2}) | ||
register_node("furnace", {cracky=2}) | ||
register_node("furnace_active", {cracky=2, not_in_creative_inventory=1}, {drop = "default:furnace"}) | ||
|
||
register_item("steel_ingot") | ||
|
||
screwdriver = {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
-- Simple digilines mod fixture that logs sent messages, works with some simple digiline mods | ||
|
||
mineunit:set_modpath("digilines", "spec/fixtures") | ||
|
||
digilines = { | ||
_msg_log = {}, | ||
receptor_send = function(pos, rules, channel, msg) | ||
table.insert(digilines._msg_log, { | ||
pos = pos, | ||
rules = rules, | ||
channel = channel, | ||
msg = msg, | ||
}) | ||
end, | ||
rules = { | ||
default = { | ||
{x=0, y=0, z=-1}, | ||
{x=1, y=0, z=0}, | ||
{x=-1, y=0, z=0}, | ||
{x=0, y=0, z=1}, | ||
{x=1, y=1, z=0}, | ||
{x=1, y=-1, z=0}, | ||
{x=-1, y=1, z=0}, | ||
{x=-1, y=-1, z=0}, | ||
{x=0, y=1, z=1}, | ||
{x=0, y=-1, z=1}, | ||
{x=0, y=1, z=-1}, | ||
{x=0, y=-1, z=-1} | ||
} | ||
} | ||
} | ||
|
||
digilines = setmetatable(digilines, { | ||
__call = function(self,...) return self end, | ||
__index = function(...) return function(...)end end, | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
mineunit:set_modpath("mesecons", "spec/fixtures") | ||
mineunit:set_modpath("mesecons_mvps", "spec/fixtures") | ||
|
||
mesecon = { | ||
state = {}, | ||
rules = { | ||
default = { | ||
{x = 0, y = 0, z = -1}, | ||
{x = 1, y = 0, z = 0}, | ||
{x = -1, y = 0, z = 0}, | ||
{x = 0, y = 0, z = 1}, | ||
{x = 1, y = 1, z = 0}, | ||
{x = 1, y = -1, z = 0}, | ||
{x = -1, y = 1, z = 0}, | ||
{x = -1, y = -1, z = 0}, | ||
{x = 0, y = 1, z = 1}, | ||
{x = 0, y = -1, z = 1}, | ||
{x = 0, y = 1, z = -1}, | ||
{x = 0, y = -1, z = -1}, | ||
} | ||
} | ||
} | ||
|
||
mesecon = setmetatable(mesecon, { | ||
__call = function(self,...) return self end, | ||
__index = function(...) return function(...)end end, | ||
}) |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
enable_cans = true | ||
enable_chainsaw = true | ||
enable_flashlight = true | ||
enable_mining_drill = true | ||
enable_mining_laser = true | ||
enable_multimeter = true | ||
enable_prospector = true | ||
enable_sonic_screwdriver = true | ||
enable_tree_tap = true | ||
enable_vacuum = true | ||
|
||
multimeter_remote_start_ttl = 300 | ||
|
||
enable_wind_mill = true | ||
enable_nuclear_reactor_digiline_selfdestruct = true | ||
quarry_max_depth = 100 | ||
quarry_time_limit = 5000 | ||
|
||
switch_off_delay_seconds = 1800 | ||
network_overload_reset_time = 20 | ||
admin_priv = basic_privs | ||
enable_corium_griefing = true | ||
enable_radiation_protection = true | ||
enable_radiation_throttling = true | ||
enable_entity_radiation_damage = true | ||
enable_longterm_radiation_damage = true | ||
max_lag_reduction_multiplier = 0.99 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
-- Use this fixture when loading full Technic mod. | ||
-- Loads all required modules and fixtures for technic | ||
|
||
-- Load modules required by tests | ||
mineunit("core") | ||
mineunit("player") | ||
mineunit("protection") | ||
mineunit("common/after") | ||
mineunit("server") | ||
mineunit("voxelmanip") | ||
if mineunit:config("engine_version") ~= "mineunit" then | ||
mineunit("game/voxelarea") | ||
end | ||
|
||
-- Load fixtures required by tests | ||
fixture("default") | ||
fixture("mesecons") | ||
fixture("digilines") | ||
fixture("pipeworks") | ||
|
||
-- Load technic_worldgen | ||
fixture("technic_worldgen") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
-- Load technic_worldgen mod | ||
|
||
mineunit:set_modpath("technic_worldgen", "../technic_worldgen") | ||
|
||
mineunit:set_current_modname("technic_worldgen") | ||
sourcefile("../technic_worldgen/init") | ||
mineunit:restore_current_modname() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
deprecated = "ignore" | ||
time_step = 100 | ||
exclude = { | ||
-- Integration tests are not part of mod code | ||
"integration_test", | ||
-- These are commented out, not part of mod without manually editing code | ||
"machines/MV/lighting", | ||
"machines/MV/power_radiator", | ||
-- Exclude everything outside of technic directory, some are tested but we do not want stats for these | ||
"^../" | ||
} |
Oops, something went wrong.