diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 685f208..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,17 +0,0 @@ ---- -version: 2 -jobs: - build_and_test: - docker: - - image: rikorose/gcc-cmake:gcc-8 - steps: - - checkout - - run: cmake -DCMAKE_BUILD_TYPE=Debug -G "CodeBlocks - Unix Makefiles" . - - run: cmake --build . --target Containers -- -j 2 - - run: ./Containers - - run: bash <(curl -s https://codecov.io/bash) -workflows: - version: 2 - build_and_test: - jobs: - - build_and_test diff --git a/.codecov.yml b/.codecov.yml index cbaa513..99342ba 100644 --- a/.codecov.yml +++ b/.codecov.yml @@ -1,3 +1,2 @@ ---- ignore: - "tst" diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..ff68483 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,28 @@ +name: build +on: [push] +jobs: + debug: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - run: make test_debug + - run: ./ContainersTestDebug + optimized: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - run: make test_optimized + - run: ./ContainersTestOptimized + coverage: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - run: make test_coverage + - run: ./ContainersTestCoverage + - run: bash <(curl -s https://codecov.io/bash) + valgrind: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - run: sudo apt install -y valgrind + - run: make valgrind diff --git a/CMakeLists.txt b/CMakeLists.txt deleted file mode 100644 index 051713a..0000000 --- a/CMakeLists.txt +++ /dev/null @@ -1,24 +0,0 @@ -cmake_minimum_required(VERSION 3.5.1) -project(Containers C) - -set(CMAKE_C_STANDARD 90) - -set(CMAKE_C_FLAGS "-Wall -Wextra -Wpedantic -ldl -g -O0 -fprofile-arcs -ftest-coverage") - -add_executable(Containers tst/test.c tst/test.h - src/array.c src/include/array.h tst/array.c - src/vector.c src/include/vector.h tst/vector.c - src/deque.c src/include/deque.h tst/deque.c - src/forward_list.c src/include/forward_list.h tst/forward_list.c - src/list.c src/include/list.h tst/list.c - src/set.c src/include/set.h tst/set.c - src/map.c src/include/map.h tst/map.c - src/multiset.c src/include/multiset.h tst/multiset.c - src/multimap.c src/include/multimap.h tst/multimap.c - src/unordered_set.c src/include/unordered_set.h tst/unordered_set.c - src/unordered_map.c src/include/unordered_map.h tst/unordered_map.c - src/unordered_multiset.c src/include/unordered_multiset.h tst/unordered_multiset.c - src/unordered_multimap.c src/include/unordered_multimap.h tst/unordered_multimap.c - src/stack.c src/include/stack.h tst/stack.c - src/queue.c src/include/queue.h tst/queue.c - src/priority_queue.c src/include/priority_queue.h tst/priority_queue.c) diff --git a/Makefile b/Makefile index 7961c70..bcb032a 100644 --- a/Makefile +++ b/Makefile @@ -23,13 +23,16 @@ header: python3 compile_headers.py $(version) test_debug: - @clang src/*.c tst/*.c -Wall -Wextra -Wpedantic -Werror -O0 -o ContainersTestDebug + @gcc src/*.c tst/*.c -Wall -Wextra -Wpedantic -Werror -std=c89 -O0 -ldl -o ContainersTestDebug test_optimized: - @clang src/*.c tst/*.c -Wall -Wextra -Wpedantic -Werror -O3 -o ContainersTestOptimized + @gcc src/*.c tst/*.c -Wall -Wextra -Wpedantic -Werror -std=c89 -O3 -ldl -o ContainersTestOptimized test_coverage: - @clang src/*.c tst/*.c -Wall -Wextra -Wpedantic -ldl -g -O0 -fprofile-arcs -ftest-coverage -o ContainersTestCoverage + @gcc src/*.c tst/*.c -Wall -Wextra -Wpedantic -Werror -std=c89 -O0 -ldl -g -coverage -o ContainersTestCoverage valgrind: - @valgrind --leak-check=yes ./ContainersTestDebug + @sed -i 's/STUB_MALLOC 1/STUB_MALLOC 0/g' tst/test.h + @gcc src/*.c tst/*.c -Wall -Wextra -Wpedantic -Werror -std=c89 -O0 -o ContainersTestValgrind + @sed -i 's/STUB_MALLOC 0/STUB_MALLOC 1/g' tst/test.h + @valgrind --leak-check=full ./ContainersTestValgrind diff --git a/README.md b/README.md index 9029bc4..e24ef8d 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,6 @@ -[![CircleCI](https://circleci.com/gh/bkthomps/Containers/tree/master.svg?style=shield)](https://circleci.com/gh/bkthomps/Containers/tree/master) +[![GitHubBuild](https://github.com/bkthomps/Containers/workflows/build/badge.svg)](https://github.com/bkthomps/Containers) [![Documentation](https://codedocs.xyz/bkthomps/Containers.svg)](https://codedocs.xyz/bkthomps/Containers/) [![Codecov](https://codecov.io/gh/bkthomps/Containers/branch/master/graph/badge.svg)](https://codecov.io/gh/bkthomps/Containers) -[![CodeQuality](https://www.code-inspector.com/project/12167/score/svg?dummy=unused)](https://frontend.code-inspector.com/project/12167/dashboard) [![Language](https://img.shields.io/badge/language-C89+-orange.svg)](https://en.wikipedia.org/wiki/C_(programming_language)) [![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/bkthomps/Containers/blob/master/LICENSE) diff --git a/tst/array.c b/tst/test_array.c similarity index 100% rename from tst/array.c rename to tst/test_array.c diff --git a/tst/deque.c b/tst/test_deque.c similarity index 100% rename from tst/deque.c rename to tst/test_deque.c diff --git a/tst/forward_list.c b/tst/test_forward_list.c similarity index 100% rename from tst/forward_list.c rename to tst/test_forward_list.c diff --git a/tst/list.c b/tst/test_list.c similarity index 100% rename from tst/list.c rename to tst/test_list.c diff --git a/tst/map.c b/tst/test_map.c similarity index 100% rename from tst/map.c rename to tst/test_map.c diff --git a/tst/multimap.c b/tst/test_multimap.c similarity index 100% rename from tst/multimap.c rename to tst/test_multimap.c diff --git a/tst/multiset.c b/tst/test_multiset.c similarity index 100% rename from tst/multiset.c rename to tst/test_multiset.c diff --git a/tst/priority_queue.c b/tst/test_priority_queue.c similarity index 100% rename from tst/priority_queue.c rename to tst/test_priority_queue.c diff --git a/tst/queue.c b/tst/test_queue.c similarity index 100% rename from tst/queue.c rename to tst/test_queue.c diff --git a/tst/set.c b/tst/test_set.c similarity index 100% rename from tst/set.c rename to tst/test_set.c diff --git a/tst/stack.c b/tst/test_stack.c similarity index 100% rename from tst/stack.c rename to tst/test_stack.c diff --git a/tst/unordered_map.c b/tst/test_unordered_map.c similarity index 100% rename from tst/unordered_map.c rename to tst/test_unordered_map.c diff --git a/tst/unordered_multimap.c b/tst/test_unordered_multimap.c similarity index 100% rename from tst/unordered_multimap.c rename to tst/test_unordered_multimap.c diff --git a/tst/unordered_multiset.c b/tst/test_unordered_multiset.c similarity index 100% rename from tst/unordered_multiset.c rename to tst/test_unordered_multiset.c diff --git a/tst/unordered_set.c b/tst/test_unordered_set.c similarity index 100% rename from tst/unordered_set.c rename to tst/test_unordered_set.c diff --git a/tst/vector.c b/tst/test_vector.c similarity index 100% rename from tst/vector.c rename to tst/test_vector.c