@@ -669,6 +669,7 @@ def setup_env(args):
669669
670670def run_git_cmd (path , command ):
671671 if not os .path .isdir (os .path .join (path , '.git' )):
672+ vcprint (pcolor .orange , f"warning, no .git dir in path ({ path } )" )
672673 return ""
673674
674675 try :
@@ -680,6 +681,20 @@ def run_git_cmd(path, command):
680681 except (FileNotFoundError , subprocess .CalledProcessError ):
681682 return ""
682683
684+ def pr_proj_info (proj ):
685+ str = f"\n Testing"
686+
687+ if 'PROJECT-NAME' in proj :
688+ str += f" { proj ['PROJECT-NAME' ]} "
689+
690+ if 'PROJECT-ROOT' in proj :
691+ git_sha = run_git_cmd (os .path .join (ROOT_PATH , proj ['PROJECT-ROOT' ]), ['rev-parse' , 'HEAD' ])[:12 ]
692+
693+ if git_sha :
694+ str += f" ({ git_sha } )"
695+
696+ cprint (pcolor .yellow , str )
697+
683698def main ():
684699 global DATABASE
685700 global SCRATCHDIR
@@ -711,11 +726,7 @@ def main():
711726 vcprint (pcolor .faint , f"Created databasefile: { db .name } " )
712727 DATABASE = db .name
713728
714- if 'PROJECT-NAME' in proj :
715- str = f"\n Testing { proj ['PROJECT-NAME' ]} "
716- if 'PROJECT-ROOT' in proj :
717- str += f" ({ run_git_cmd (os .path .join (ROOT_PATH , proj ['PROJECT-ROOT' ]), ['rev-parse' , 'HEAD' ])[:12 ]} )"
718- cprint (pcolor .yellow , str )
729+ pr_proj_info (proj )
719730
720731 cmdl = {'name' : 'command-line' , 'suite' : []}
721732 for filename in args .suites :
0 commit comments