From 718747c5895067c261a3fc11e9918fc1a8f1d385 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Thu, 29 Aug 2019 11:13:41 +0200 Subject: Tests: auto download test files when running "make test" --- build_files/utils/make_utils.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'build_files/utils/make_utils.py') 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/" -- cgit v1.2.3