From c9a3269e29d06bd0a572f0d0c8bb072155c6bd20 Mon Sep 17 00:00:00 2001 From: lvntky Date: Sun, 11 Aug 2024 19:29:29 +0300 Subject: [PATCH] [build] added conan --- .github/workflows/ci.yml | 277 ++++++++++++++++++++++++------- CMakeLists.txt | 4 +- CMakePresets.json | 41 +++-- cmake/dev-mode.cmake | 2 +- cmake/install-config.cmake | 3 + test/.github/codecov.yml | 34 ---- test/CMakeLists.txt | 43 ----- test/run_tests.sh | 8 - test/source/cc_linkedlist_test.c | 20 --- test/source/cc_vector_test.c | 94 ----------- test/source/main_test.c | 3 - test/test_main.c | 0 12 files changed, 252 insertions(+), 277 deletions(-) delete mode 100644 test/.github/codecov.yml delete mode 100644 test/CMakeLists.txt delete mode 100755 test/run_tests.sh delete mode 100644 test/source/cc_linkedlist_test.c delete mode 100644 test/source/cc_vector_test.c delete mode 100644 test/source/main_test.c create mode 100644 test/test_main.c diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 330b949..1c8f8a2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,73 +1,226 @@ -name: CI +name: Continuous Integration -on: [push, pull_request] +on: + push: + branches: + - master + + pull_request: + branches: + - master jobs: - test: + lint: runs-on: ubuntu-22.04 steps: - - name: Checkout source - uses: actions/checkout@v4 - - - name: Install dependencies - run: | - sudo apt-get update -q - sudo apt-get install clang-tidy-14 cppcheck doxygen -y -q - sudo update-alternatives --install /usr/bin/clang-tidy clang-tidy /usr/bin/clang-tidy-14 140 - - - name: Download utest.h - run: | - mkdir -p test/source - curl -o test/source/utest.h https://raw.githubusercontent.com/sheredom/utest.h/master/utest.h - - - name: Build and Install Headers - run: | - mkdir -p build - cd build - cmake .. - cmake --build . --config Release - sudo cmake --install . --prefix /usr/local - cd .. - - - name: Build tests - run: | - cd test - mkdir -p build - cd build/ - cmake .. - cd .. - cmake --build build --config Release - - - name: Run Tests - run: | - cd test/build/ - ctest --output-on-failure -j 2 - + - uses: actions/checkout@v4 + + - uses: actions/setup-python@v5 + with: { python-version: "3.12" } + + - name: Install codespell + run: pip3 install codespell + + - name: Lint + run: cmake -D FORMAT_COMMAND=clang-format-14 -P cmake/lint.cmake + + - name: Spell check + if: always() + run: cmake -P cmake/spell.cmake + + coverage: + needs: [lint] + + runs-on: ubuntu-22.04 + + # To enable coverage, delete the last line from the conditional below and + # edit the "" placeholder to your GitHub name. + # If you do not wish to use codecov, then simply delete this job from the + # workflow. + if: github.repository_owner == '' + && false + + steps: + - uses: actions/checkout@v4 + + - name: Install LCov + run: sudo apt-get update -q + && sudo apt-get install lcov -q -y + + - name: Install Python + uses: actions/setup-python@v5 + with: { python-version: "3.12" } + + - name: Conan cache + uses: actions/cache@v4 + with: + path: conan_cache_save.tgz + key: conan-coverage-${{ hashFiles('conan*.[pl][yo]*') }} + + - name: Install dependencies + run: bash < .github/scripts/conan-ci-setup.sh + + - name: Configure + run: cmake --preset=ci-coverage + + - name: Build + run: cmake --build build/coverage -j 2 + + - name: Test + working-directory: build/coverage + run: ctest --output-on-failure --no-tests=error -j 2 + + - name: Process coverage info + run: cmake --build build/coverage -t coverage + + - name: Submit to codecov.io + uses: codecov/codecov-action@v4 + with: + file: build/coverage/coverage.info + token: ${{ secrets.CODECOV_TOKEN }} + + sanitize: + needs: [lint] + + runs-on: ubuntu-22.04 + + env: { CC: clang-14, CXX: clang++-14 } + + steps: + - uses: actions/checkout@v4 + + - name: Install Python + uses: actions/setup-python@v5 + with: { python-version: "3.12" } + + - name: Conan cache + uses: actions/cache@v4 + with: + path: conan_cache_save.tgz + key: conan-sanitize-${{ hashFiles('conan*.[pl][yo]*') }} + + - name: Install dependencies + run: bash < .github/scripts/conan-ci-setup.sh + + - name: Configure + run: cmake --preset=ci-sanitize + + - name: Build + run: cmake --build build/sanitize -j 2 + + - name: Test + working-directory: build/sanitize + env: + ASAN_OPTIONS: "strict_string_checks=1:\ + detect_stack_use_after_return=1:\ + check_initialization_order=1:\ + strict_init_order=1:\ + detect_leaks=1:\ + halt_on_error=1" + UBSAN_OPTIONS: "print_stacktrace=1:\ + halt_on_error=1" + run: ctest --output-on-failure --no-tests=error -j 2 + + test: + needs: [lint] + + strategy: + matrix: + os: [macos-14, ubuntu-22.04, windows-2022] + + runs-on: ${{ matrix.os }} + + steps: + - uses: actions/checkout@v4 + + - name: Install static analyzers + if: matrix.os == 'ubuntu-22.04' + run: >- + sudo apt-get install clang-tidy-14 cppcheck -y -q + + sudo update-alternatives --install + /usr/bin/clang-tidy clang-tidy + /usr/bin/clang-tidy-14 140 + + - name: Install Python + uses: actions/setup-python@v5 + with: { python-version: "3.12" } + + - name: Conan cache + uses: actions/cache@v4 + with: + path: conan_cache_save.tgz + key: conan-${{ matrix.os }}-${{ hashFiles('conan*.[pl][yo]*') }} + + - name: Install dependencies + shell: bash + run: bash < .github/scripts/conan-ci-setup.sh + + - name: Setup MultiToolTask + if: matrix.os == 'windows-2022' + run: | + Add-Content "$env:GITHUB_ENV" 'UseMultiToolTask=true' + Add-Content "$env:GITHUB_ENV" 'EnforceProcessCountAcrossBuilds=true' + + - name: Configure + shell: pwsh + run: cmake "--preset=ci-$("${{ matrix.os }}".split("-")[0])" + + - name: Build + run: cmake --build build --config Release -j 2 + + - name: Install + run: cmake --install build --config Release --prefix prefix + + - name: Test + working-directory: build + run: ctest --output-on-failure --no-tests=error -C Release -j 2 docs: + # Deploy docs only when builds succeed + needs: [sanitize, test] + runs-on: ubuntu-22.04 - needs: test + + # To enable, first you have to create an orphaned gh-pages branch: + # + # git switch --orphan gh-pages + # git commit --allow-empty -m "Initial commit" + # git push -u origin gh-pages + # + # Edit the placeholder below to your GitHub name, so this action + # runs only in your repository and no one else's fork. After these, delete + # this comment and the last line in the conditional below. + # If you do not wish to use GitHub Pages for deploying documentation, then + # simply delete this job similarly to the coverage one. + if: github.ref == 'refs/heads/master' + && github.event_name == 'push' + && github.repository_owner == '' + && false + + permissions: + contents: write steps: - - name: Checkout source - uses: actions/checkout@v4 - - - name: Install Doxygen - run: sudo apt-get install doxygen -y -q - - - name: Build documentation - run: | - cmake --preset=ci-linux - cmake --build build --target docs - - - name: Deploy documentation to branch - run: | - git config --global user.name 'github-actions' - git config --global user.email 'github-actions@github.com' - git checkout --orphan gh-pages - git rm -rf . - cp -r build/docs/html/* . - git add . - git commit -m "Deploy docs" - git push --force origin gh-pages + - uses: actions/checkout@v4 + + - uses: actions/setup-python@v5 + with: { python-version: "3.12" } + + - name: Install m.css dependencies + run: pip3 install jinja2 Pygments + + - name: Install Doxygen + run: sudo apt-get update -q + && sudo apt-get install doxygen -q -y + + - name: Build docs + run: cmake "-DPROJECT_SOURCE_DIR=$PWD" "-DPROJECT_BINARY_DIR=$PWD/build" + -P cmake/docs-ci.cmake + + - name: Deploy docs + uses: peaceiris/actions-gh-pages@v4 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: build/docs/html diff --git a/CMakeLists.txt b/CMakeLists.txt index cebd0a6..0b900dd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,7 +10,6 @@ project( LANGUAGES NONE ) - include(cmake/variables.cmake) # ---- Declare library ---- @@ -31,6 +30,9 @@ target_include_directories( target_compile_features(ccontainer_ccontainer INTERFACE c_std_99) +find_package(unity REQUIRED) +target_link_libraries(ccontainer_ccontainer INTERFACE json-c::json-c) + # ---- Install rules ---- if(NOT CMAKE_SKIP_INSTALL_RULES) diff --git a/CMakePresets.json b/CMakePresets.json index 8e2d4c6..0267aed 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -29,18 +29,27 @@ "ccontainer_DEVELOPER_MODE": "ON" } }, + { + "name": "conan", + "hidden": true, + "cacheVariables": { + "CMAKE_TOOLCHAIN_FILE": "${sourceDir}/conan/conan_toolchain.cmake" + } + }, { "name": "cppcheck", "hidden": true, "cacheVariables": { - "CMAKE_C_CPPCHECK": "cppcheck;--inline-suppr" + "CMAKE_C_CPPCHECK": "cppcheck;--inline-suppr", + "CMAKE_CXX_CPPCHECK": "cppcheck;--inline-suppr" } }, { "name": "clang-tidy", "hidden": true, "cacheVariables": { - "CMAKE_C_CLANG_TIDY": "clang-tidy;--header-filter=^${sourceDir}/" + "CMAKE_C_CLANG_TIDY": "clang-tidy;--header-filter=^${sourceDir}/", + "CMAKE_CXX_CLANG_TIDY": "clang-tidy;--header-filter=^${sourceDir}/" } }, { @@ -50,7 +59,10 @@ "cacheVariables": { "CMAKE_C_EXTENSIONS": "OFF", "CMAKE_C_STANDARD": "99", - "CMAKE_C_STANDARD_REQUIRED": "ON" + "CMAKE_C_STANDARD_REQUIRED": "ON", + "CMAKE_CXX_EXTENSIONS": "OFF", + "CMAKE_CXX_STANDARD": "11", + "CMAKE_CXX_STANDARD_REQUIRED": "ON" } }, { @@ -59,6 +71,7 @@ "hidden": true, "cacheVariables": { "CMAKE_C_FLAGS": "-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -fstack-protector-strong -fcf-protection=full -fstack-clash-protection -Wall -Wextra -Wpedantic -Wconversion -Wsign-conversion -Wcast-qual -Wformat=2 -Wundef -Werror=float-equal -Wshadow -Wcast-align -Wunused -Wnull-dereference -Wdouble-promotion -Wimplicit-fallthrough -Werror=strict-prototypes -Wwrite-strings", + "CMAKE_CXX_FLAGS": "-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -D_GLIBCXX_ASSERTIONS=1 -fstack-protector-strong -fcf-protection=full -fstack-clash-protection -Wall -Wextra -Wpedantic -Wconversion -Wsign-conversion -Wcast-qual -Wformat=2 -Wundef -Werror=float-equal -Wshadow -Wcast-align -Wunused -Wnull-dereference -Wdouble-promotion -Wimplicit-fallthrough -Wextra-semi -Woverloaded-virtual -Wnon-virtual-dtor -Wold-style-cast", "CMAKE_EXE_LINKER_FLAGS": "-Wl,--allow-shlib-undefined,--as-needed,-z,noexecstack,-z,relro,-z,now,-z,nodlopen", "CMAKE_SHARED_LINKER_FLAGS": "-Wl,--allow-shlib-undefined,--as-needed,-z,noexecstack,-z,relro,-z,now,-z,nodlopen" } @@ -67,7 +80,8 @@ "name": "flags-appleclang", "hidden": true, "cacheVariables": { - "CMAKE_C_FLAGS": "-fstack-protector-strong -Wall -Wextra -Wpedantic -Wconversion -Wsign-conversion -Wcast-qual -Wformat=2 -Wundef -Werror=float-equal -Wshadow -Wcast-align -Wunused -Wnull-dereference -Wdouble-promotion -Wimplicit-fallthrough -Werror=strict-prototypes -Wwrite-strings" + "CMAKE_C_FLAGS": "-fstack-protector-strong -Wall -Wextra -Wpedantic -Wconversion -Wsign-conversion -Wcast-qual -Wformat=2 -Wundef -Werror=float-equal -Wshadow -Wcast-align -Wunused -Wnull-dereference -Wdouble-promotion -Wimplicit-fallthrough -Werror=strict-prototypes -Wwrite-strings", + "CMAKE_CXX_FLAGS": "-fstack-protector-strong -Wall -Wextra -Wpedantic -Wconversion -Wsign-conversion -Wcast-qual -Wformat=2 -Wundef -Werror=float-equal -Wshadow -Wcast-align -Wunused -Wnull-dereference -Wdouble-promotion -Wimplicit-fallthrough -Wextra-semi -Woverloaded-virtual -Wnon-virtual-dtor -Wold-style-cast" } }, { @@ -76,6 +90,7 @@ "hidden": true, "cacheVariables": { "CMAKE_C_FLAGS": "/sdl /guard:cf /utf-8 /diagnostics:caret /w14165 /w44242 /w44254 /w34287 /w44296 /w44365 /w44388 /w44464 /w14545 /w14546 /w14547 /w14549 /w14555 /w34619 /w44774 /w44777 /w24826 /w14905 /w14906 /w14928 /W4 /permissive- /volatile:iso /Zc:inline /Zc:preprocessor", + "CMAKE_CXX_FLAGS": "/sdl /guard:cf /utf-8 /diagnostics:caret /w14165 /w44242 /w44254 /w44263 /w34265 /w34287 /w44296 /w44365 /w44388 /w44464 /w14545 /w14546 /w14547 /w14549 /w14555 /w34619 /w34640 /w24826 /w14905 /w14906 /w14928 /w45038 /W4 /permissive- /volatile:iso /Zc:inline /Zc:preprocessor /Zc:enumTypes /Zc:lambda /Zc:__cplusplus /Zc:externConstexpr /Zc:throwingNew /EHsc", "CMAKE_EXE_LINKER_FLAGS": "/machine:x64 /guard:cf" } }, @@ -110,13 +125,15 @@ "ENABLE_COVERAGE": "ON", "CMAKE_BUILD_TYPE": "Coverage", "CMAKE_C_FLAGS_COVERAGE": "-Og -g --coverage -fkeep-inline-functions -fkeep-static-functions", + "CMAKE_CXX_FLAGS_COVERAGE": "-Og -g --coverage -fkeep-inline-functions -fkeep-static-functions", "CMAKE_EXE_LINKER_FLAGS_COVERAGE": "--coverage", - "CMAKE_SHARED_LINKER_FLAGS_COVERAGE": "--coverage" + "CMAKE_SHARED_LINKER_FLAGS_COVERAGE": "--coverage", + "CMAKE_MAP_IMPORTED_CONFIG_COVERAGE": "Coverage;RelWithDebInfo;Release;Debug;" } }, { "name": "ci-coverage", - "inherits": ["coverage-linux", "dev-mode"], + "inherits": ["coverage-linux", "dev-mode", "conan"], "cacheVariables": { "COVERAGE_HTML_COMMAND": "" } @@ -124,10 +141,12 @@ { "name": "ci-sanitize", "binaryDir": "${sourceDir}/build/sanitize", - "inherits": ["ci-linux", "dev-mode"], + "inherits": ["ci-linux", "dev-mode", "conan"], "cacheVariables": { "CMAKE_BUILD_TYPE": "Sanitize", - "CMAKE_C_FLAGS_SANITIZE": "-U_FORTIFY_SOURCE -O2 -g -fsanitize=address,undefined -fno-omit-frame-pointer -fno-common" + "CMAKE_C_FLAGS_SANITIZE": "-U_FORTIFY_SOURCE -O2 -g -fsanitize=address,undefined -fno-omit-frame-pointer -fno-common", + "CMAKE_CXX_FLAGS_SANITIZE": "-U_FORTIFY_SOURCE -O2 -g -fsanitize=address,undefined -fno-omit-frame-pointer -fno-common", + "CMAKE_MAP_IMPORTED_CONFIG_SANITIZE": "Sanitize;RelWithDebInfo;Release;Debug;" } }, { @@ -145,15 +164,15 @@ }, { "name": "ci-macos", - "inherits": ["ci-build", "ci-darwin", "dev-mode", "ci-multi-config"] + "inherits": ["ci-build", "ci-darwin", "dev-mode", "ci-multi-config", "conan"] }, { "name": "ci-ubuntu", - "inherits": ["ci-build", "ci-linux", "clang-tidy", "cppcheck", "dev-mode"] + "inherits": ["ci-build", "ci-linux", "clang-tidy", "conan", "cppcheck", "dev-mode"] }, { "name": "ci-windows", - "inherits": ["ci-build", "ci-win64", "dev-mode", "ci-multi-config"] + "inherits": ["ci-build", "ci-win64", "dev-mode", "ci-multi-config", "conan"] } ] } diff --git a/cmake/dev-mode.cmake b/cmake/dev-mode.cmake index b2daee0..0011f5c 100644 --- a/cmake/dev-mode.cmake +++ b/cmake/dev-mode.cmake @@ -5,7 +5,7 @@ if(BUILD_TESTING) add_subdirectory(test) endif() -option(BUILD_MCSS_DOCS "Build documentation using Doxygen and m.css" ON) +option(BUILD_MCSS_DOCS "Build documentation using Doxygen and m.css" OFF) if(BUILD_MCSS_DOCS) include(cmake/docs.cmake) endif() diff --git a/cmake/install-config.cmake b/cmake/install-config.cmake index 8707d53..0289637 100644 --- a/cmake/install-config.cmake +++ b/cmake/install-config.cmake @@ -1 +1,4 @@ +include(CMakeFindDependencyMacro) +find_dependency(json-c) + include("${CMAKE_CURRENT_LIST_DIR}/ccontainerTargets.cmake") diff --git a/test/.github/codecov.yml b/test/.github/codecov.yml deleted file mode 100644 index 899a031..0000000 --- a/test/.github/codecov.yml +++ /dev/null @@ -1,34 +0,0 @@ -codecov: - notify: - require_ci_to_pass: yes - after_n_builds: 2 - -coverage: - precision: 2 - round: down - range: 70..100 - status: - project: - default: - threshold: 1% - patch: - default: - target: auto - -parsers: - gcov: - branch_detection: - conditional: yes - loop: yes - method: yes - macro: no - -ignore: - - "Testing/**" - - "build/**" - - "run_tests.sh" - -comment: - layout: "reach,diff,flags,files" - behavior: default - diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt deleted file mode 100644 index 277ceb6..0000000 --- a/test/CMakeLists.txt +++ /dev/null @@ -1,43 +0,0 @@ -cmake_minimum_required(VERSION 3.21) - -project(ccontainerTests LANGUAGES C) - -include(../cmake/folders.cmake) - -# ---- Dependencies ---- - -if(PROJECT_IS_TOP_LEVEL) - find_package(ccontainer REQUIRED) - enable_testing() -endif() - -# ---- Tests ---- - -# Create a list of test sources -set(TEST_SOURCES - source/main_test.c - source/cc_vector_test.c - source/cc_linkedlist_test.c -) - -# Add the test executable -add_executable(ccontainer_tests ${TEST_SOURCES}) - -# Ensure the implementation macro is defined -target_compile_definitions(ccontainer_tests PRIVATE CC_VECTOR_IMPLEMENTATION) - -# Include the downloaded utest.h -target_include_directories(ccontainer_tests PRIVATE ${CMAKE_BINARY_DIR}) - -# Link against the ccontainer library -target_link_libraries(ccontainer_tests PRIVATE ccontainer::ccontainer) - -# Ensure C99 standard -target_compile_features(ccontainer_tests PRIVATE c_std_99) - -# Add the test executable to CTest -add_test(NAME ccontainer_tests COMMAND ccontainer_tests) - -# ---- End-of-file commands ---- - -add_folders(Test) diff --git a/test/run_tests.sh b/test/run_tests.sh deleted file mode 100755 index 5721d21..0000000 --- a/test/run_tests.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -mkdir -p build -cd build/ -cmake .. -cd .. -cmake --build build --config Release -./build/ccontainer_tests diff --git a/test/source/cc_linkedlist_test.c b/test/source/cc_linkedlist_test.c deleted file mode 100644 index 1aa7cf8..0000000 --- a/test/source/cc_linkedlist_test.c +++ /dev/null @@ -1,20 +0,0 @@ -#define CC_LINKEDLIST_IMPLEMENTATION -#include "../../include/ccontainer/cc_linkedlist.h" -#include "utest.h" - -UTEST(cc_linkedlist, create_node) -{ - int data = 1; - cc_linkedlist_node_t *head = - cc_linkedlist_create_node(&data, sizeof(data)); - ASSERT_EQ(*(int *)head->data, data); -} - -UTEST(cc_linkedlist, size) -{ - int data = 1; - cc_linkedlist_node_t *head = - cc_linkedlist_create_node(&data, sizeof(data)); - - ASSERT_EQ(cc_linkedlist_size(head), 1); -} \ No newline at end of file diff --git a/test/source/cc_vector_test.c b/test/source/cc_vector_test.c deleted file mode 100644 index e9aadfa..0000000 --- a/test/source/cc_vector_test.c +++ /dev/null @@ -1,94 +0,0 @@ -#define CC_VECTOR_IMPLEMENTATIONs -#include "../../include/ccontainer/cc_vector.h" -#include "utest.h" - -UTEST(cc_vector, create) -{ - size_t initial_capacity = 10; - cc_vector_t *vector = cc_vector_create(initial_capacity); - - ASSERT_TRUE(vector != NULL); - ASSERT_EQ(vector->capacity, initial_capacity); - ASSERT_EQ(vector->size, 0); - ASSERT_TRUE(vector->data != NULL); - - free(vector->data); - free(vector); -} - -UTEST(cc_vector, at) -{ - cc_vector_t *vector = cc_vector_create(10); - cc_vector_push_back(vector, (void *)1); - void *data = cc_vector_at(vector, 0); - - ASSERT_TRUE(data != NULL); - cc_vector_free(vector); -} - -UTEST(cc_vector, push_back) -{ - cc_vector_t *vector = cc_vector_create(10); - int *value = (int *)malloc(sizeof(int)); - *value = 1; - cc_vector_push_back(vector, value); - - ASSERT_EQ(*(int *)cc_vector_at(vector, 0), 1); - - cc_vector_free(vector); -} - -UTEST(cc_vector, back) -{ - cc_vector_t *vector = cc_vector_create(5); - - cc_vector_push_back(vector, (void *)5); - ASSERT_EQ(cc_vector_back(vector), - (void *)5); // Dereference the pointer - - cc_vector_free(vector); -} - -UTEST(cc_vector, front) -{ - cc_vector_t *vector = cc_vector_create(1); - cc_vector_push_back(vector, (void *)5); - - ASSERT_EQ(cc_vector_front(vector), (void *)5); - - cc_vector_free(vector); -} - -UTEST(cc_vector, type_struct) -{ - cc_vector_t *vector = cc_vector_create(5); - - typedef struct test_str { - int key; - char *value; - } test_str_t; - - test_str_t test1 = { 1, "abc" }; - test_str_t test2 = { 2, "def" }; - test_str_t test3 = { 3, "ghi" }; - - cc_vector_push_back(vector, &test1); - cc_vector_push_back(vector, &test2); - cc_vector_push_back(vector, &test3); - - ASSERT_EQ(3, cc_vector_size(vector)); - - test_str_t *retrieved_test1 = (test_str_t *)cc_vector_at(vector, 0); - ASSERT_EQ(1, retrieved_test1->key); - ASSERT_STREQ("abc", retrieved_test1->value); - - test_str_t *retrieved_test2 = (test_str_t *)cc_vector_at(vector, 1); - ASSERT_EQ(2, retrieved_test2->key); - ASSERT_STREQ("def", retrieved_test2->value); - - test_str_t *retrieved_test3 = (test_str_t *)cc_vector_at(vector, 2); - ASSERT_EQ(3, retrieved_test3->key); - ASSERT_STREQ("ghi", retrieved_test3->value); - - cc_vector_free(vector); -} \ No newline at end of file diff --git a/test/source/main_test.c b/test/source/main_test.c deleted file mode 100644 index 30dad37..0000000 --- a/test/source/main_test.c +++ /dev/null @@ -1,3 +0,0 @@ -#include "utest.h" - -UTEST_MAIN() diff --git a/test/test_main.c b/test/test_main.c new file mode 100644 index 0000000..e69de29