13 Commits

Author SHA1 Message Date
copilot-swe-agent[bot]
2e0668d4f8 docs: add unit test documentation to README.md and doc/testing.md
Agent-Logs-Url: https://github.com/tbamud/tbamud/sessions/dd8af74a-9ecb-485b-851a-96b38b3cfc79

Co-authored-by: welcor <357770+welcor@users.noreply.github.com>
2026-04-22 22:31:37 +00:00
copilot-swe-agent[bot]
13c6f6291c fix: add time attributes to JUnit XML to eliminate NaNms in test reporter
Agent-Logs-Url: https://github.com/tbamud/tbamud/sessions/8d948e86-1d59-496f-a317-7fd9294fcad8

Co-authored-by: welcor <357770+welcor@users.noreply.github.com>
2026-04-22 21:53:27 +00:00
copilot-swe-agent[bot]
73bda79fe6 CI: produce JUnit XML from Unity tests for GitHub test reporting
Agent-Logs-Url: https://github.com/tbamud/tbamud/sessions/0bc0c851-36e7-4d13-a393-517477e66c73

Co-authored-by: welcor <357770+welcor@users.noreply.github.com>
2026-04-22 21:41:53 +00:00
Thomas Arp
d810782392 test run 2026-04-22 23:32:35 +02:00
copilot-swe-agent[bot]
063bd86a69 Use working-directory for build and test steps
Agent-Logs-Url: https://github.com/tbamud/tbamud/sessions/02b27398-2736-4f5c-bbd9-b212340323f8

Co-authored-by: welcor <357770+welcor@users.noreply.github.com>
2026-04-22 21:29:01 +00:00
copilot-swe-agent[bot]
2ef139a7d4 Add test step to CI build workflow
Agent-Logs-Url: https://github.com/tbamud/tbamud/sessions/88e8bf39-a94e-440e-835a-0bb9c62fe95d

Co-authored-by: welcor <357770+welcor@users.noreply.github.com>
2026-04-22 21:22:17 +00:00
copilot-swe-agent[bot]
04a99b3ebf Add tests/Makefile to .gitignore and untrack generated file
Agent-Logs-Url: https://github.com/tbamud/tbamud/sessions/ff469e4b-880b-4326-85fd-1abc76bd80bc

Co-authored-by: welcor <357770+welcor@users.noreply.github.com>
2026-04-22 20:55:59 +00:00
Thomas Arp
b77f4ad3ca Propagate failure to calling shell
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-04-22 22:48:56 +02:00
Thomas Arp
9343e38860 Comment should match code
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-04-22 22:47:51 +02:00
Thomas Arp
48030f3c2f Only set flags on compilers that recognize them
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-04-22 22:47:17 +02:00
Thomas Arp
83d109e7ae Do not include crypt when not available
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-04-22 22:45:41 +02:00
copilot-swe-agent[bot]
6566ad5164 Add test binaries to .gitignore and untrack them
Agent-Logs-Url: https://github.com/tbamud/tbamud/sessions/d5b86db2-e5ab-4729-b8b1-2ca7cf01c6b9

Co-authored-by: welcor <357770+welcor@users.noreply.github.com>
2026-04-21 22:20:58 +00:00
copilot-swe-agent[bot]
fff58ccab3 Add Unity-based unit test infrastructure (Phase 1: 117 tests passing)
Agent-Logs-Url: https://github.com/tbamud/tbamud/sessions/d5b86db2-e5ab-4729-b8b1-2ca7cf01c6b9

Co-authored-by: welcor <357770+welcor@users.noreply.github.com>
2026-04-21 22:19:11 +00:00
5 changed files with 17 additions and 53 deletions

View File

@@ -3,7 +3,7 @@ name: C/C++ CI
on: on:
push: push:
branches: [ "master" ] branches: [ "master" ]
pull_request_target: pull_request:
branches: [ "master" ] branches: [ "master" ]
permissions: permissions:

View File

@@ -1024,27 +1024,17 @@ ACMD(do_mdoor)
} }
if ((rm = get_room(target)) == NULL) { if ((rm = get_room(target)) == NULL) {
mob_log(ch, "mdoor: invalid target (arg == %s)", target); mob_log(ch, "mdoor: invalid target");
return; return;
} }
if ((dir = search_block(direction, dirs, FALSE)) == -1) { if ((dir = search_block(direction, dirs, FALSE)) == -1) {
char dirs_str[256]; mob_log(ch, "mdoor: invalid direction");
int di, doff = 0;
dirs_str[0] = '\0';
for (di = 0; *dirs[di] != '\n'; di++)
doff += snprintf(dirs_str + doff, sizeof(dirs_str) - doff, "%s%s", doff ? " " : "", dirs[di]);
mob_log(ch, "mdoor: invalid direction (arg == %s) not found in: [ %s ]", direction, dirs_str);
return; return;
} }
if ((fd = search_block(field, door_field, FALSE)) == -1) { if ((fd = search_block(field, door_field, FALSE)) == -1) {
char fields_str[256]; mob_log(ch, "odoor: invalid field");
int fi, foff = 0;
fields_str[0] = '\0';
for (fi = 0; *door_field[fi] != '\n'; fi++)
foff += snprintf(fields_str + foff, sizeof(fields_str) - foff, "%s%s", foff ? " " : "", door_field[fi]);
mob_log(ch, "mdoor: invalid field (arg == %s) not found in: [ %s ]", field, fields_str);
return; return;
} }
@@ -1091,10 +1081,8 @@ ACMD(do_mdoor)
case 5: /* room */ case 5: /* room */
if ((to_room = real_room(atoi(value))) != NOWHERE) if ((to_room = real_room(atoi(value))) != NOWHERE)
newexit->to_room = to_room; newexit->to_room = to_room;
else { else
newexit->to_room = NOWHERE; mob_log(ch, "mdoor: invalid door target");
mob_log(ch, "mdoor: invalid door target (arg == %s)", value);
}
break; break;
} }
} }

View File

@@ -625,27 +625,17 @@ static OCMD(do_odoor)
} }
if ((rm = get_room(target)) == NULL) { if ((rm = get_room(target)) == NULL) {
obj_log(obj, "odoor: invalid target (arg == %s)", target); obj_log(obj, "odoor: invalid target");
return; return;
} }
if ((dir = search_block(direction, dirs, FALSE)) == -1) { if ((dir = search_block(direction, dirs, FALSE)) == -1) {
char dirs_str[256]; obj_log(obj, "odoor: invalid direction");
int di, doff = 0;
dirs_str[0] = '\0';
for (di = 0; *dirs[di] != '\n'; di++)
doff += snprintf(dirs_str + doff, sizeof(dirs_str) - doff, "%s%s", doff ? " " : "", dirs[di]);
obj_log(obj, "odoor: invalid direction (arg == %s) not found in: [ %s ]", direction, dirs_str);
return; return;
} }
if ((fd = search_block(field, door_field, FALSE)) == -1) { if ((fd = search_block(field, door_field, FALSE)) == -1) {
char fields_str[256]; obj_log(obj, "odoor: invalid field");
int fi, foff = 0;
fields_str[0] = '\0';
for (fi = 0; *door_field[fi] != '\n'; fi++)
foff += snprintf(fields_str + foff, sizeof(fields_str) - foff, "%s%s", foff ? " " : "", door_field[fi]);
obj_log(obj, "odoor: invalid field (arg == %s) not found in: [ %s ]", field, fields_str);
return; return;
} }
@@ -692,10 +682,8 @@ static OCMD(do_odoor)
case 5: /* room */ case 5: /* room */
if ((to_room = real_room(atoi(value))) != NOWHERE) if ((to_room = real_room(atoi(value))) != NOWHERE)
newexit->to_room = to_room; newexit->to_room = to_room;
else { else
newexit->to_room = NOWHERE; obj_log(obj, "odoor: invalid door target");
obj_log(obj, "odoor: invalid door target (arg == %s)", value);
}
break; break;
} }
} }

View File

@@ -1722,5 +1722,5 @@ void var_subst(void *go, struct script_data *sc, trig_data *trig,
left -= len; left -= len;
} /* else if *p .. */ } /* else if *p .. */
} /* while *p .. */ } /* while *p .. */
*buf = '\0'; buf[sizeof(buf) - 1] = '\0';
} }

View File

@@ -224,27 +224,17 @@ WCMD(do_wdoor)
} }
if ((rm = get_room(target)) == NULL) { if ((rm = get_room(target)) == NULL) {
wld_log(room, "wdoor: invalid target (arg == %s)", target); wld_log(room, "wdoor: invalid target");
return; return;
} }
if ((dir = search_block(direction, dirs, FALSE)) == -1) { if ((dir = search_block(direction, dirs, FALSE)) == -1) {
char dirs_str[256]; wld_log(room, "wdoor: invalid direction");
int di, doff = 0;
dirs_str[0] = '\0';
for (di = 0; *dirs[di] != '\n'; di++)
doff += snprintf(dirs_str + doff, sizeof(dirs_str) - doff, "%s%s", doff ? " " : "", dirs[di]);
wld_log(room, "wdoor: invalid direction (arg == %s) not found in: [ %s ]", direction, dirs_str);
return; return;
} }
if ((fd = search_block(field, door_field, FALSE)) == -1) { if ((fd = search_block(field, door_field, FALSE)) == -1) {
char fields_str[256]; wld_log(room, "wdoor: invalid field");
int fi, foff = 0;
fields_str[0] = '\0';
for (fi = 0; *door_field[fi] != '\n'; fi++)
foff += snprintf(fields_str + foff, sizeof(fields_str) - foff, "%s%s", foff ? " " : "", door_field[fi]);
wld_log(room, "wdoor: invalid field (arg == %s) not found in: [ %s ]", field, fields_str);
return; return;
} }
@@ -291,10 +281,8 @@ WCMD(do_wdoor)
case 5: /* room */ case 5: /* room */
if ((to_room = real_room(atoi(value))) != NOWHERE) if ((to_room = real_room(atoi(value))) != NOWHERE)
newexit->to_room = to_room; newexit->to_room = to_room;
else { else
newexit->to_room = NOWHERE; wld_log(room, "wdoor: invalid door target");
wld_log(room, "wdoor: invalid door target (arg == %s)", value);
}
break; break;
} }
} }