Page Menu
Home
HEPForge
Search
Configure Global Search
Log In
Files
F7878268
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
7 KB
Subscribers
None
View Options
diff --git a/tests/Makefile.am b/tests/Makefile.am
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -1,148 +1,151 @@
PYTESTS = \
pytest-unit \
pytest-counter \
pytest-h1d \
pytest-p1d \
pytest-h2d \
pytest-p2d \
pytest-s1d \
pytest-s2d \
pytest-div \
pytest-rebin \
pytest-iofilter \
pytest-operators
SHTESTS = \
shtest-yodamerge \
shtest-yodahist \
shtest-yodals \
shtest-yodacmp \
shtest-yoda2flat \
shtest-yodascale \
shtest-yodaplot \
shtest-yodacnv \
shtest-yoda2yoda
EXTRA_DIST = $(PYTESTS) $(SHTESTS) \
shtest-yoda2root \
test1.yoda test2.yoda \
iofilter.yoda \
rivetexample.yoda \
yodals-ref.txt \
yodahist-ref.yoda \
yodahist-fills.txt \
yoda2flat-ref.dat \
merged12-ref.yoda merged12pi-ref.yoda
check_PROGRAMS = \
testtraits \
testannotations \
testweights \
testbinsearcher \
testwriter \
+ testreader \
testhisto1Da testhisto1Db \
testhisto2Da \
testprofile1Da \
testindexedset \
testsortedvector\
testhisto1Dcreate \
testhisto1Dfill \
testhisto1Dmodify \
testprofile1Dcreate \
testprofile1Dfill \
testprofile1Dmodify \
testscatter2Dcreate \
testscatter2Dmodify \
testhisto2Dcreate
# testhisto2Dfill \
# testhisto2Dmodify \
# testscatter3Dcreate \
# testscatter3Dmodify
AM_LDFLAGS = -L$(top_builddir)/src -lYODA
testtraits_SOURCES = TestTraits.cc
testannotations_SOURCES = TestAnnotations.cc
testweights_SOURCES = TestWeights.cc
testbinsearcher_SOURCES = TestBinSearcher.cc
testwriter_SOURCES = TestWriter.cc
+testreader_SOURCES = TestReader.cc
testhisto1Da_SOURCES = TestHisto1Da.cc
testhisto1Db_SOURCES = TestHisto1Db.cc
testprofile1Da_SOURCES = TestProfile1Da.cc
testindexedset_SOURCES = TestIndexedSet.cc
testsortedvector_SOURCES = TestSortedVector.cc
testhisto1Dcreate_SOURCES = Histo1D/H1DCreate.cc
testhisto1Dfill_SOURCES = Histo1D/H1DFill.cc
testhisto1Dmodify_SOURCES = Histo1D/H1DModify.cc
testprofile1Dcreate_SOURCES = Profile1D/P1DCreate.cc
testprofile1Dfill_SOURCES = Profile1D/P1DFill.cc
testprofile1Dmodify_SOURCES = Profile1D/P1DModify.cc
testhisto2Da_SOURCES = TestHisto2Da.cc
# testhisto2De_SOURCES = TestHisto2Derase.cc
testhisto2Dcreate_SOURCES = Histo2D/H2DCreate.cc
#testhisto2Dfill_SOURCES = Histo2D/H2DFill.cc
#testhisto2Dmodify_SOURCES = Histo2D/H2DModify.cc
testscatter2Dcreate_SOURCES = Scatter2D/S2DCreate.cc
testscatter2Dmodify_SOURCES = Scatter2D/S2DModify.cc
# testpoint3D_SOURCES = TestPoint3D.cc
# testscatter3D_SOURCES = TestScatter3D.cc
# testscatter3Dcreate_SOURCES = Scatter3D/S3DCreate.cc
# testscatter3Dmodify_SOURCES = Scatter3D/S3DModify.cc
TESTS_ENVIRONMENT = \
LD_LIBRARY_PATH=$(top_builddir)/src/.libs:$(LD_LIBRARY_PATH) \
DYLD_LIBRARY_PATH=$(top_builddir)/src/.libs:$(DYLD_LIBRARY_PATH) \
PYTHONPATH=$(top_builddir)/pyext/build/$(YODA_SETUP_PY_PATH):$(PYTHONPATH) \
PATH=$(top_builddir)/bin:$(top_srcdir)/bin:$(PATH) \
YODA_TESTS_SRC=$(srcdir)
TESTS = \
testtraits \
testannotations \
testweights \
testbinsearcher \
testwriter \
+ testreader \
testhisto1Da \
testhisto1Db \
testhisto2Da \
testprofile1Da \
testindexedset \
testsortedvector \
testhisto1Dcreate \
testhisto1Dfill \
testhisto1Dmodify \
testprofile1Dcreate \
testprofile1Dfill \
testprofile1Dmodify \
testscatter2Dcreate \
testscatter2Dmodify \
testhisto2Dcreate
### to make distcheck work on macOS, we need a
### way to prevent the DYLD_LIBRARY_PATH setting
### from being removed by system integrity protection
-### when /usr/bin/env is called
+### when /usr/bin/env is called
### (same for any other app in /usr/bin)
###
if ! WITH_OSX
TESTS += $(PYTESTS) $(SHTESTS)
endif
CLEANFILES = \
h1d.yoda h1d.dat \
p1d.yoda p1d.dat \
h2d.yoda h2d.dat \
p2d.yoda p2d.dat \
s1d.yoda s2d.yoda \
testwriter1.yoda testwriter2.yoda \
foo_bar_baz.dat \
counter.yoda \
test.aida
if ENABLE_ROOT
TESTS += shtest-yoda2root
CLEANFILES += test1.root
endif
diff --git a/tests/TestReader.cc b/tests/TestReader.cc
new file mode 100644
--- /dev/null
+++ b/tests/TestReader.cc
@@ -0,0 +1,23 @@
+#include "YODA/Histo1D.h"
+#include "YODA/ReaderYODA.h"
+#include "YODA/IO.h"
+#include <cmath>
+#include <vector>
+#include <iostream>
+#include <memory>
+#include <type_traits>
+
+using namespace std;
+using namespace YODA;
+
+
+int main() {
+
+ vector<AnalysisObject*> aos1 = YODA::read("testwriter2.yoda");
+
+ #ifdef WITH_ZLIB
+ vector<AnalysisObject*> aos2 = YODA::read("testwriter2.yoda.gz");
+ #endif
+
+ return EXIT_SUCCESS;
+}
diff --git a/tests/TestWriter.cc b/tests/TestWriter.cc
--- a/tests/TestWriter.cc
+++ b/tests/TestWriter.cc
@@ -1,33 +1,34 @@
#include "YODA/Histo1D.h"
#include "YODA/WriterYODA.h"
#include <cmath>
#include <vector>
#include <iostream>
#include <memory>
#include <type_traits>
using namespace std;
using namespace YODA;
int main() {
//shared_ptr<AnalysisObject>
auto h = make_shared<Histo1D>(20, 0.0, 1.0);
for (size_t n = 0; n < 1000; ++n) {
const double num = rand()/static_cast<double>(RAND_MAX);
h->fill(num);
}
WriterYODA::create().write("testwriter1.yoda", h);
WriterYODA::write("testwriter1.yoda", h);
vector< shared_ptr<Histo1D> > hs;
hs.push_back(h);
WriterYODA::write("testwriter2.yoda", hs);
vector< shared_ptr<AnalysisObject> > aos;
aos.push_back( static_pointer_cast<AnalysisObject>(h) );
WriterYODA::write("testwriter2.yoda", aos);
+ WriterYODA::write("testwriter2.yoda.gz", aos);
return EXIT_SUCCESS;
}
diff --git a/tests/test1.yoda b/tests/test1.yoda
--- a/tests/test1.yoda
+++ b/tests/test1.yoda
@@ -1,23 +1,23 @@
BEGIN YODA_HISTO1D_V2 /foo/bar/baz
Path: /foo/bar/baz
Title: foobar
Type: Histo1D
---
# Mean: 4.033333e+01
# Area: 9.000000e+00
# ID ID sumw sumw2 sumwx sumwx2 numEntries
Total Total 9.000000e+00 9.000000e+00 3.630000e+02 2.220100e+04 9.000000e+00
Underflow Underflow 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00
Overflow Overflow 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00
# xlow xhigh sumw sumw2 sumwx sumwx2 numEntries
0.000000e+00 1.000000e+01 2.000000e+00 2.000000e+00 1.000000e+01 5.200000e+01 2.000000e+00
1.000000e+01 2.000000e+01 1.000000e+00 1.000000e+00 1.700000e+01 2.890000e+02 1.000000e+00
2.000000e+01 3.000000e+01 2.000000e+00 2.000000e+00 5.200000e+01 1.370000e+03 2.000000e+00
3.000000e+01 4.000000e+01 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00
4.000000e+01 5.000000e+01 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00
5.000000e+01 6.000000e+01 1.000000e+00 1.000000e+00 5.700000e+01 3.249000e+03 1.000000e+00
6.000000e+01 7.000000e+01 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00
7.000000e+01 8.000000e+01 2.000000e+00 2.000000e+00 1.450000e+02 1.051700e+04 2.000000e+00
8.000000e+01 9.000000e+01 1.000000e+00 1.000000e+00 8.200000e+01 6.724000e+03 1.000000e+00
9.000000e+01 1.000000e+02 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00
-END YODA_HISTO1D
+END YODA_HISTO1D_V2
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Tue, Nov 19, 5:34 PM (1 d, 15 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3805413
Default Alt Text
(7 KB)
Attached To
rYODAHG yodahg
Event Timeline
Log In to Comment