Skip to content

Commit

Permalink
Add unit tests of multichain with empty files
Browse files Browse the repository at this point in the history
  • Loading branch information
gpetruc committed Aug 21, 2015
1 parent c36824a commit d0fc197
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
14 changes: 14 additions & 0 deletions DataFormats/FWLite/test/pyroot_multichain.py
@@ -0,0 +1,14 @@
#! /usr/bin/env python
import ROOT
from DataFormats.FWLite import Events, Handle
import FWCore.ParameterSet.VarParsing as VarParsing
options = VarParsing.VarParsing ('analysis')
options.parseArguments()
events = Events(options)

print "In total there are %d events" % events.size()
print "Trying an event loop"
for i,event in enumerate(events):
print "I am processing an event"
if i > 10: break
print "Done with the event loops"
2 changes: 2 additions & 0 deletions DataFormats/FWLite/test/run_all_t.sh
Expand Up @@ -23,6 +23,8 @@ ${LOCAL_TEST_DIR}/VIPTest.sh || die 'Failed to create file' $?
root -b -n -q ${LOCAL_TEST_DIR}/vector_int_cint.C || die 'Failed in vector_int_cint.C' $?

python ${LOCAL_TEST_DIR}/pyroot_handle_reuse.py || die 'Failed in pyroot_handle_reuse.py' $?
python ${LOCAL_TEST_DIR}/pyroot_multichain.py inputFiles=file:prodmerge.root secondaryInputFiles=file:prod1.root,file:prod2.root || die 'Failed in pyroot_multichain.py (non-empty files)' $?
python ${LOCAL_TEST_DIR}/pyroot_multichain.py inputFiles=file:empty_a.root secondaryInputFiles=file:good_a.root || die 'Failed in pyroot_multichain.py (empty file)' $?

#NOTE: ROOT has a bug which keeps the AssociationVector from running its ioread rule and therefore it never clears its cache
#test AssociationVector reading
Expand Down

0 comments on commit d0fc197

Please sign in to comment.