R1: Linux export pipeline (make dist, make dist-check)
make dist (tools/dist.sh) checks the official export templates against tools/engine.sha512, installs only the Linux x86_64 ones into the repo-local engine data, exports the "Linux" preset, checks the binary is the verified release template, and packs build/dist/tidewall-<version>-linux-x86_64.tar.gz with a .sha256: tidewall.x86_64, tidewall.pck, a tidewall-server launcher that runs the same game headless with clean SIGTERM handling, an example server.cfg, README, VERSION, licences and asset provenance. BuildInfo gives the version (application/config/version, now 0.9.0) and the commit (build_commit.txt written by make dist, or .git in a checkout). The main menu shows "Version 0.9.0 (commit)" and the server's start log line carries version and commit. make dist-check (tools/dist_check.sh) unpacks the package outside the repo with HOME and XDG dirs in a temp dir and runs smoke against it (new SMOKE_DIST mode), a whole bot match, and the exported game joining the exported server over loopback. A release template crashes on a call on null (exit 139) and ignores invalid calls, so in package mode smoke's fault check expects only a non-zero exit. Closes #60 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
## R1: the version and commit shown in the main menu and server logs.
|
||||
extends TestCase
|
||||
|
||||
|
||||
func test_version_comes_from_the_project() -> void:
|
||||
assert_eq(BuildInfo.version(), String(ProjectSettings.get_setting("application/config/version")))
|
||||
var parts: PackedStringArray = BuildInfo.version().split(".")
|
||||
assert_eq(parts.size(), 3, "a three-part version: %s" % BuildInfo.version())
|
||||
for part: String in parts:
|
||||
assert_true(part.is_valid_int(), "%s is a number" % part)
|
||||
|
||||
|
||||
func test_commit_is_read_from_the_repository() -> void:
|
||||
# Tests run from the checkout, which has a .git directory.
|
||||
var commit: String = BuildInfo.commit()
|
||||
assert_true(BuildInfo.is_valid_commit(commit), "a commit name: %s" % commit)
|
||||
assert_true(BuildInfo.describe().begins_with(BuildInfo.version() + " ("))
|
||||
|
||||
|
||||
func test_commit_names_are_checked() -> void:
|
||||
assert_true(BuildInfo.is_valid_commit("0e6e12c"))
|
||||
assert_true(BuildInfo.is_valid_commit("0e6e12cabc12-dirty"))
|
||||
assert_false(BuildInfo.is_valid_commit("main"))
|
||||
assert_false(BuildInfo.is_valid_commit("0e6e"))
|
||||
assert_false(BuildInfo.is_valid_commit("<script>0e6e12c"))
|
||||
|
||||
|
||||
func test_git_head_follows_loose_and_packed_refs() -> void:
|
||||
var dir: String = OS.get_user_data_dir().path_join("test_build_info_git")
|
||||
DirAccess.make_dir_recursive_absolute(dir.path_join("refs/heads"))
|
||||
_write(dir.path_join("HEAD"), "ref: refs/heads/main\n")
|
||||
_write(dir.path_join("refs/heads/main"), "0123456789abcdef0123456789abcdef01234567\n")
|
||||
assert_eq(BuildInfo._git_head(dir), "0123456789ab")
|
||||
DirAccess.remove_absolute(dir.path_join("refs/heads/main"))
|
||||
_write(dir.path_join("packed-refs"), "# pack-refs with: peeled\nfedcba9876543210fedcba9876543210fedcba98 refs/heads/main\n")
|
||||
assert_eq(BuildInfo._git_head(dir), "fedcba987654")
|
||||
_write(dir.path_join("HEAD"), "not a commit\n")
|
||||
assert_eq(BuildInfo._git_head(dir), "", "a detached HEAD that isn't a commit name")
|
||||
for file: String in ["HEAD", "packed-refs"]:
|
||||
DirAccess.remove_absolute(dir.path_join(file))
|
||||
|
||||
|
||||
func _write(path: String, text: String) -> void:
|
||||
var file: FileAccess = FileAccess.open(path, FileAccess.WRITE)
|
||||
file.store_string(text)
|
||||
file.close()
|
||||
@@ -0,0 +1 @@
|
||||
uid://cttjag58b0qvu
|
||||
@@ -281,3 +281,10 @@ func test_menu_buttons_knock_when_pointed_at_and_pressed() -> void:
|
||||
sounds.free()
|
||||
later.free()
|
||||
SoundBank.clear()
|
||||
|
||||
|
||||
func test_main_menu_shows_the_version_and_commit() -> void:
|
||||
var build: Label = menus.find_child("Build", true, false) as Label
|
||||
assert_not_null(build, "the main menu has a build line")
|
||||
if build != null:
|
||||
assert_eq(build.text, "Version " + BuildInfo.describe())
|
||||
|
||||
Reference in New Issue
Block a user