diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-08-29 12:13:41 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-08-30 19:01:50 +0300 |
commit | 718747c5895067c261a3fc11e9918fc1a8f1d385 (patch) | |
tree | 81611125be770339eb65789d4928cd72e913cdb8 /build_files/utils/make_utils.py | |
parent | 464e545c723616372bfeec8e955bf1177437fa32 (diff) |
Tests: auto download test files when running "make test"
Diffstat (limited to 'build_files/utils/make_utils.py')
-rwxr-xr-x | build_files/utils/make_utils.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/build_files/utils/make_utils.py b/build_files/utils/make_utils.py index 98536879b91..d05c1e6f838 100755 --- a/build_files/utils/make_utils.py +++ b/build_files/utils/make_utils.py @@ -2,6 +2,7 @@ # # Utility functions for make update and make tests. +import re import subprocess import sys @@ -15,3 +16,24 @@ def call(cmd): retcode = subprocess.call(cmd) if retcode != 0: sys.exit(retcode) + +def git_branch_release_version(git_command): + # Test if we are building a specific release version. + try: + branch = subprocess.check_output([git_command, "rev-parse", "--abbrev-ref", "HEAD"]) + except subprocess.CalledProcessError as e: + sys.stderr.write("Failed to get Blender git branch\n") + sys.exit(1) + + branch = branch.strip().decode('utf8') + release_version = re.search("^blender-v(.*)-release$", branch) + if release_version: + release_version = release_version.group(1) + return release_version + +def svn_libraries_base_url(release_version): + if release_version: + svn_branch = "tags/blender-" + release_version + "-release" + else: + svn_branch = "trunk" + return "https://svn.blender.org/svnroot/bf-blender/" + svn_branch + "/lib/" |