X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=app%2Fcmdline_test%2Fcmdline_test.py;h=229f71f3e39e0c6a517c33bf08c79244a126f933;hb=dd0eedb1cfcf0cb7423d859177c5bc6f931eaf8a;hp=472998767cf0a80693e3afe334a1a186eba2ec1f;hpb=be05eb445c370e67f18167f3712ba6b6680052fa;p=dpdk.git diff --git a/app/cmdline_test/cmdline_test.py b/app/cmdline_test/cmdline_test.py index 472998767c..229f71f3e3 100755 --- a/app/cmdline_test/cmdline_test.py +++ b/app/cmdline_test/cmdline_test.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python # BSD LICENSE # @@ -32,7 +32,7 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # Script that runs cmdline_test app and feeds keystrokes into it. - +from __future__ import print_function import cmdline_test_data import os import pexpect @@ -81,38 +81,38 @@ def runHistoryTest(child): # the path to cmdline_test executable is supplied via command-line. if len(sys.argv) < 2: - print "Error: please supply cmdline_test app path" + print("Error: please supply cmdline_test app path") sys.exit(1) test_app_path = sys.argv[1] if not os.path.exists(test_app_path): - print "Error: please supply cmdline_test app path" + print("Error: please supply cmdline_test app path") sys.exit(1) child = pexpect.spawn(test_app_path) -print "Running command-line tests..." +print("Running command-line tests...") for test in cmdline_test_data.tests: - print (test["Name"] + ":").ljust(30), + testname = (test["Name"] + ":").ljust(30) try: runTest(child, test) - print "PASS" + print(testname, "PASS") except: - print "FAIL" - print child + print(testname, "FAIL") + print(child) sys.exit(1) # since last test quits the app, run new instance child = pexpect.spawn(test_app_path) -print ("History fill test:").ljust(30), +testname = ("History fill test:").ljust(30) try: runHistoryTest(child) - print "PASS" + print(testname, "PASS") except: - print "FAIL" - print child + print(testname, "FAIL") + print(child) sys.exit(1) child.close() sys.exit(0)