gem5 v24.0.0.0
Loading...
Searching...
No Matches
group.test.cc File Reference
#include <gtest/gtest-spi.h>
#include <gtest/gtest.h>
#include "base/stats/group.hh"
#include "base/stats/info.hh"
#include "base/stats/output.hh"

Go to the source code of this file.

Classes

class  DummyInfo
 

Functions

 TEST (StatsGroupTest, ConstructNoParent)
 Test that the constructor without a parent doesn't do anything.
 
 TEST (StatsGroupTest, AddGetSingleStatGroup)
 Test adding a single stat group to a root node.
 
 TEST (StatsGroupDeathTest, AddUniqueNameStatGroup)
 Test that group names are unique within a node's stat group.
 
 TEST (StatsGroupTest, AddNotUniqueNameAmongGroups)
 Test that group names are not unique among two nodes' stat groups.
 
 TEST (StatsGroupDeathTest, AddNull)
 Test that a group cannot add a non-existent group.
 
 TEST (StatsGroupDeathTest, AddItself)
 Test that a group cannot add itself.
 
 TEST (StatsGroupDeathTest, DISABLED_AddCycle)
 
 TEST (StatsGroupTest, AddGetMultipleStatGroup)
 Test adding multiple stat groups to a root node.
 
 TEST (StatsGroupTest, ConstructCorrectlyAssigned)
 Make sure that the groups are correctly assigned in the map.
 
 TEST (StatsGroupTest, ConstructOneLevelLinear)
 Test that the constructor, when provided both the parent and the nodes' name, creates the following tree:
 
 TEST (StatsGroupTest, ConstructOneLevelOfTwoNodes)
 Test that the constructor, when provided both the parent and the nodes' name, creates the following tree:
 
 TEST (StatsGroupTest, ConstructTwoLevelsLinear)
 Test that the constructor, when provided both the parent and the nodes' name, creates the following tree:
 
 TEST (StatsGroupTest, ConstructTwoLevelsUnbalancedTree)
 Test that the constructor, when provided both the parent and the nodes' name, creates the following tree:
 
 TEST (StatsGroupTest, AddGetStat)
 Test adding stats to a group.
 
 TEST (StatsGroupDeathTest, MergeStatGroupNoGroup)
 Test that a group cannot merge if another group is not provided.
 
 TEST (StatsGroupDeathTest, MergeStatGroupItself)
 Test that a group cannot merge with itself.
 
 TEST (StatsGroupTest, MergeStatGroup)
 Test merging groups.
 
 TEST (StatsGroupDeathTest, MergeStatGroupMergedParent)
 Test that a group that has already been merged cannot be merged again.
 
 TEST (StatsGroupTest, AddStatMergedParent)
 Test that after a group has been merged, adding stats to it will add stats to the group it was merged to too.
 
 TEST (StatsGroupTest, AddStatMergedParentMain)
 Test that after a group has been merged, adding stats to the "main" group does not add stats to the group it was merged to.
 
 TEST (StatsGroupTest, ConstructNoName)
 Test that calling the constructor with a parent, but no name merges the groups.
 
 TEST (StatsGroupTest, RegStats)
 Test that calling regStats calls the respective function of all sub-groups and merged groups.
 
 TEST (StatsGroupTest, ResetStats)
 Test that resetting a stat from a specific node reset the stats of all its sub-groups and merged groups, and that it does not reset the stats of its parents.
 
 TEST (StatsGroupTest, PreDumpStats)
 Test that calling preDumpStats calls the respective function of all sub- groups and merged groups.
 
 TEST (StatsGroupTest, ResolveStatNone)
 Test that resolving a non-existent stat returns a nullptr.
 
 TEST (StatsGroupTest, ResolveStatSelf)
 Test resolving a stat belonging to the caller group.
 
 TEST (StatsGroupTest, ResolveSubGroupStatFromParent)
 Test that resolving stats from sub-groups is possible.
 
 TEST (StatsGroupTest, ResolveStatSubGroupOnSubGroup)
 Test that resolving a stat from the parent is not possible.
 
 TEST (StatsGroupTest, ResolveStatMerged)
 Test that resolving a merged stat is possible.
 
 TEST (StatsGroupTest, ResolveStatMergedSubGroup)
 Test that resolving a stat belonging to a merged sub-group is possible.
 

Function Documentation

◆ TEST() [1/30]

TEST ( StatsGroupDeathTest ,
AddItself  )

Test that a group cannot add itself.

Definition at line 89 of file group.test.cc.

References gem5::statistics::Group::addStatGroup().

◆ TEST() [2/30]

TEST ( StatsGroupDeathTest ,
AddNull  )

Test that a group cannot add a non-existent group.

Definition at line 82 of file group.test.cc.

References gem5::statistics::Group::addStatGroup().

◆ TEST() [3/30]

TEST ( StatsGroupDeathTest ,
AddUniqueNameStatGroup  )

Test that group names are unique within a node's stat group.

Definition at line 60 of file group.test.cc.

References gem5::statistics::Group::addStatGroup().

◆ TEST() [4/30]

TEST ( StatsGroupDeathTest ,
DISABLED_AddCycle  )
Todo
Test that a group cannot be added in a cycle.

Definition at line 96 of file group.test.cc.

References gem5::statistics::Group::addStatGroup().

◆ TEST() [5/30]

TEST ( StatsGroupDeathTest ,
MergeStatGroupItself  )

Test that a group cannot merge with itself.

Definition at line 303 of file group.test.cc.

References gem5::statistics::Group::mergeStatGroup().

◆ TEST() [6/30]

TEST ( StatsGroupDeathTest ,
MergeStatGroupMergedParent  )

Test that a group that has already been merged cannot be merged again.

Definition at line 330 of file group.test.cc.

References gem5::statistics::Group::mergeStatGroup().

◆ TEST() [7/30]

TEST ( StatsGroupDeathTest ,
MergeStatGroupNoGroup  )

Test that a group cannot merge if another group is not provided.

Definition at line 296 of file group.test.cc.

References gem5::statistics::Group::mergeStatGroup().

◆ TEST() [8/30]

TEST ( StatsGroupTest ,
AddGetMultipleStatGroup  )

Test adding multiple stat groups to a root node.

Definition at line 107 of file group.test.cc.

References gem5::statistics::Group::addStatGroup(), and gem5::statistics::Group::getStatGroups().

◆ TEST() [9/30]

TEST ( StatsGroupTest ,
AddGetSingleStatGroup  )

Test adding a single stat group to a root node.

Definition at line 46 of file group.test.cc.

References gem5::statistics::Group::addStatGroup(), and gem5::statistics::Group::getStatGroups().

◆ TEST() [10/30]

TEST ( StatsGroupTest ,
AddGetStat  )

Test adding stats to a group.

Definition at line 273 of file group.test.cc.

References gem5::statistics::Group::addStat(), gem5::statistics::Group::getStats(), name(), and gem5::statistics::Info::setName().

◆ TEST() [11/30]

TEST ( StatsGroupTest ,
AddNotUniqueNameAmongGroups  )

Test that group names are not unique among two nodes' stat groups.

Definition at line 70 of file group.test.cc.

References gem5::statistics::Group::addStatGroup().

◆ TEST() [12/30]

TEST ( StatsGroupTest ,
AddStatMergedParent  )

Test that after a group has been merged, adding stats to it will add stats to the group it was merged to too.

Definition at line 343 of file group.test.cc.

References gem5::statistics::Group::addStat(), gem5::statistics::Group::getStats(), gem5::statistics::Group::mergeStatGroup(), name(), and gem5::statistics::Info::setName().

◆ TEST() [13/30]

TEST ( StatsGroupTest ,
AddStatMergedParentMain  )

Test that after a group has been merged, adding stats to the "main" group does not add stats to the group it was merged to.

Definition at line 370 of file group.test.cc.

References gem5::statistics::Group::addStat(), gem5::statistics::Group::getStats(), gem5::statistics::Group::mergeStatGroup(), name(), and gem5::statistics::Info::setName().

◆ TEST() [14/30]

TEST ( StatsGroupTest ,
ConstructCorrectlyAssigned  )

Make sure that the groups are correctly assigned in the map.

Definition at line 125 of file group.test.cc.

References gem5::statistics::Group::addStatGroup(), and gem5::statistics::Group::getStatGroups().

◆ TEST() [15/30]

TEST ( StatsGroupTest ,
ConstructNoName  )

Test that calling the constructor with a parent, but no name merges the groups.

Definition at line 392 of file group.test.cc.

References gem5::statistics::Group::addStat(), gem5::statistics::Group::getStats(), name(), and gem5::statistics::Info::setName().

◆ TEST() [16/30]

TEST ( StatsGroupTest ,
ConstructNoParent  )

Test that the constructor without a parent doesn't do anything.

Definition at line 39 of file group.test.cc.

References gem5::statistics::Group::getStatGroups().

◆ TEST() [17/30]

TEST ( StatsGroupTest ,
ConstructOneLevelLinear  )

Test that the constructor, when provided both the parent and the nodes' name, creates the following tree:

root | node1

Definition at line 147 of file group.test.cc.

References gem5::statistics::Group::getStatGroups().

◆ TEST() [18/30]

TEST ( StatsGroupTest ,
ConstructOneLevelOfTwoNodes  )

Test that the constructor, when provided both the parent and the nodes' name, creates the following tree:

root / \ node1 node2

Definition at line 167 of file group.test.cc.

References gem5::statistics::Group::getStatGroups().

◆ TEST() [19/30]

TEST ( StatsGroupTest ,
ConstructTwoLevelsLinear  )

Test that the constructor, when provided both the parent and the nodes' name, creates the following tree:

root | node1 | node1_1

Definition at line 192 of file group.test.cc.

References gem5::statistics::Group::getStatGroups().

◆ TEST() [20/30]

TEST ( StatsGroupTest ,
ConstructTwoLevelsUnbalancedTree  )

Test that the constructor, when provided both the parent and the nodes' name, creates the following tree:

   root
  /     \

node1 node2 | / \ node1_1 node2_1 node2_2

Definition at line 220 of file group.test.cc.

References gem5::statistics::Group::getStatGroups().

◆ TEST() [21/30]

TEST ( StatsGroupTest ,
MergeStatGroup  )

◆ TEST() [22/30]

TEST ( StatsGroupTest ,
PreDumpStats  )

Test that calling preDumpStats calls the respective function of all sub- groups and merged groups.

Definition at line 492 of file group.test.cc.

References gem5::statistics::Group::Group(), and gem5::statistics::Group::preDumpStats().

◆ TEST() [23/30]

TEST ( StatsGroupTest ,
RegStats  )

Test that calling regStats calls the respective function of all sub-groups and merged groups.

Definition at line 410 of file group.test.cc.

References gem5::statistics::Group::Group(), and gem5::statistics::Group::regStats().

◆ TEST() [24/30]

TEST ( StatsGroupTest ,
ResetStats  )

Test that resetting a stat from a specific node reset the stats of all its sub-groups and merged groups, and that it does not reset the stats of its parents.

Definition at line 448 of file group.test.cc.

References gem5::statistics::Group::addStat(), gem5::statistics::Group::resetStats(), gem5::statistics::Info::setName(), and DummyInfo::value.

◆ TEST() [25/30]

TEST ( StatsGroupTest ,
ResolveStatMerged  )

◆ TEST() [26/30]

TEST ( StatsGroupTest ,
ResolveStatMergedSubGroup  )

◆ TEST() [27/30]

TEST ( StatsGroupTest ,
ResolveStatNone  )

Test that resolving a non-existent stat returns a nullptr.

Definition at line 526 of file group.test.cc.

References gem5::statistics::Group::addStat(), gem5::statistics::Group::resolveStat(), and gem5::statistics::Info::setName().

◆ TEST() [28/30]

TEST ( StatsGroupTest ,
ResolveStatSelf  )

Test resolving a stat belonging to the caller group.

Definition at line 539 of file group.test.cc.

References gem5::statistics::Group::addStat(), gem5::statistics::Group::resolveStat(), and gem5::statistics::Info::setName().

◆ TEST() [29/30]

TEST ( StatsGroupTest ,
ResolveStatSubGroupOnSubGroup  )

Test that resolving a stat from the parent is not possible.

Definition at line 605 of file group.test.cc.

References gem5::statistics::Group::addStat(), gem5::statistics::Group::resolveStat(), and gem5::statistics::Info::setName().

◆ TEST() [30/30]

TEST ( StatsGroupTest ,
ResolveSubGroupStatFromParent  )

Test that resolving stats from sub-groups is possible.

Definition at line 569 of file group.test.cc.

References gem5::statistics::Group::addStat(), gem5::statistics::Group::resolveStat(), and gem5::statistics::Info::setName().


Generated on Tue Jun 18 2024 16:24:08 for gem5 by doxygen 1.11.0