pluto/test/mock/kernel/log_mock.zig
ED d5d4082a66 Fixed tesing
Add mocking of functions


Added new function type


Fixed up the mock testing


Working mock_framework :), fixed up all tests for VGA and TTY


Adding tests


VGA testing done


Fin vga and tty mock testing


Fixed build


Removed white spaces


WIP


Added tests for all build modes + reduced import string length for testing


Added comments refactoring


Re-added constants


Added some comments


Updated to master of zig


Added unit tests to pipeline


PR comments


Fixed typos
2019-09-08 20:48:23 +01:00

50 lines
No EOL
1.4 KiB
Zig

const mock_framework = @import("mock_framework.zig");
pub const Level = enum {
INFO,
DEBUG,
WARNING,
ERROR
};
fn logCallback(context: void, str: []const u8) anyerror!void {}
pub fn log(comptime level: Level, comptime format: []const u8, args: ...) void {
//return mock_framework.performAction("log", void, level, format, args);
}
pub fn logInfo(comptime format: []const u8, args: ...) void {
//return mock_framework.performAction("logInfo", void, format, args);
}
pub fn logDebug(comptime format: []const u8, args: ...) void {
//return mock_framework.performAction("logDebug", void, format, args);
}
pub fn logWarning(comptime format: []const u8, args: ...) void {
//return mock_framework.performAction("logWarning", void, format, args);
}
pub fn logError(comptime format: []const u8, args: ...) void {
//return mock_framework.performAction("logError", void, format, args);
}
pub fn addRepeatFunction(comptime fun_name: []const u8, function: var) void {
mock_framework.addRepeatFunction(fun_name, function);
}
pub fn addTestFunction(comptime fun_name: []const u8, function: var) void {
mock_framework.addRepeatFunction(fun_name, function);
}
pub fn addTestParams(comptime fun_name: []const u8, params: ...) void {
mock_framework.addTestParams(fun_name, params);
}
pub fn initTest() void {
mock_framework.initTest();
}
pub fn freeTest() void {
mock_framework.freeTest();
}