Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ install(
)

# Unit testing setup
add_test(NAME EvioWriteAndReadBack_builder COMMAND bin/EvioWriteAndReadBack_builder 10)
add_test(NAME EvioWriteAndReadBack_builder COMMAND bin/EvioWriteAndReadBack_builder 10 ${CMAKE_CURRENT_SOURCE_DIR}/etc/test_files)

# Uninstall target
# Removed for now, not yet compatible with building disruptor-cpp internally
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ The C and C++ libraries are build using `cmake`. To build C/C++ code from this r

git clone https://github.com/JeffersonLab/evio/
cd evio; mkdir build
cmake -S . -B build
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build --target install --parallel

Note that during the cmake configure step (first of two `cmake` commands above), one can also include the following special flags:
Expand Down
2 changes: 1 addition & 1 deletion src/test/cpp/EvioTestHelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ using namespace evio;
std::string baseNameV4 = "testEventsV4_cppAPI.evio"; // base name of file to be created. If split > 1, this is the base name of all files created. If split < 1, this is the name of the only file created.
std::string baseNameV6 = "testEventsV6_cppAPI.evio"; // base name of file to be created. If split > 1, this is the base name of all files created. If split < 1, this is the name of the only file created.
std::string baseNameHIPO = "testEventsHIPO_cppAPI.hipo"; // base name of file to be created. If split > 1, this is the base name of all files created. If split < 1, this is the name of the only file created.
std::string directory = "etc/test_files"; // directory in which file is to be placed
std::string directory = ""; // directory in which file is to be placed

private:

Expand Down
10 changes: 6 additions & 4 deletions src/test/cpp/EvioWriteAndReadBack_builder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,20 @@ void evioReadStep(std::string filename);
int main(int argc, char* argv[]) {

// Boilerplate
if (argc != 2) {
if (argc != 2 && argc != 3) {
std::cerr << "Usage: " << argv[0] << " <number_of_events>\n";
return 1;
}
int nEvents = std::stoi(argv[1]);
std::cout << "Writing " << nEvents << " events to files..." << std::endl;
EvioTestHelper* evioHelperObj = new EvioTestHelper();

if (argc == 3) evioHelperObj->directory = argv[2];

// std::shared_ptr<EventWriterV4> writerV4 = evioHelperObj->defaultEventWriterV4();
std::shared_ptr<EventWriter> writerV6 = evioHelperObj->defaultEventWriter();
// std::shared_ptr<EventWriter> writerHipo = evioHelperObj->defaultEventWriterHIPO();


std::cout << "Writing " << nEvents << " events to files..." << std::endl;

for (int i = 0; i < nEvents; ++i) {

// Build a new event (top-level bank) with tag=1, type=BANK, num=1
Expand Down