Make the lib test generic to main or PRs.

This commit is contained in:
Rene Rivera
2018-05-14 22:59:34 -05:00
parent 9e73c55298
commit d7bad38b5d
2 changed files with 36 additions and 8 deletions

View File

@ -94,14 +94,9 @@ class script(script_common):
if self.repo != 'boost':
utils.check_call("git","submodule","update","--quiet","--init",self.repo_path)
if self.commit:
# Checkout the library commit we are testing.
os.chdir(self.repo_dir)
if not self.pull_request:
utils.check_call("git","checkout","-qf",self.commit)
else:
utils.check_call("git","fetch","origin","-q",
"+refs/pull/{}/merge".format(self.pull_request))
utils.check_call("git","checkout","-qf","FETCH_HEAD")
# Copy in the existing library tree checkout.
os.rmdir(self.repo_path)
shutil.copytree(self.root_dir, self.repo_path)
# Fetch the dependencies for the library we are testing.
if self.repo != 'boost':