summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Yang <liezhi.yang@windriver.com>2017-08-21 18:23:13 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-08-23 14:16:01 +0100
commit5f6945f5031e1a4ca116cc1eccf4c2f9dc228547 (patch)
tree1d675bf8c567cc365506c02c33bd0262b436c406
parent8a5d3bf3020528d1c28366236941c2fcd91d5cef (diff)
downloadpoky-0e1b6744aa8f5d125edd382f255bd038d84b6dd9.tar.gz
buildhistory.bbclass: add ptest2.4_M3
The ptest log will be saved to buildhistory/ptest, we can easily get the regression result between builds by: $ git show HEAD ptest/pass.fail.skip.* [YOCTO #11547] (From OE-Core rev: dcb6cd19fb8c639cb844d116fb83827267f37421) Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes/buildhistory.bbclass30
1 files changed, 30 insertions, 0 deletions
diff --git a/meta/classes/buildhistory.bbclass b/meta/classes/buildhistory.bbclass
index a3e4c7a734..dbfcc05d10 100644
--- a/meta/classes/buildhistory.bbclass
+++ b/meta/classes/buildhistory.bbclass
@@ -912,3 +912,33 @@ def write_latest_srcrev(d, pkghistdir):
912 else: 912 else:
913 if os.path.exists(srcrevfile): 913 if os.path.exists(srcrevfile):
914 os.remove(srcrevfile) 914 os.remove(srcrevfile)
915
916do_testimage[postfuncs] += "write_ptest_result"
917do_testimage[vardepsexclude] += "write_ptest_result"
918
919python write_ptest_result() {
920 write_latest_ptest_result(d, d.getVar('BUILDHISTORY_DIR'))
921}
922
923def write_latest_ptest_result(d, histdir):
924 import glob
925 import subprocess
926 test_log_dir = d.getVar('TEST_LOG_DIR')
927 input_ptest = os.path.join(test_log_dir, 'ptest_log')
928 output_ptest = os.path.join(histdir, 'ptest')
929 if os.path.exists(input_ptest):
930 try:
931 # Lock it avoid race issue
932 lock = bb.utils.lockfile(output_ptest + "/ptest.lock")
933 bb.utils.mkdirhier(output_ptest)
934 oe.path.copytree(input_ptest, output_ptest)
935 # Sort test result
936 for result in glob.glob('%s/pass.fail.*' % output_ptest):
937 bb.debug(1, 'Processing %s' % result)
938 cmd = ['sort', result, '-o', result]
939 bb.debug(1, 'Running %s' % cmd)
940 ret = subprocess.call(cmd)
941 if ret != 0:
942 bb.error('Failed to run %s!' % cmd)
943 finally:
944 bb.utils.unlockfile(lock)