GengYu Rao has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/30922 )

Change subject: tests: fix gitignore&add sequential mode for riscv
......................................................................

tests: fix gitignore&add sequential mode for riscv

add rules to ingore binarys/dumps/logs generated
add sequential simulate config to the test script

Change-Id: I55add19ff91b7bd69146b872bdb448ff1aa0eb10
---
M tests/.gitignore
M tests/test-progs/asmtest/src/riscv/run-tests.py
2 files changed, 41 insertions(+), 18 deletions(-)



diff --git a/tests/.gitignore b/tests/.gitignore
index 642f8e4..125dc82 100644
--- a/tests/.gitignore
+++ b/tests/.gitignore
@@ -4,3 +4,6 @@
 gem5/fs/linux/arm/binaries
 gem5/fs/linux/arm/disks
 gem5/test-progs
+test-progs/asmtest/bin/riscv/
+test-progs/asmtest/dump/riscv/
+test-progs/asmtest/src/riscv/*.out
diff --git a/tests/test-progs/asmtest/src/riscv/run-tests.py b/tests/test-progs/asmtest/src/riscv/run-tests.py
index f5818e6..e9682d9 100755
--- a/tests/test-progs/asmtest/src/riscv/run-tests.py
+++ b/tests/test-progs/asmtest/src/riscv/run-tests.py
@@ -71,6 +71,10 @@
                     help = 'Use Ruby memory?',
                     action = 'store_true')

+parser.add_argument('--single-core',
+ help = 'Run with one core?(suggested, if you are using your laptop)',
+                    action = 'store_true')
+
 args = parser.parse_args()

 # convert all paths to absolute paths
@@ -116,26 +120,42 @@
                      '-c', test_dir + '/' + test,
                      '--ruby' if args.ruby else '--caches',
                     ])
-
-# execute all jobs
-job_pool = Pool(processes = n_tests)
-job_outputs = job_pool.map(subprocess.call, job_cmds)
-job_pool.close()
-
 # process job outputs
 file = open(test_summary_out, "w")

-job_outputs = zip(job_names, job_outputs)
-for entry in job_outputs:
-  # a negative return value indicates that the job was terminated
-  # by a signal
-  # a positive return value indicates that the job exited with a return
-  # value
-  if entry[1] < 0:
-    file.write("%-50s failed - signal = %d\n" % (entry[0], -1 * entry[1]))
-  elif entry[1] > 0:
-    file.write("%-50s failed - status = %d\n" % (entry[0], entry[1]))
-  else:
-    file.write("%-50s passed\n" % (entry[0]))
+if (not args.single_core):
+  # execute all jobs
+  job_pool = Pool(processes = n_tests)
+  job_outputs = job_pool.map(subprocess.call, job_cmds)
+  job_pool.close()
+  job_outputs = zip(job_names, job_outputs)
+  for entry in job_outputs:
+    # a negative return value indicates that the job was terminated
+    # by a signal
+    # a positive return value indicates that the job exited with a return
+    # value
+    if entry[1] < 0:
+ file.write("%-50s failed - signal = %d\n" % (entry[0], -1 * entry[1]))
+    elif entry[1] > 0:
+      file.write("%-50s failed - status = %d\n" % (entry[0], entry[1]))
+    else:
+      file.write("%-50s passed\n" % (entry[0]))
+  file.close()
+
+else:
+  for i in range(len(job_names)):
+    job=""
+    for entry in job_cmds[i]:
+      job+=entry
+      job+=' '
+    #print(job)
+ ret = subprocess.call('%s > %s.out 2>&1'%(job,job_names[i]), shell=True)
+    if ret != 0:
+      if ret < 0:
+ file.write("%-50s failed - signal = %d\n" % (job_names[i], -1 * ret))
+      else:
+        file.write("%-50s failed - status = %d\n" % (job_names[i], ret))
+    else:
+      file.write("%-50s passed\n" % (job_names[i]))

 file.close()

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/30922
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I55add19ff91b7bd69146b872bdb448ff1aa0eb10
Gerrit-Change-Number: 30922
Gerrit-PatchSet: 1
Gerrit-Owner: GengYu Rao <[email protected]>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to