Skip to content

Commit

Permalink
Merge pull request #63 from blinkseb/tests
Browse files Browse the repository at this point in the history
Add very simple unit test to check that the framework is running
  • Loading branch information
OlivierBondu committed Sep 22, 2015
2 parents 0530a4b + 0b85fab commit 2a0e3a5
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/BuildFile.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<bin name="Testcp3_llbbFramework" file="TestDriver.cc">
<flags TEST_RUNNER_ARGS="/bin/bash cp3_llbb/Framework/test run_tests.sh"/>
<use name="FWCore/Utilities" />
</bin>
3 changes: 3 additions & 0 deletions test/TestDriver.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#include "FWCore/Utilities/interface/TestHelper.h"

RUNTEST()
10 changes: 10 additions & 0 deletions test/run_tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

# Pass in name and status
function die { echo $1: status $2 ; exit $2; }

F1=${LOCAL_TEST_DIR}/unit_tests_mc.py
(cmsRun $F1 ) || die "Failure using $F1" $?

F2=${LOCAL_TEST_DIR}/unit_tests_data.py
(cmsRun $F2 ) || die "Failure using $F2" $?
13 changes: 13 additions & 0 deletions test/unit_tests_data.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@

import FWCore.ParameterSet.Config as cms

from Configuration.StandardSequences.Eras import eras
from cp3_llbb.Framework import Framework

process = Framework.create(True, eras.Run2_50ns, '74X_dataRun2_v2', redoJEC=True)

process.source.fileNames = cms.untracked.vstring(
'file:///afs/cern.ch/user/s/sbrochet/public/CP3/DoubleMuon-Run2015B-17Jul2015-v1-MiniAOD_reduced.root'
)

process.maxEvents = cms.untracked.PSet(input = cms.untracked.int32(10))
13 changes: 13 additions & 0 deletions test/unit_tests_mc.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@

import FWCore.ParameterSet.Config as cms

from Configuration.StandardSequences.Eras import eras
from cp3_llbb.Framework import Framework

process = Framework.create(False, eras.Run2_25ns, '74X_mcRun2_asymptotic_v2', redoJEC=True)

process.source.fileNames = cms.untracked.vstring(
'file:///afs/cern.ch/user/s/sbrochet/public/CP3/TTJets_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8_Asympt25ns_MCRUN2_74_V9_reduced.root'
)

process.maxEvents = cms.untracked.PSet(input = cms.untracked.int32(10))

0 comments on commit 2a0e3a5

Please sign in to comment.