summaryrefslogtreecommitdiffstats
path: root/scripts/qa
diff options
context:
space:
mode:
authorPhil Wise <phil@advancedtelematic.com>2017-04-19 17:00:45 +0200
committerPhil Wise <phil@advancedtelematic.com>2017-04-19 17:06:46 +0200
commit81edfc96b70c02d15686bcce2454067d97248c74 (patch)
tree70bdcc2a897d6886ec247ae010b1b34e86099ffe /scripts/qa
parent71d0af75271eff7b5b8c658576d696e99997d57f (diff)
downloadmeta-updater-81edfc96b70c02d15686bcce2454067d97248c74.tar.gz
Script to build over multiple directories
This is a basic script to run bitbake over multiple build* directories
Diffstat (limited to 'scripts/qa')
-rwxr-xr-xscripts/qa60
1 files changed, 60 insertions, 0 deletions
diff --git a/scripts/qa b/scripts/qa
new file mode 100755
index 0000000..e5133f0
--- /dev/null
+++ b/scripts/qa
@@ -0,0 +1,60 @@
1#!/usr/bin/env python3
2
3from subprocess import Popen, PIPE
4from glob import glob
5from os.path import dirname, join, abspath, exists
6from os import chdir
7import signal
8
9root = abspath(dirname(dirname(dirname(__file__))))
10print("Root dir is:" + root)
11
12args = ['bitbake', 'core-image-minimal']
13
14
15class Runner(object):
16 UNKNOWN = 'unknown'
17 PASS = 'pass'
18 FAIL = 'fail'
19 SKIP = 'skipped'
20
21 def __init__(self, dirs):
22 self._dirs = dirs
23 self._child = None
24 self._results = {}
25 for d in dirs:
26 self._results[d] = self.UNKNOWN
27
28 def run(self):
29 for d in self._dirs:
30 chdir(d)
31 if exists(join(d, '.qaskip')):
32 print("Skipping %s because of .qaskip file" % d)
33 self._results[d] = self.SKIP
34 continue
35 print("Building in " + d)
36 self._child = Popen(args=args, cwd=d, stdin=PIPE)
37 retcode = self._child.wait()
38 self._child = None
39 if retcode == 0:
40 self._results[d] = self.PASS
41 else:
42 self._results[d] = self.FAIL
43 print("Error, stopping qa script at %s" % d)
44 break
45 for d, result in self._results.items():
46 print("%20s %s" % (d, result))
47
48 def handle_signal(self, signo, stack_frame):
49 if self._child:
50 self._child
51
52
53def main():
54 dirs = glob(join(root, 'build*'))
55 runner = Runner(dirs)
56 signal.signal(signalnum=signal.SIGINT, handler=runner.handle_signal)
57 runner.run()
58
59if __name__ == "__main__":
60 main()