Skip to content

Commit 2651cdf

Browse files
authored
Merge pull request #42 from JeffersonLab/evio-6-dev
Fix C++ test's output directory, now github CI should work again
2 parents 93c65b5 + e33fdf6 commit 2651cdf

4 files changed

Lines changed: 9 additions & 7 deletions

File tree

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ install(FILES
306306
)
307307

308308
# Unit testing setup
309-
add_test(NAME EvioWriteAndReadBack_builder COMMAND bin/EvioWriteAndReadBack_builder 10)
309+
add_test(NAME EvioWriteAndReadBack_builder COMMAND bin/EvioWriteAndReadBack_builder 10 ${CMAKE_CURRENT_SOURCE_DIR}/etc/test_files)
310310

311311
# Uninstall target
312312
# Removed for now, not yet compatible with building disruptor-cpp internally

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ The C and C++ libraries are build using `cmake`. To build C/C++ code from this r
2424

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

3030
Note that during the cmake configure step (first of two `cmake` commands above), one can also include the following special flags:

src/test/cpp/EvioTestHelper.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ using namespace evio;
125125
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.
126126
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.
127127
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.
128-
std::string directory = "etc/test_files"; // directory in which file is to be placed
128+
std::string directory = ""; // directory in which file is to be placed
129129

130130
private:
131131

src/test/cpp/EvioWriteAndReadBack_builder.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,20 @@ void evioReadStep(std::string filename);
88
int main(int argc, char* argv[]) {
99

1010
// Boilerplate
11-
if (argc != 2) {
11+
if (argc != 2 && argc != 3) {
1212
std::cerr << "Usage: " << argv[0] << " <number_of_events>\n";
1313
return 1;
1414
}
1515
int nEvents = std::stoi(argv[1]);
16-
std::cout << "Writing " << nEvents << " events to files..." << std::endl;
1716
EvioTestHelper* evioHelperObj = new EvioTestHelper();
18-
17+
if (argc == 3) evioHelperObj->directory = argv[2];
18+
1919
// std::shared_ptr<EventWriterV4> writerV4 = evioHelperObj->defaultEventWriterV4();
2020
std::shared_ptr<EventWriter> writerV6 = evioHelperObj->defaultEventWriter();
2121
// std::shared_ptr<EventWriter> writerHipo = evioHelperObj->defaultEventWriterHIPO();
22-
22+
23+
std::cout << "Writing " << nEvents << " events to files..." << std::endl;
24+
2325
for (int i = 0; i < nEvents; ++i) {
2426

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

0 commit comments

Comments
 (0)