Unit test report format
linD026 opened this issue · comments
I'm coding the unit test system.
Here is the example for the report message:
a - src/core.o
a - src/unify.o
a - lib/per_cpu.o
a - tests/test_watchpoint.o
------------------------------ unit test start ------------------------------
============================== detect ==============================
[1655276431041011] INFO: src/core.c:39:test_insert(): ptr=0x7ffc79773b1c size=4 type=1 watchpoint=0x5629900a2120
[1655276431041143] INFO: src/core.c:52:test_insert(): watchpoint=0x5629900a2120 old=8007ffc79773b1c new=100000000000000
[TEST SUCCESS] test_insert()
detect subsystem test failed: 2 error(s)
[1655276431041011] INFO: src/core.c+37:test_insert(): ptr=0x7ffc79773b1c size=4 type=1 watchpoint=0x5629900a2120
[1655276431041136] ERROR: src/core.c:46:test_insert(): insert(0x5629900a2120) != find(0x5629900a21e0)
[1655276431041140] ERROR: src/core.c:50:test_insert(): inserted but not found, old=8007ffc79773b1c, new=100000000000000
[1655276431041143] INFO: src/core.c+50:test_insert(): watchpoint=0x5629900a2120 old=8007ffc79773b1c new=100000000000000
[TEST SUCCESS] test_insert()
============================== detect ==============================
Please let me know if there is any other format that you want me to add.
Here is another example:
a - src/core.o
a - src/unify.o
a - lib/per_cpu.o
a - tests/test_watchpoint.o
------------------------------ unit test start ------------------------------
============================== detect ==============================
[1655325500504332] INFO: tests/test_watchpoint.c:101:test_insert_find_watchpoint(): ptr=0x7ffd695bc03c size=4 type=1 watchpoint=0x55f6353e7220
[1655325500504402] INFO: tests/test_watchpoint.c:117:test_insert_find_watchpoint(): watchpoint=0x55f6353e7220 old=8007ffd695bc03c new=9007ffd695bc03c
[TEST SUCCESS] test_insert_find_watchpoint()
[1655325500504561] INFO: tests/test_watchpoint.c:77:test_setup_report(): ptr=0x7ffd695bc054 size=4 type=1
[1655325500504590] INFO: tests/test_watchpoint.c:54:test_setup_report_thread(): ptr=0x7ffd695bc054 size=4 type=1, watchpoint=(idx=60,0x55f6353e7220)
[1655325500504709] INFO: tests/test_watchpoint.c:25:unify_report(): ptr=0x7ffd695bc054, size=4, type=1, ip=12345, old=8007ffd695bc054, new=9007ffd695bc054, changed=1
[TEST SUCCESS] test_setup_report()
detect subsystem test failed: 1 error(s)
[1655325500504332] INFO: tests/test_watchpoint.c+101:test_insert_find_watchpoint(): ptr=0x7ffd695bc03c size=4 type=1 watchpoint=0x55f6353e7220
[1655325500504402] INFO: tests/test_watchpoint.c+117:test_insert_find_watchpoint(): watchpoint=0x55f6353e7220 old=8007ffd695bc03c new=9007ffd695bc03c
[TEST SUCCESS] test_insert_find_watchpoint()
[1655325500504561] INFO: tests/test_watchpoint.c+77:test_setup_report(): ptr=0x7ffd695bc054 size=4 type=1
[1655325500504590] INFO: tests/test_watchpoint.c+54:test_setup_report_thread(): ptr=0x7ffd695bc054 size=4 type=1, watchpoint=(idx=60,0x55f6353e7220)
[1655325500504709] INFO: tests/test_watchpoint.c+25:unify_report(): ptr=0x7ffd695bc054, size=4, type=1, ip=12345, old=8007ffd695bc054, new=9007ffd695bc054, changed=1
[1655325500504716] ERROR: tests/test_watchpoint.c:29:unify_report(): encoded(48007ffd695bc054) != old(8007ffd695bc054)
[TEST SUCCESS] test_setup_report()
============================== detect ==============================