From a736ad63dc824ef9ebcbceff7f0bc4765537492f Mon Sep 17 00:00:00 2001 From: Bart Date: Thu, 27 Mar 2025 10:49:09 -0400 Subject: [PATCH] refactor: Move integration tests from 'examples/' into 'tests/' (#5367) This change moves `examples/example` into `tests/conan` to make it clear it is an integration test, and adjusts the `conan` CI job accordingly --- .github/workflows/clang-format.yml | 2 +- tests/README.md | 4 ++++ {examples/example => tests/conan}/CMakeLists.txt | 0 {examples/example => tests/conan}/conanfile.py | 0 {examples/example => tests/conan}/src/example.cpp | 4 +++- 5 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 tests/README.md rename {examples/example => tests/conan}/CMakeLists.txt (100%) rename {examples/example => tests/conan}/conanfile.py (100%) rename {examples/example => tests/conan}/src/example.cpp (78%) diff --git a/.github/workflows/clang-format.yml b/.github/workflows/clang-format.yml index c17607612..8dc4586dc 100644 --- a/.github/workflows/clang-format.yml +++ b/.github/workflows/clang-format.yml @@ -20,7 +20,7 @@ jobs: sudo apt-get update sudo apt-get install clang-format-${CLANG_VERSION} - name: Format first-party sources - run: find include src -type f \( -name '*.cpp' -o -name '*.hpp' -o -name '*.h' -o -name '*.ipp' \) -not -path "src/magic/magic_enum.h" -exec clang-format-${CLANG_VERSION} -i {} + + run: find include src tests -type f \( -name '*.cpp' -o -name '*.hpp' -o -name '*.h' -o -name '*.ipp' \) -not -path "src/magic/magic_enum.h" -exec clang-format-${CLANG_VERSION} -i {} + - name: Check for differences id: assert run: | diff --git a/tests/README.md b/tests/README.md new file mode 100644 index 000000000..0306915b3 --- /dev/null +++ b/tests/README.md @@ -0,0 +1,4 @@ +# Integration tests +This directory contains integration tests for the project. These tests are run +against the `libxrpl` library or `rippled` binary to verify they are working as +expected. diff --git a/examples/example/CMakeLists.txt b/tests/conan/CMakeLists.txt similarity index 100% rename from examples/example/CMakeLists.txt rename to tests/conan/CMakeLists.txt diff --git a/examples/example/conanfile.py b/tests/conan/conanfile.py similarity index 100% rename from examples/example/conanfile.py rename to tests/conan/conanfile.py diff --git a/examples/example/src/example.cpp b/tests/conan/src/example.cpp similarity index 78% rename from examples/example/src/example.cpp rename to tests/conan/src/example.cpp index 8c3acdee0..41dcd6246 100644 --- a/examples/example/src/example.cpp +++ b/tests/conan/src/example.cpp @@ -2,7 +2,9 @@ #include -int main(int argc, char const** argv) { +int +main(int argc, char const** argv) +{ std::printf("%s\n", ripple::BuildInfo::getVersionString().c_str()); return 0; }