mirror of
https://github.com/ThrowTheSwitch/Unity
synced 2025-02-08 10:18:44 -05:00
23 lines
622 B
Python
Executable File
23 lines
622 B
Python
Executable File
#!/usr/bin/env python3
|
|
# =========================================================================
|
|
# Unity - A Test Framework for C
|
|
# ThrowTheSwitch.org
|
|
# Copyright (c) 2007-25 Mike Karlesky, Mark VanderVoord, & Greg Williams
|
|
# SPDX-License-Identifier: MIT
|
|
# =========================================================================
|
|
|
|
import re
|
|
import sys
|
|
|
|
ver_re = re.compile(r"^#define\s+UNITY_VERSION_(?:MAJOR|MINOR|BUILD)\s+(\d+)$")
|
|
version = []
|
|
|
|
with open(sys.argv[1], "r") as f:
|
|
for line in f:
|
|
m = ver_re.match(line)
|
|
if m:
|
|
version.append(m.group(1))
|
|
|
|
print(".".join(version))
|
|
|