Files
Odin/core/testing/events.odin
gingerBill 842cfee0f3 Change Odin's LICENSE to zlib from BSD 3-clause
This change was made in order to allow things produced with Odin and using Odin's core library, to not require the LICENSE to also be distributed alongside the binary form.
2025-10-28 14:38:25 +00:00

57 lines
920 B
Odin

#+private
package testing
/*
(c) Copyright 2024 Feoramund <rune@swevencraft.org>.
Made available under Odin's license.
List of contributors:
Feoramund: Total rewrite.
*/
import "base:runtime"
import "core:sync/chan"
import "core:time"
Test_State :: enum {
Ready,
Running,
Successful,
Failed,
}
Update_Channel :: chan.Chan(Channel_Event)
Update_Channel_Sender :: chan.Chan(Channel_Event, .Send)
Task_Channel :: struct {
channel: Update_Channel,
test_index: int,
}
Event_New_Test :: struct {
test_index: int,
}
Event_State_Change :: struct {
new_state: Test_State,
}
Event_Set_Fail_Timeout :: struct {
at_time: time.Time,
location: runtime.Source_Code_Location,
}
Event_Log_Message :: struct {
level: runtime.Logger_Level,
text: string,
time: time.Time,
formatted_text: string,
}
Channel_Event :: union {
Event_New_Test,
Event_State_Change,
Event_Set_Fail_Timeout,
Event_Log_Message,
}