Bobby R. Bruce has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/44625 )

Change subject: python,tests: Update pyunit tests to run in TestLib
......................................................................

python,tests: Update pyunit tests to run in TestLib

Previously the pyunit tests needed run in the gem5 root, this change
allows them to run as part of the quick TestLib tests (thereby having
them run as part of the presubmit checks).

`pyunit/util/test_convert.py` has been renamed
`pyunit/util/convert-test.py` as TestLib attempts to parse any Python
file with the "test" prefix.

Example usage:

```
./main.py run --uid SuiteUID:tests/pyunit/test_run.py:pyunit-convert-check-NULL-x86_64-opt
```

Discussed briefly in email thread:
https://www.mail-archive.com/gem5-dev@gem5.org/msg38563.html

Change-Id: Id566d44fcb5d8c599eb1a90bca56793158a201e6
---
A tests/pyunit/test_run.py
R tests/pyunit/util/convert-check.py
2 files changed, 49 insertions(+), 0 deletions(-)



diff --git a/tests/pyunit/test_run.py b/tests/pyunit/test_run.py
new file mode 100644
index 0000000..6dfe7e1
--- /dev/null
+++ b/tests/pyunit/test_run.py
@@ -0,0 +1,49 @@
+# Copyright (c) 2021 The Regents of the University of California
+# All Rights Reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met: redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer;
+# redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution;
+# neither the name of the copyright holders nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+import os
+
+from testlib.configuration import constants
+from testlib.helper import joinpath
+from gem5.suite import *
+
+# A map of test names to their configs. This is where the name of the test is
+# set.
+test_configs = {
+    "pyunit-convert-check" :
+        str(joinpath(os.getcwd(), "util", "convert_check.py")),
+}
+
+for name in test_configs:
+    gem5_verify_config(
+            name=name,
+            config=test_configs[name],
+            verifiers=(),
+            config_args=[],
+            valid_isas=(constants.null_tag,),
+            length = constants.quick_tag,
+    )
+
diff --git a/tests/pyunit/util/test_convert.py b/tests/pyunit/util/convert-check.py
similarity index 100%
rename from tests/pyunit/util/test_convert.py
rename to tests/pyunit/util/convert-check.py

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/44625
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: Id566d44fcb5d8c599eb1a90bca56793158a201e6
Gerrit-Change-Number: 44625
Gerrit-PatchSet: 1
Gerrit-Owner: Bobby R. Bruce <bbr...@ucdavis.edu>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to