[Rivet-svn] rivet: 2 new changesets

Rivet Mercurial rivet at projects.hepforge.org
Mon Oct 2 15:15:01 BST 2017


details:   https://rivet.hepforge.org/hg/rivet/rev/c0e777a77265
branches:  multiweight
changeset: 6065:c0e777a77265
user:      David Grellscheid <david.grellscheid at durham.ac.uk>
date:      Mon Oct 02 14:47:02 2017 +0100
description:
Fix out-of-source testing

details:   https://rivet.hepforge.org/hg/rivet/rev/8bf353b6f0f8
branches:  multiweight
changeset: 6066:8bf353b6f0f8
user:      David Grellscheid <david.grellscheid at durham.ac.uk>
date:      Mon Oct 02 15:02:54 2017 +0100
description:
Fix distribution of new test files. Distcheck confirmed working again

diffs (truncated from 84 to 50 lines):

--- a/test/Makefile.am	Mon Oct 02 14:00:06 2017 +0100
+++ b/test/Makefile.am	Mon Oct 02 15:02:54 2017 +0100
@@ -32,7 +32,7 @@
   RIVET_TESTS_SRC=$(srcdir)
 
 TESTS = \
-testMath testMatVec testCmp testApi testNaN testBeams \
+testMath testMatVec testCmp testApi.sh testNaN.sh testBeams \
 testImport.sh
 
 if ENABLE_ANALYSES
@@ -41,6 +41,6 @@
 endif
 endif
 
-EXTRA_DIST = testApi.hepmc testCmdLine.sh testImport.sh
+EXTRA_DIST = testApi.hepmc testCmdLine.sh testImport.sh testApi.sh testNaN.sh
 
 CLEANFILES = log a.out fifo.hepmc file2.hepmc out.yoda NaN.aida Rivet.yoda
--- a/test/testApi.cc	Mon Oct 02 14:00:06 2017 +0100
+++ b/test/testApi.cc	Mon Oct 02 15:02:54 2017 +0100
@@ -4,7 +4,9 @@
 
 using namespace std;
 
-int main() {
+int main(int argc, char* argv[]) {
+  assert(argc > 1);
+
   Rivet::AnalysisHandler ah;
   Rivet::Log::setLevel("Rivet", Rivet::Log::DEBUG);
 
@@ -12,9 +14,14 @@
   ah.addAnalysis("EXAMPLE");
   ah.addAnalyses({{ "MC_JETS", "EXAMPLE_CUTS", "EXAMPLE_SMEAR" }});
 
-  std::ifstream file("testApi.hepmc");
+  std::ifstream file(argv[1]);
   HepMC::IO_GenEvent hepmcio(file);
   HepMC::GenEvent* evt = hepmcio.read_next_event();
+  if (! evt) {
+  	cerr << "No events\n";
+  	return 1;
+  }
+
   while (evt) {
     // Analyse current event
     ah.analyze(*evt);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/testApi.sh	Mon Oct 02 15:02:54 2017 +0100


More information about the Rivet-svn mailing list