2
Datastructure items should all the MAUS_VERSIONED_CLASS_DEF macro
11
Return true if it is a header file
13
return a_path[-3:] == ".hh" and a_path[-6:] != "inl.hh"
16
"src/common_cpp/DataStructure/LinkDef.hh",
17
"src/common_cpp/DataStructure/Global/ReconEnums.hh",
20
def is_ignored(a_path):
22
Return true if file is in the exclusion list
24
strip_path = a_path[len(os.environ["MAUS_ROOT_DIR"])+1:]
25
return strip_path in EXCLUSIONS
27
class TestDataStructure(unittest.TestCase): # pylint: disable=R0904
29
Check data structure vs ROOT integrity
31
def test_data_structure(self):
33
@brief walk the directory structure from target_dir
35
target_dir = "${MAUS_ROOT_DIR}/src/common_cpp/DataStructure"
36
target_dir = os.path.expandvars(target_dir)
37
for this_dir, subdirs, files in os.walk(target_dir):
38
print 'In', this_dir, 'with', len(subdirs), 'subdirectories'
39
for file_name in files:
40
path = os.path.join(this_dir, file_name)
41
if is_header(path) and not is_ignored(path):
43
out = subprocess.check_output(['grep',
44
'MAUS_VERSIONED_CLASS_DEF',
46
self.assertNotEqual(out, '')
48
if __name__ == "__main__":