Skip to content

Test classes TileGeoG4SD and TileGeoG4CalibSD

Liangliang Han requested to merge lihan/athena:TestTileGeoG4SD_Calib1 into master

In the branch, I will test the classes TileGeoG4SD and TileGeoG4CalibSD. Here is how I did about my testing strategy.

  1. I put my test codes in the test folder. And the nomenclature is like CLASSNAME_gtest.cxx for testing the class CLASSNAME.
  2. I created the jobOption file optionForTest.txt, which is placed in the share folder.
  3. 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.
  4. Of course, I add some lines in the CMakeLists.txt for compiling my test code, using google test frame work, and so on.
  5. I create 3 files and put them into the folder Simulation/G4Atlas/G4AtlasTools/G4AtlasTools. The 1st file is DerivedG4SensitiveDetectorTestSetting.h, where I define a function for setting G4-objects to G4Step object. The 2nd file is G4MyPhysicalVolume.h, where I define a class called G4MyPhysicalVolume that is derived from G4VPhysicalVolume. The 3rd file is G4MyProcess.h, where I define a class called G4MyProcess that is derived from G4VProcess.
  6. Also, I created a file called DerivedG4SensitiveDetector.h in the folder Simulation/G4Atlas/G4AtlasTools/G4AtlasTools, which is intended to define a class inheriting from a abstract class G4VSensitiveDetector. Then I can use the derived class in my test codes.
  7. In addition, I created files called DerivedISvcLocator.h and DerivedITileCalculator.h where two classes are defined with inheriting respectively class SvcLocator and class ITileCalculator.
  8. It is worth mentioning that I use different TEST_F to test different member functions of the tested class.
Edited by Liangliang Han

Merge request reports

Loading