diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-03-03 10:59:25 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-03-05 10:33:18 -0800 |
commit | 41bc192c0b5795561b239872008c91a867732219 (patch) | |
tree | a21feb51bde721ba553296676ce4b5ea2662bf37 /meta/classes/imagetest-qemu.bbclass | |
parent | 3b57de68e70e77dbc03c0616a83a29a2e99e40b4 (diff) | |
download | openembedded-core-41bc192c0b5795561b239872008c91a867732219.tar.gz openembedded-core-41bc192c0b5795561b239872008c91a867732219.tar.bz2 openembedded-core-41bc192c0b5795561b239872008c91a867732219.tar.xz openembedded-core-41bc192c0b5795561b239872008c91a867732219.zip |
meta: Convert getVar/getVarFlag(xxx, 1) -> (xxx, True)
Using "1" with getVar is bad coding style and "True" is preferred.
This patch is a sed over the meta directory of the form:
sed \
-e 's:\(\.getVar([^,()]*, \)1 *):\1True):g' \
-e 's:\(\.getVarFlag([^,()]*, [^,()]*, \)1 *):\1True):g' \
-i `grep -ril getVar *`
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/imagetest-qemu.bbclass')
-rw-r--r-- | meta/classes/imagetest-qemu.bbclass | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/meta/classes/imagetest-qemu.bbclass b/meta/classes/imagetest-qemu.bbclass index d01d1f497..d56b44b5c 100644 --- a/meta/classes/imagetest-qemu.bbclass +++ b/meta/classes/imagetest-qemu.bbclass @@ -35,12 +35,12 @@ def qemuimagetest_main(d): casestr = re.compile(r'(?P<scen>\w+\b):(?P<case>\S+$)') resultstr = re.compile(r'\s*(?P<case>\w+)\s*(?P<pass>\d+)\s*(?P<fail>\d+)\s*(?P<noresult>\d+)') - machine = d.getVar('MACHINE', 1) - pname = d.getVar('PN', 1) + machine = d.getVar('MACHINE', True) + pname = d.getVar('PN', True) """function to save test cases running status""" def teststatus(test, status, index, length): - test_status = d.getVar('TEST_STATUS', 1) + test_status = d.getVar('TEST_STATUS', True) if not os.path.exists(test_status): raise bb.build.FuncFailed("No test status file existing under TEST_TMP") @@ -51,13 +51,13 @@ def qemuimagetest_main(d): """funtion to run each case under scenario""" def runtest(scen, case, fulltestpath): - resultpath = d.getVar('TEST_RESULT', 1) - tmppath = d.getVar('TEST_TMP', 1) + resultpath = d.getVar('TEST_RESULT', True) + tmppath = d.getVar('TEST_TMP', True) """initialize log file for testcase""" - logpath = d.getVar('TEST_LOG', 1) + logpath = d.getVar('TEST_LOG', True) bb.utils.mkdirhier("%s/%s" % (logpath, scen)) - caselog = os.path.join(logpath, "%s/log_%s.%s" % (scen, case, d.getVar('DATETIME', 1))) + caselog = os.path.join(logpath, "%s/log_%s.%s" % (scen, case, d.getVar('DATETIME', True))) os.system("touch %s" % caselog) """export TEST_TMP, TEST_RESULT, DEPLOY_DIR and QEMUARCH""" @@ -141,7 +141,7 @@ def qemuimagetest_main(d): """Clean tmp folder for testing""" def clean_tmp(): - tmppath = d.getVar('TEST_TMP', 1) + tmppath = d.getVar('TEST_TMP', True) if os.path.isdir(tmppath): for f in os.listdir(tmppath): @@ -155,28 +155,28 @@ def qemuimagetest_main(d): clean_tmp() """check testcase folder and create test log folder""" - testpath = d.getVar('TEST_DIR', 1) + testpath = d.getVar('TEST_DIR', True) bb.utils.mkdirhier(testpath) - logpath = d.getVar('TEST_LOG', 1) + logpath = d.getVar('TEST_LOG', True) bb.utils.mkdirhier(logpath) - tmppath = d.getVar('TEST_TMP', 1) + tmppath = d.getVar('TEST_TMP', True) bb.utils.mkdirhier(tmppath) """initialize test status file""" - test_status = d.getVar('TEST_STATUS', 1) + test_status = d.getVar('TEST_STATUS', True) if os.path.exists(test_status): os.remove(test_status) os.system("touch %s" % test_status) """initialize result file""" - resultpath = d.getVar('TEST_RESULT', 1) + resultpath = d.getVar('TEST_RESULT', True) bb.utils.mkdirhier(resultpath) - resultfile = os.path.join(resultpath, "testresult.%s" % d.getVar('DATETIME', 1)) + resultfile = os.path.join(resultpath, "testresult.%s" % d.getVar('DATETIME', True)) sresultfile = os.path.join(resultpath, "testresult.log") - machine = d.getVar('MACHINE', 1) + machine = d.getVar('MACHINE', True) if os.path.exists(sresultfile): os.remove(sresultfile) @@ -188,7 +188,7 @@ def qemuimagetest_main(d): f.close() """generate pre-defined testcase list""" - testlist = d.getVar('TEST_SCEN', 1) + testlist = d.getVar('TEST_SCEN', True) fulllist = generate_list(testlist) """Begin testing""" |