Files
tactical-shooter/addons/vest/tap-reporter.gd
T
shawn b0c83af092 Fresh start: replace with naxIO/netfox-cs-sample foundation
Complete replacement of the tactical-shooter project with the
netfox-cs-sample (MIT) — a CS 1.6 inspired multiplayer FPS built
with Godot 4 and netfox.

## What's new
- Full CS-style gameplay: teams (T/CT), rounds, economy, buy menu
- 6 weapons: Knife, Glock, USP, AK-47, M4A1, AWP
- Bomb plant/defuse with 2 bombsites
- Flashbang & smoke grenades
- Proper netfox rollback netcode at 64 tick
- Network popup UI for host/join
- HUD, crosshair, round timer, scoreboard
- All netfox singletons registered as autoloads (works in exported builds)

## Architecture
- Listen-server (host from client, no dedicated server binary)
- Multiplayer-fps game lives at examples/multiplayer-fps/
- Netfox addons registered as autoloads for exported build compat
- Godot 4.7 with Forward+ renderer

## Removed
- Old headless-server architecture (client_main, server_main, player.gd, etc.)
- Custom netfox bootstrap with ENet fallback
- Old ChaffGames FPS template (2,420 lines, 844 KB)
- SimulationServer GDExtension stub
- Godot-jolt physics (netfox sample uses default Godot physics)
- Duplicate weapon_data.gd, anti_cheat.gd, round_manager.gd, etc.
- Server browser API Python venv (87 MB)
- test_range map and modular assets

## Preserved
- Git history
- Server config at config/default_server_config.cfg
- Windows export preset
- Build directory (gitignored)

Co-authored-by: naxIO <naxIO@users.noreply.github.com>
2026-07-02 20:55:20 -04:00

91 lines
2.8 KiB
GDScript

extends Object
class_name TAPReporter
## Generates reports in the Test Anything Protocol format
##
## See [url]https://testanything.org/[/url]
const INDENT_SIZE := 2
## Generate a report from test suite results
static func report(suite: VestResult.Suite) -> String:
var lines := PackedStringArray()
lines.append("TAP version 14")
_report_suite(suite, lines, 0)
return "\n".join(lines)
static func _report_suite(suite: VestResult.Suite, lines: PackedStringArray, indent: int = 0):
var indent_prefix := " ".repeat(indent)
var test_count := suite.plan_size()
var test_id := 1
lines.append(indent_prefix + "1..%d" % [test_count])
for subsuite in suite.subsuites:
lines.append(indent_prefix + "# Subtest: %s" % [subsuite.suite.name])
_report_suite(subsuite, lines, indent + INDENT_SIZE)
_report_subsuite_results(test_id, subsuite, lines, indent)
test_id += 1
for case in suite.cases:
_report_case(test_id, case, lines, indent)
test_id += 1
static func _report_case(test_id: int, case: VestResult.Case, lines: PackedStringArray, indent: int = 0):
var indent_prefix := " ".repeat(indent)
var test_point := "ok"
if case.status == VestResult.TEST_FAIL:
test_point = "not ok"
var description := case.case.description
var directive = ""
match case.status:
VestResult.TEST_TODO: directive = "\t# TODO"
VestResult.TEST_SKIP: directive = "\t# SKIP"
lines.append(indent_prefix + "%s %d - %s%s" % [test_point, test_id, description, directive])
var yaml_data = {}
if case.status == VestResult.TEST_FAIL:
yaml_data["severity"] = "fail"
yaml_data["assert_source"] = case.assert_file
yaml_data["assert_line"] = case.assert_line
if not case.messages.is_empty():
yaml_data["message"] = case.messages[0]
if case.messages.size() > 1:
yaml_data["messages"] = case.messages
if case.data: yaml_data["data"] = case.data
if not yaml_data.is_empty():
_report_yaml(yaml_data, lines, indent + INDENT_SIZE)
static func _report_subsuite_results(test_id: int, subsuite: VestResult.Suite, lines: PackedStringArray, indent: int = 0):
var indent_prefix := " ".repeat(indent)
var test_point = "ok"
if subsuite.get_count_by_status(VestResult.TEST_FAIL) > 0:
test_point = "not ok"
lines.append(indent_prefix + "%s %d - %s" % [test_point, test_id, subsuite.suite.name])
if test_point != "ok":
var yaml_data = {
"pass": subsuite.get_count_by_status(VestResult.TEST_PASS),
"fail": subsuite.get_count_by_status(VestResult.TEST_FAIL),
"skip": subsuite.get_count_by_status(VestResult.TEST_SKIP),
"todo": subsuite.get_count_by_status(VestResult.TEST_TODO)
}
_report_yaml(yaml_data, lines, indent + INDENT_SIZE)
static func _report_yaml(data: Dictionary, lines: PackedStringArray, indent: int = 0):
var indent_prefix := " ".repeat(indent)
lines.append(indent_prefix + "---")
lines.append(YAMLWriter.stringify(data, indent))
lines.append(indent_prefix + "...")