Test classes TileGeoG4SD and TileGeoG4CalibSD
In the branch, I will test the classes TileGeoG4SD and TileGeoG4CalibSD. Here is how I did about my testing strategy.
- I put my test codes in the
testfolder. And the nomenclature is likeCLASSNAME_gtest.cxxfor testing the classCLASSNAME. - I created the jobOption file
optionForTest.txt, which is placed in thesharefolder. - In oder to add my test classes as friends of the tested classes, I add several lines for that in the file
CLASSNAME_gtest.h. - Of course, I add some lines in the
CMakeLists.txtfor compiling my test code, using google test frame work, and so on. - I create 3 files and put them into the folder
Simulation/G4Atlas/G4AtlasTools/G4AtlasTools. The 1st file isDerivedG4SensitiveDetectorTestSetting.h, where I define a function for setting G4-objects to G4Step object. The 2nd file isG4MyPhysicalVolume.h, where I define a class calledG4MyPhysicalVolumethat is derived fromG4VPhysicalVolume. The 3rd file isG4MyProcess.h, where I define a class calledG4MyProcessthat is derived fromG4VProcess. - Also, I created a file called
DerivedG4SensitiveDetector.hin the folderSimulation/G4Atlas/G4AtlasTools/G4AtlasTools, which is intended to define a class inheriting from a abstract classG4VSensitiveDetector. Then I can use the derived class in my test codes. - In addition, I created files called
DerivedISvcLocator.handDerivedITileCalculator.hwhere two classes are defined with inheriting respectively classSvcLocatorand classITileCalculator. - It is worth mentioning that I use different TEST_F to test different member functions of the tested class.
Edited by Liangliang Han