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
-- execute dofile("luassert_luaunit_adapter.lua") | |
-- then execute dofile("file_with_your_tests.lua" | |
local luaunit = require("luaunit") | |
local astate = require("luassert.state") | |
local util = require("luassert.util") | |
---prepends LuaUnit FAILURE_PREFIX to luassert custom failure message | |
---in order to make LuaUnit pick up test failures as failures instead of errors. | |
local function prepender(state, arguments, level) |
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 is just an example - requires error checking | |
// Due to reflection, it is not necessary to reference the log4net assembly | |
var iLog = LogManager.GetLogger(typeof(TcpStreamFactory)); | |
var field = iLog.GetType().GetField("_logger", BindingFlags.Instance | BindingFlags.NonPublic); | |
var log4netlog = field.GetValue(iLog); | |
var propLogger = log4netlog.GetType().GetProperty("Logger"); | |
var logger = propLogger.GetValue(log4netlog); | |
var propLevel = logger.GetType().GetProperty("Level"); | |
var origLevel = propLevel.GetValue(logger); |
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
rem pause if run from windows explorer (match 'cmd.exe /c ""%~0"') | |
rem note that this is not bulletproof - other tools may use cmd /c <your file> to run your script! | |
echo %cmdcmdline%|find /i /c "cmd.exe /c """"%~0""" >nul && pause |