Bobby Bruce has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/54324 )

Change subject: systemc: Update the testing framework to get it working again.
......................................................................

systemc: Update the testing framework to get it working again.

The systemc testing framework is not used regularly, and had bit rot and
stopped working. This change updates it so that it runs again, and all
previously passing tests pass again.

These changes were mostly in the related SConscript now that top level
targets are built a little differently and that the gem5 shared library
is no longer stored in a special construction environment variable.
verify.py also needed to be updated since warn() and info() lines now
have file and line number information in them, throwing off pre diff
filtering of gem5 outputs.

Change-Id: Ifdcbd92eab8b9b2168c449bfbcebf52dbe1f016a
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/54324
Maintainer: Gabe Black <gabe.bl...@gmail.com>
Reviewed-by: Jason Lowe-Power <power...@gmail.com>
Tested-by: kokoro <noreply+kok...@google.com>
---
M src/systemc/tests/verify.py
M src/systemc/tests/SConscript
2 files changed, 35 insertions(+), 20 deletions(-)

Approvals:
  Jason Lowe-Power: Looks good to me, approved
  Gabe Black: Looks good to me, approved
  kokoro: Regressions pass




diff --git a/src/systemc/tests/SConscript b/src/systemc/tests/SConscript
index 7d544f2..fb916d2 100644
--- a/src/systemc/tests/SConscript
+++ b/src/systemc/tests/SConscript
@@ -63,7 +63,8 @@
     test_dir = Dir('.')
     class SystemCTestBin(Executable):
         def __init__(self, test):
-            super().__init__(test.target, *test.sources)
+            all_sources = test.sources + [with_tag('main')]
+            super().__init__(test.target, *all_sources)
             self.reldir = test.reldir
             self.test_deps = test.deps

@@ -78,26 +79,16 @@

             env.Append(CPPPATH=test_dir.Dir('include'))

-            shared_lib_path = env['SHARED_LIB'][0].abspath
-            sl_dir, sl_base = os.path.split(shared_lib_path)
-            env.Append(LIBPATH=[sl_dir], LIBS=[sl_base])
+            env.Append(LIBPATH=['${BUILDDIR}'], LIBS=['gem5_${ENV_LABEL}'])
+            env.AddLocalRPATH('${BUILDDIR}')
+
+            env['OBJSUFFIX'] = '.sc' + env['OBJSUFFIX'][1:]
+            env['SHOBJSUFFIX'] = '.sc' + env['OBJSUFFIX'][1:]

             super().declare_all(env)

         def declare(self, env):
-            env = env.Clone()
-            sources = list(self.sources)
-            for f in self.filters:
-                sources += Source.all.apply_filter(f)
-            objs = self.srcs_to_objs(env, sources)
-            objs = objs + env['MAIN_OBJS']
-            relpath = os.path.relpath(
-                    env['SHARED_LIB'][0].dir.abspath,
-                    self.path(env).dir.abspath)
-            env.Append(LINKFLAGS=Split('-z origin'))
-            env.Append(RPATH=[
-                    env.Literal(os.path.join('\\$$ORIGIN', relpath))])
-            test_bin = super().declare(env, objs)
+            test_bin, _u = super().declare(env)
             test_dir = self.dir.Dir(self.reldir)
             for dep in self.test_deps:
                 env.Depends(test_bin, test_dir.File(dep))
diff --git a/src/systemc/tests/verify.py b/src/systemc/tests/verify.py
index 54b4633..818855a 100755
--- a/src/systemc/tests/verify.py
+++ b/src/systemc/tests/verify.py
@@ -277,9 +277,9 @@
     test_filt = merge_filts(
         r'^/.*:\d+: ',
         r'^Global frequency set at \d* ticks per second\n',
-        r'info: Entering event queue @ \d*\.  Starting simulation\.\.\.\n',
-        r'warn: Ignoring request to set stack size\.\n',
-        r'^warn: No dot file generated. Please install pydot ' +
+ r'.*info: Entering event queue @ \d*\. Starting simulation\.\.\.\n',
+        r'.*warn: Ignoring request to set stack size\.\n',
+        r'^.*warn: No dot file generated. Please install pydot ' +
         r'to generate the dot file and pdf.\n',
         info_filt(804),
         in_file_filt,

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

Gerrit-Project: public/gem5
Gerrit-Branch: release-staging-v21-2
Gerrit-Change-Id: Ifdcbd92eab8b9b2168c449bfbcebf52dbe1f016a
Gerrit-Change-Number: 54324
Gerrit-PatchSet: 2
Gerrit-Owner: Gabe Black <gabe.bl...@gmail.com>
Gerrit-Reviewer: Bobby Bruce <bbr...@ucdavis.edu>
Gerrit-Reviewer: Gabe Black <gabe.bl...@gmail.com>
Gerrit-Reviewer: Giacomo Travaglini <giacomo.travagl...@arm.com>
Gerrit-Reviewer: Hoa Nguyen <hoanguyen.yds....@gmail.com>
Gerrit-Reviewer: Jason Lowe-Power <power...@gmail.com>
Gerrit-Reviewer: kokoro <noreply+kok...@google.com>
Gerrit-MessageType: merged
_______________________________________________
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