Daniel Carvalho has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/44107 )

Change subject: WIP,sim: Add unit test for eventq
......................................................................

WIP,sim: Add unit test for eventq

Add a unit test for sim/eventq.

Change-Id: If68ddf94975dbe9f7121fefb6051a8bbaca19c4b
Signed-off-by: Daniel R. Carvalho <[email protected]>
---
M src/base/SConscript
M src/sim/SConscript
A src/sim/eventq.test.cc
3 files changed, 40 insertions(+), 2 deletions(-)



diff --git a/src/base/SConscript b/src/base/SConscript
index 882e2d9..bd63bdf 100644
--- a/src/base/SConscript
+++ b/src/base/SConscript
@@ -40,7 +40,7 @@
 Source('cprintf.cc', add_tags='gtest lib')
 GTest('cprintf.test', 'cprintf.test.cc')
 Executable('cprintftime', 'cprintftime.cc', 'cprintf.cc')
-Source('debug.cc', add_tags='gem5 trace')
+Source('debug.cc', add_tags=['gem5 trace', 'gem5 events'])
 GTest('debug.test', 'debug.test.cc', 'debug.cc')
 if env['USE_FENV']:
     Source('fenv.c')
diff --git a/src/sim/SConscript b/src/sim/SConscript
index d9f44e6..0ce0705 100644
--- a/src/sim/SConscript
+++ b/src/sim/SConscript
@@ -51,7 +51,7 @@
 Source('cxx_config_ini.cc')
 Source('debug.cc')
 Source('py_interact.cc', add_tags='python')
-Source('eventq.cc')
+Source('eventq.cc', add_tags='gem5 events')
 Source('futex_map.cc')
 Source('global_event.cc')
 Source('globals.cc')
@@ -85,9 +85,11 @@
 Source('power_domain.cc')
 Source('stats.cc')

+tag_implies('gem5 events', ['gem5 serialize', 'gem5 trace'])
 tag_implies('gem5 serialize', 'gem5 trace')

 GTest('byteswap.test', 'byteswap.test.cc', '../base/types.cc')
+GTest('eventq.test', 'eventq.test.cc', with_tag('gem5 events'))
 GTest('globals.test', 'globals.test.cc', 'globals.cc',
     with_tag('gem5 serialize'))
 GTest('guest_abi.test', 'guest_abi.test.cc')
diff --git a/src/sim/eventq.test.cc b/src/sim/eventq.test.cc
new file mode 100644
index 0000000..fa5539f
--- /dev/null
+++ b/src/sim/eventq.test.cc
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2021 Daniel R. Carvalho
+ *
+ * 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.
+ */
+
+#include <gmock/gmock.h>
+#include <gtest/gtest-spi.h>
+#include <gtest/gtest.h>
+
+#include "sim/eventq.hh"
+
+TEST(EventqTest, Test)
+{
+}

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/44107
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: If68ddf94975dbe9f7121fefb6051a8bbaca19c4b
Gerrit-Change-Number: 44107
Gerrit-PatchSet: 1
Gerrit-Owner: Daniel Carvalho <[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