summaryrefslogtreecommitdiffstats
path: root/scripts/oe-build-perf-test
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/oe-build-perf-test')
-rwxr-xr-xscripts/oe-build-perf-test28
1 files changed, 28 insertions, 0 deletions
diff --git a/scripts/oe-build-perf-test b/scripts/oe-build-perf-test
index 66477ebe0b..9fb431045b 100755
--- a/scripts/oe-build-perf-test
+++ b/scripts/oe-build-perf-test
@@ -16,8 +16,14 @@
16"""Build performance test script""" 16"""Build performance test script"""
17import argparse 17import argparse
18import logging 18import logging
19import os
19import sys 20import sys
20 21
22sys.path.insert(0, os.path.dirname(os.path.realpath(__file__)) + '/lib')
23import scriptpath
24scriptpath.add_oe_lib_path()
25from oeqa.utils.commands import runCmd
26
21 27
22# Set-up logging 28# Set-up logging
23LOG_FORMAT = '[%(asctime)s] %(levelname)s: %(message)s' 29LOG_FORMAT = '[%(asctime)s] %(levelname)s: %(message)s'
@@ -25,6 +31,25 @@ logging.basicConfig(level=logging.INFO, format=LOG_FORMAT)
25log = logging.getLogger() 31log = logging.getLogger()
26 32
27 33
34def pre_run_sanity_check():
35 """Sanity check of build environment"""
36 build_dir = os.environ.get("BUILDDIR")
37 if not build_dir:
38 log.error("BUILDDIR not set. Please run the build environmnent setup "
39 "script.")
40 return False
41 if os.getcwd() != build_dir:
42 log.error("Please run this script under BUILDDIR (%s)", build_dir)
43 return False
44
45 ret = runCmd('which bitbake', ignore_status=True)
46 if ret.status:
47 log.error("bitbake command not found")
48 return False
49
50 return True
51
52
28def parse_args(argv): 53def parse_args(argv):
29 """Parse command line arguments""" 54 """Parse command line arguments"""
30 parser = argparse.ArgumentParser( 55 parser = argparse.ArgumentParser(
@@ -43,6 +68,9 @@ def main(argv=None):
43 if args.debug: 68 if args.debug:
44 log.setLevel(logging.DEBUG) 69 log.setLevel(logging.DEBUG)
45 70
71 if not pre_run_sanity_check():
72 return 1
73
46 return 0 74 return 0
47 75
48 76