aboutsummaryrefslogtreecommitdiff
path: root/util/travis/script.sh
Commit message (Collapse)AuthorAge
* Minetest for C++11 (CMakeLists + Travis)Loic Blot2017-06-04
| | | | | | | | | | | * Move GCC to GCC 6 & GCC 7 * Move Clang to Clang 3.6 & Clang 4.0 * LINT moves from Clang 3.9 to Clang 4.0 * Move XCode 7.3 to 8.0 * Use more travis tricks to install compilers instead of adding complexity to our build script * Clang format fixes on checked files (compat Cpp11 instead of Cpp03) * Mingw GCC update from 4.8.4 to 5.3 (Ubuntu Xenial) * Drop mingw cmake generated files and add them to gitignore
* Move LINT process in dedicated shell & fixLoic Blot2017-04-06
| | | | | Move lint to dedicated shell permit to use it from your shell easily to check what is wrong Also fix recent regressions in code style
* Clang format: only show errors on non whitelisted filesLoic Blot2017-04-06
|
* Update embedded jsoncpp from unk version to 0.10.6 + move libs to lib/ ↵Loïc Blot2017-04-02
| | | | | | | | | | | | | | | | instead of src/ (#5473) * Update embedded jsoncpp from unk version to 0.10.6 0.10.6 is last release without c++11 * Make jsoncpp more compliant with its amalgamate Jsoncpp cpp file should be upper, make the library like it does in amalgamate * Reorganization: move minetest embedded libs outside of source tree to /lib * Fix a dead grep in LINT
* clang-format: add a whitelist (#5459)Loïc Blot2017-03-27
| | | | | | | | | If file is in the whitelist, softfail, else hard failure Some files are not in whitelist and marked as normal: * src/content_mapnode.h * src/cguittfont/xCGUITTFont.cpp * src/gameparams.h * src/profiler.cpp
* clang-format: fix counter increment & output (#5456)Loïc Blot2017-03-26
| | | clang-format: fix bash syntax on increment
* clang-format: limit diff to 50 files to prevent exceding the maximum travis ↵Loïc Blot2017-03-26
| | | | output (4MB) (#5455)
* Add clang format & skip build if no source file modified (#5433)Loïc Blot2017-03-25
| | | | | | | | | | | | | | | | | | | | * [BUILD] Add clang format + build skipping * Add clang-format tool to check codestyle. Warning: it check the whole modified file, not the diff part, it's why it's lazy. Please also look if rules are perfect, i take the Linux codestyle from LLVM site Fix issue #5415 * Skip building project if no file is modified * Fix a wrong brace to trigger LINT * Make lint step outside of unix build scope * Add AccessModifierOffset: -8 * Typo fix & needs compile fix * Fix header priorities
* CI: Add memleak checking using valgrind (#5350)Loïc Blot2017-03-06
| | | Add a new step to check memleaks on our current unit tests suite
* Travis: Build server too for UNIXLoïc Blot2017-01-04
|
* Travis: Only trigger a compile, when C/C++ related files were touched (#4284)Tim2016-10-15
|
* Travis: build matrix improvements + CPP11 buildLoic Blot2016-10-06
|
* Tweak travis scriptShadowNinja2016-03-19
| | | | Exit if cd fails and don't insert '\' in string.
* Implement OSX Travis buildsPavel Puchkin2016-02-04
|
* Clean up and tweak build systemShadowNinja2015-03-27
| | | | | | | | | | | | | | | | * Combine client and server man pages. * Update unit test options and available databases in man page. * Add `--worldname` to man page. * Fix a bunch of places where `"Minetest"` was used directly instead of `PROJECT_NAME`. * Disable server build by default on all operating systems. * Make `ENABLE_FREETYPE` not fail if FreeType isn't found. * Enable LevelDB, Redis, and FreeType detection by default. * Remove the `VERSION_PATCH_ORIG` hack. * Add option to search for and use system JSONCPP. * Remove broken LuaJIT version detection. * Rename `DISABLE_LUAJIT` to `ENABLE_LUAJIT`. * Rename `minetest_*` variables in `version.{h,cpp}` to `g_*`. * Clean up style of CMake files.
* Rename --do-unittests to --run-unittests as @Zeno- and @sfan5 requestedLoic Blot2015-02-24
|
* Unit tests must be done at integration process.Loic Blot2015-02-21
| | | | | | * Remove --enable-unittests and --disable-unittests and add --do-unittests function * --do-unittests function will exit 0 on success. * minetest and minetestserver binaries are launched with --do-unittests in travis build.
* Add LevelDB and redis to Travis Linux buildssfan52015-02-16
|
* Build for win32 & win64 on Travis toosfan52014-12-06
a">end atc.controllers[pts] = data end end function atc.save_data() return {controllers = atc.controllers} end --contents: {command="...", arrowconn=0-15 where arrow points} --general function atc.train_set_command(train, command, arrow) atc.train_reset_command(train, true) train.atc_delay = 0 train.atc_arrow = arrow train.atc_command = command end function atc.send_command(pos, par_tid) local pts=minetest.pos_to_string(pos) if atc.controllers[pts] then --atprint("Called send_command at "..pts) local train_id = par_tid or advtrains.get_train_at_pos(pos) if train_id then if advtrains.trains[train_id] then --atprint("send_command inside if: "..sid(train_id)) if atc.controllers[pts].arrowconn then atlog("ATC controller at",pts,": This controller had an arrowconn of", atc.controllers[pts].arrowconn, "set. Since this field is now deprecated, it was removed.") atc.controllers[pts].arrowconn = nil end local train = advtrains.trains[train_id] local index = advtrains.path_lookup(train, pos) local iconnid = 1 if index then iconnid = train.path_cn[index] else atwarn("ATC rail at", pos, ": Rail not on train's path! Can't determine arrow direction. Assuming +!") end local command = atc.controllers[pts].command command = eval_conditional(command, iconnid==1, train.velocity) if not command then command="" end command=string.match(command, "^%s*(.*)$") if command == "" then atprint("Sending ATC Command to", train_id, ": Not modifying, conditional evaluated empty.") return true end atc.train_set_command(train, command, iconnid==1) atprint("Sending ATC Command to", train_id, ":", command, "iconnid=",iconnid) return true else atwarn("ATC rail at", pos, ": Sending command failed: The train",train_id,"does not exist. This seems to be a bug.") end else atwarn("ATC rail at", pos, ": Sending command failed: There's no train at this position. This seems to be a bug.") -- huch --local train = advtrains.trains[train_id_temp_debug] --atlog("Train speed is",train.velocity,", have moved",train.dist_moved_this_step,", lever",train.lever) --advtrains.path_print(train, atlog) -- TODO track again when ATC bugs occur... end else atwarn("ATC rail at", pos, ": Sending command failed: Entry for controller not found.") atwarn("ATC rail at", pos, ": Please visit controller and click 'Save'") end return false end -- Resets any ATC commands the train is currently executing, including the target speed (tarvelocity) it is instructed to hold -- if keep_tarvel is set, does not clear the tarvelocity function atc.train_reset_command(train, keep_tarvel) train.atc_command=nil train.atc_delay=nil train.atc_brake_target=nil train.atc_wait_finish=nil train.atc_wait_autocouple=nil train.atc_arrow=nil if not keep_tarvel then train.tarvelocity=nil end end --nodes local idxtrans={static=1, mesecon=2, digiline=3} local apn_func=function(pos) -- FIX for long-persisting ndb bug: there's no node in parameter 2 of this function! local meta=minetest.get_meta(pos) if meta then meta:set_string("infotext", attrans("Unconfigured ATC controller")) meta:set_string("formspec", atc.get_atc_controller_formspec(pos, meta)) end end advtrains.atc_function = function(def, preset, suffix, rotation) return { after_place_node=apn_func, after_dig_node=function(pos) advtrains.invalidate_all_paths(pos) advtrains.ndb.clear(pos) local pts=minetest.pos_to_string(pos) atc.controllers[pts]=nil end, on_receive_fields = function(pos, formname, fields, player) if advtrains.is_protected(pos, player:get_player_name()) then minetest.record_protection_violation(pos, player:get_player_name()) return end local meta=minetest.get_meta(pos) if meta then if not fields.save then --[[--maybe only the dropdown changed if fields.mode then meta:set_string("mode", idxtrans[fields.mode]) if fields.mode=="digiline" then meta:set_string("infotext", attrans("ATC controller, mode @1\nChannel: @2", fields.mode, meta:get_string("command")) ) else meta:set_string("infotext", attrans("ATC controller, mode @1\nCommand: @2", fields.mode, meta:get_string("command")) ) end meta:set_string("formspec", atc.get_atc_controller_formspec(pos, meta)) end]]-- return end --meta:set_string("mode", idxtrans[fields.mode]) meta:set_string("command", fields.command) --meta:set_string("command_on", fields.command_on) meta:set_string("channel", fields.channel) --if fields.mode=="digiline" then -- meta:set_string("infotext", attrans("ATC controller, mode @1\nChannel: @2", fields.mode, meta:get_string("command")) ) --else meta:set_string("infotext", attrans("ATC controller, mode @1\nCommand: @2", "-", meta:get_string("command")) ) --end meta:set_string("formspec", atc.get_atc_controller_formspec(pos, meta)) local pts=minetest.pos_to_string(pos) local _, conns=advtrains.get_rail_info_at(pos, advtrains.all_tracktypes) atc.controllers[pts]={command=fields.command} if #advtrains.occ.get_trains_at(pos) > 0 then atc.send_command(pos) end end end, advtrains = { on_train_enter = function(pos, train_id) atc.send_command(pos, train_id) end, }, } end function atc.get_atc_controller_formspec(pos, meta) local mode=tonumber(meta:get_string("mode")) or 1 local command=meta:get_string("command") local command_on=meta:get_string("command_on") local channel=meta:get_string("channel") local formspec="size[8,6]" -- "dropdown[0,0;3;mode;static,mesecon,digiline;"..mode.."]" if mode<3 then formspec=formspec .."style[command;font=mono]" .."field[0.8,1.5;7,1;command;"..attrans("Command")..";"..minetest.formspec_escape(command).."]" if tonumber(mode)==2 then formspec=formspec .."style[command_on;font=mono]" .."field[0.8,3;7,1;command_on;"..attrans("Command (on)")..";"..minetest.formspec_escape(command_on).."]" end else formspec=formspec.."field[0.8,1.5;7,1;channel;"..attrans("Digiline channel")..";"..minetest.formspec_escape(channel).."]" end return formspec.."button_exit[0.5,4.5;7,1;save;"..attrans("Save").."]" end --from trainlogic.lua train step local matchptn={ ["SM"]=function(id, train) train.tarvelocity=train.max_speed return 2 end, ["S([0-9]+)"]=function(id, train, match) train.tarvelocity=tonumber(match) return #match+1 end, ["B([0-9]+)"]=function(id, train, match) local btar = tonumber(match) if train.velocity>btar then train.atc_brake_target=btar if not train.tarvelocity or train.tarvelocity>btar then train.tarvelocity=btar end else -- independent of brake target, must make sure that tarvelocity is not greater than it if train.tarvelocity and train.tarvelocity>btar then train.tarvelocity=btar end end return #match+1 end, ["BB"]=function(id, train) train.atc_brake_target = -1 train.tarvelocity = 0 return 2 end, ["W"]=function(id, train) train.atc_wait_finish=true return 1 end, ["D([0-9]+)"]=function(id, train, match) train.atc_delay=tonumber(match) return #match+1 end, ["R"]=function(id, train) if train.velocity<=0 then advtrains.invert_train(id) advtrains.train_ensure_init(id, train) -- no one minds if this failed... this shouldn't even be called without train being initialized... else atwarn(sid(id), attrans("ATC Reverse command warning: didn't reverse train, train moving.")) end return 1 end, ["O([LRC])"]=function(id, train, match) local tt={L=-1, R=1, C=0} local arr=train.atc_arrow and 1 or -1 train.door_open = tt[match]*arr return 2 end, ["K"] = function(id, train) if train.door_open == 0 then atwarn(sid(id), attrans("ATC Kick command warning: doors are closed.")) return 1 end if train.velocity > 0 then atwarn(sid(id), attrans("ATC Kick command warning: train moving.")) return 1 end local tp = train.trainparts for i=1,#tp do local data = advtrains.wagons[tp[i]] local obj = advtrains.wagon_objects[tp[i]] if data and obj then local ent = obj:get_luaentity() if ent then for seatno,seat in pairs(ent.seats) do if data.seatp[seatno] and not ent:is_driver_stand(seat) then ent:get_off(seatno) end end end end end return 1 end, ["A([01])"]=function(id, train, match) if not advtrains.interlocking then return 2 end advtrains.interlocking.ars_set_disable(train, match=="0") return 2 end, ["Cpl"]=function(id, train) train.atc_wait_autocouple=true return 3 end, } eval_conditional = function(command, arrow, speed) --conditional statement? local is_cond, cond_applies, compare local cond, rest=string.match(command, "^I([%+%-])(.+)$") if cond then is_cond=true if cond=="+" then cond_applies=arrow end if cond=="-" then cond_applies=not arrow end else cond, compare, rest=string.match(command, "^I([<>]=?)([0-9]+)(.+)$") if cond and compare then is_cond=true if cond=="<" then cond_applies=speed<tonumber(compare) end if cond==">" then cond_applies=speed>tonumber(compare) end if cond=="<=" then cond_applies=speed<=tonumber(compare) end if cond==">=" then cond_applies=speed>=tonumber(compare) end end end if is_cond then atprint("Evaluating if statement: "..command) atprint("Cond: "..(cond or "nil")) atprint("Applies: "..(cond_applies and "true" or "false")) atprint("Rest: "..rest) --find end of conditional statement local nest, pos, elsepos=0, 1 while nest>=0 do if pos>#rest then atwarn(sid(id), attrans("ATC command syntax error: I statement not closed: @1",command)) return "" end local char=string.sub(rest, pos, pos) if char=="I" then nest=nest+1 end if char==";" then nest=nest-1 end if nest==0 and char=="E" then elsepos=pos+0 end pos=pos+1 end if not elsepos then elsepos=pos-1 end if cond_applies then command=string.sub(rest, 1, elsepos-1)..string.sub(rest, pos) else command=string.sub(rest, elsepos+1, pos-2)..string.sub(rest, pos) end atprint("Result: "..command) end return command end function atc.execute_atc_command(id, train) --strip whitespaces local command=string.match(train.atc_command, "^%s*(.*)$") if string.match(command, "^%s*$") then train.atc_command=nil return end train.atc_command = eval_conditional(command, train.atc_arrow, train.velocity) if not train.atc_command then return end command=string.match(train.atc_command, "^%s*(.*)$") if string.match(command, "^%s*$") then train.atc_command=nil return end for pattern, func in pairs(matchptn) do local match=string.match(command, "^"..pattern) if match then local patlen=func(id, train, match) --atdebug("Executing: "..string.sub(command, 1, patlen)) --atdebug("Train ATC State: tvel=",train.tarvelocity,"brktar=",train.atc_brake_target,"delay=",train.atc_delay,"wfinish=",train.atc_wait_finish,"wacpl=",train.atc_wait_autocouple) train.atc_command=string.sub(command, patlen+1) if train.atc_delay<=0 and not train.atc_wait_finish and not train.atc_wait_autocouple then --continue (recursive, cmds shouldn't get too long, and it's a end-recursion.) atc.execute_atc_command(id, train) end return end end atwarn(sid(id), attrans("ATC command parse error: Unknown command: @1", command)) atc.train_reset_command(train, true) end --move table to desired place advtrains.atc=atc