Browse Source

Ensuring global profile is used if test-specific profile is not present

Hamilton Turner 11 years ago
parent
commit
cbb6220167
2 changed files with 8 additions and 3 deletions
  1. 7 3
      toolset/benchmark/framework_test.py
  2. 1 0
      toolset/setup/linux/installer.py

+ 7 - 3
toolset/benchmark/framework_test.py

@@ -286,9 +286,13 @@ class FrameworkTest:
   # Start the test using it's setup file
   ############################################################
   def start(self, out, err):
-    # First replace the environment with the one defined in 
-    # this tests bash_profile.sh
-    profile="%s/bash_profile.sh" % self.directory
+    # Load profile for this installation
+    test_profile="%s/bash_profile.sh" % self.directory
+    if os.path.exists(test_profile):
+      setup_util.replace_environ(config=test_profile)
+    else:
+      logging.warning("Framework %s does not have a bash_profile" % test_name)
+      setup_util.replace_environ(config="$FWROOT/config/benchmark_profile")
     
     set_iroot="export IROOT=%s" % self.install_root
     setup_util.replace_environ(config=profile, command=set_iroot)

+ 1 - 0
toolset/setup/linux/installer.py

@@ -77,6 +77,7 @@ class Installer:
               setup_util.replace_environ(config=test_profile_file)
             else:
               logging.warning("Framework %s does not have a bash_profile"%test_name)
+              setup_util.replace_environ(config="$FWROOT/config/benchmark_profile")
 
             # Find relative installation file
             test_rel_install_file = "$FWROOT%s" % setup_util.path_relative_to_root(test_install_file)