Skip to content

Commit 639ac25

Browse files
authored
move to tools and rename podio_test_hashes (#881)
* move to tools and rename podio_test_hashes * add docs
1 parent 886e15b commit 639ac25

File tree

4 files changed

+19
-9
lines changed

4 files changed

+19
-9
lines changed

doc/tools.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,3 +107,15 @@ Example usage:
107107
podio-vis --fmt svg my_model.yaml
108108
firefox gv.svg
109109
```
110+
111+
## Testing hash collisions in collection names: `podio-test-hashes`
112+
113+
`podio-test-hashes` is a small utility that checks whether a list of collection names produces collisions when hashed into PODIO collection IDs.
114+
The names should be provided in a test file, separated by whitespace.
115+
If any collisions are found, the tool will return status code `1` and print the colliding names along with their computed hash IDs.
116+
117+
Example usage:
118+
119+
```bash
120+
podio-test-hashes collection_names.txt
121+
```

src/CMakeLists.txt

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -252,10 +252,3 @@ if (ENABLE_DATASOURCE)
252252
DESTINATION "${CMAKE_INSTALL_LIBDIR}"
253253
)
254254
endif()
255-
256-
add_executable(podio_test_hashes test_hashes.cpp)
257-
target_link_libraries(podio_test_hashes PRIVATE podio::podio)
258-
install(TARGETS podio_test_hashes
259-
EXPORT podioTargets
260-
DESTINATION "${CMAKE_INSTALL_BINDIR}"
261-
)

tools/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
2+
add_executable(podio-test-hashes src/podio-test-hashes.cpp)
3+
target_link_libraries(podio-test-hashes PRIVATE podio::podio)
4+
install(TARGETS podio-test-hashes EXPORT podioTargets DESTINATION "${CMAKE_INSTALL_BINDIR}")
5+
16
add_executable(podio-dump-tool src/podio-dump-tool.cpp)
27
target_link_libraries(podio-dump-tool PRIVATE podio::podio podio::podioIO fmt::fmt)
38

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#include "MurmurHash3.h"
1+
#include "../src/MurmurHash3.h"
22

33
#include <fstream>
44
#include <iomanip>
@@ -87,7 +87,7 @@ std::ostream& operator<<(std::ostream& os, const std::vector<T, A>& vec) {
8787
return os << ']';
8888
}
8989

90-
constexpr static auto usage = R"USAGE(usage: podio_test_hashes [-h] collNameFile)USAGE";
90+
constexpr static auto usage = R"USAGE(usage: podio-test-hashes [-h] collNameFile)USAGE";
9191
constexpr static auto help = R"HELP(
9292
Check if any of the collection names provided lead to a collision in the collection IDs
9393

0 commit comments

Comments
 (0)