mirror of
https://github.com/vicliu624/trail-mate.git
synced 2026-11-11 06:37:56 +00:00
Compose the CM0 fullscreen application and standard Debian package, align the Cardputer Zero shell, and share protocol, configuration, audio and storage services with embedded targets through existing platform seams. Add the paginated on-device TMAP creator using Center's published producer, private workspace recovery and direct keyboard shortcuts. Preserve unfinished management work behind its existing opt-in capability. Include native, ARM and shared-core regression fixtures, integration records, packaging helpers and dependency/license updates. Keep local build trees, device credentials, produced packages and validation logs outside version control. Validation before integration: ESP stack hygiene, Reticulum scope guard, staged whitespace checks and GitNexus scope audit. Prior device/build evidence and remaining hardware/package boundaries are recorded in the acceptance documents.
32 lines
1.5 KiB
Python
32 lines
1.5 KiB
Python
import os
|
|
from pathlib import Path
|
|
import subprocess
|
|
import sys
|
|
import tempfile
|
|
import unittest
|
|
|
|
ROOT = Path(__file__).resolve().parents[1]
|
|
|
|
|
|
class LinuxProjectVersionTest(unittest.TestCase):
|
|
def version(self, changelog, extra=None, debian=False):
|
|
env = {key: value for key, value in os.environ.items() if not key.startswith("GITHUB_REF")}
|
|
env.update(extra or {})
|
|
command = [sys.executable, str(ROOT / "scripts/project_version.py"), "--changelog", str(changelog)]
|
|
return subprocess.check_output(command + (["--debian"] if debian else []), env=env, text=True).strip()
|
|
|
|
def test_encoding_and_tag_precedence(self):
|
|
with tempfile.TemporaryDirectory() as directory:
|
|
changelog = Path(directory) / "CHANGELOG.md"
|
|
for encoding in ("utf-8", "utf-8-sig", "utf-16"):
|
|
changelog.write_text("# Changelog\n\n## [1.2.3-rc.2+build.4]\n", encoding=encoding)
|
|
self.assertEqual(self.version(changelog), "1.2.3-rc.2+build.4")
|
|
self.assertEqual(self.version(changelog, debian=True), "1.2.3~rc.2+build.4")
|
|
self.assertEqual(self.version(changelog, {"GITHUB_REF": "refs/heads/v9.0.0", "GITHUB_REF_NAME": "v9.0.0"}), "1.2.3-rc.2+build.4")
|
|
self.assertEqual(self.version(changelog, {"GITHUB_REF": "refs/tags/v9.8.7"}), "9.8.7")
|
|
self.assertEqual(self.version(changelog, {"GITHUB_REF_TYPE": "tag", "GITHUB_REF_NAME": "v9.8.7"}), "9.8.7")
|
|
|
|
|
|
if __name__ == "__main__":
|
|
unittest.main()
|