diff --git a/DDTest/CMakeLists.txt b/DDTest/CMakeLists.txt
index 4f065e2586635a94d9851683085668f03ce8ce8e..d3fb4fe2d74386276f6aee5aaae9677b434f4616 100644
--- a/DDTest/CMakeLists.txt
+++ b/DDTest/CMakeLists.txt
@@ -54,6 +54,12 @@ if (DD4HEP_USE_GEANT4)
       test_EventReaders
       )
     add_executable(${TEST_NAME} src/${TEST_NAME}.cc)
+    if(DD4HEP_USE_HEPMC3)
+      target_compile_definitions(${TEST_NAME} PRIVATE DD4HEP_USE_HEPMC3)
+    endif()
+    if(DD4HEP_USE_LCIO)
+      target_compile_definitions(${TEST_NAME} PRIVATE DD4HEP_USE_LCIO)
+    endif()
     target_link_libraries(${TEST_NAME} DD4hep::DDCore DD4hep::DDRec DD4hep::DDG4)
     target_include_directories(${TEST_NAME} PRIVATE ./include)
     install(TARGETS ${TEST_NAME} DESTINATION bin)
diff --git a/DDTest/src/test_EventReaders.cc b/DDTest/src/test_EventReaders.cc
index 5efe6effba7ea0182234cf3b4cba924e26d4bd04..06400858c8ea0761793f4b76532f36ea3a991769 100644
--- a/DDTest/src/test_EventReaders.cc
+++ b/DDTest/src/test_EventReaders.cc
@@ -37,11 +37,14 @@ int main(int argc, char** argv ){
   std::string inputFileFolder = argv[1];
 
   std::vector<TestTuple> tests;
+  #ifdef DD4HEP_USE_LCIO
   tests.push_back( TestTuple( "LCIOStdHepReader", "bbudsc_3evt.stdhep" ) );
   tests.push_back( TestTuple( "LCIOFileReader",   "muons.slcio" , /*skipEOF= */ true ) );
+  #endif
   tests.push_back( TestTuple( "Geant4EventReaderHepEvtShort", "Muons10GeV.HEPEvt" ) );
-  tests.push_back( TestTuple( "Geant4EventReaderHepMC", "g4pythia.hepmc" ) );
-
+  #ifdef DD4HEP_USE_HEPMC3
+  tests.push_back( TestTuple( "HEPMC3FileReader", "g4pythia.hepmc", /*skipEOF= */ true) );
+  #endif
 
   try{
     for(std::vector<TestTuple>::const_iterator it = tests.begin(); it != tests.end(); ++it) {