Skip to content

Rename Project to Errors C++ #53

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Nov 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
File renamed without changes.
35 changes: 10 additions & 25 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,91 +8,76 @@ on:
jobs:
debug:
runs-on: ubuntu-latest
strategy:
matrix:
package: [error]
steps:
- name: Checkout repository
uses: actions/checkout@v4.1.1

- name: Configure CMake
run: |
cmake ${{ matrix.package }} \
-B ${{ matrix.package }}/build \
cmake . \
-B build \
-D BUILD_TESTING=ON \
-D CHECK_FORMAT=ON \
-D CHECK_WARNING=ON \
-D CHECK_COVERAGE=ON

- name: Build project
run: cmake --build ${{ matrix.package }}/build
run: cmake --build build

- name: Run unit tests
run: ctest --test-dir ${{ matrix.package }}/build --output-on-failure --no-tests=error
run: ctest --test-dir build --output-on-failure --no-tests=error

- name: Check code coverage
uses: threeal/gcovr-action@main
with:
root: ${{ matrix.package }}
excludes: |
${{ matrix.package }}/build/*
${{ matrix.package }}/test/*
build/*
test/*
fail-under-line: 100

- name: Check diff
run: git diff --exit-code HEAD

debug-msvc:
runs-on: windows-latest
strategy:
matrix:
package: [error]
steps:
- name: Checkout repository
uses: actions/checkout@v4.1.1

- name: Configure CMake
run: |
cmake ${{ matrix.package }} `
-B ${{ matrix.package }}/build `
cmake . `
-B build `
-D CMAKE_CXX_COMPILER=cl `
-D BUILD_TESTING=ON `
-D CHECK_WARNING=ON

- name: Build project
run: cmake --build ${{ matrix.package }}/build
run: cmake --build build

- name: Run unit tests
run: ctest --test-dir ${{ matrix.package }}/build --output-on-failure --no-tests=error
run: ctest --test-dir build --output-on-failure --no-tests=error

release:
runs-on: ubuntu-latest
strategy:
matrix:
package: [error]
steps:
- name: Checkout repository
uses: actions/checkout@v4.1.1

- name: Configure and build project
uses: threeal/cmake-action@v1.3.0
with:
source-dir: ${{ matrix.package }}
run-build: true

release-msvc:
runs-on: windows-latest
strategy:
matrix:
package: [error]
steps:
- name: Checkout repository
uses: actions/checkout@v4.1.1

- name: Configure and build project
uses: threeal/cmake-action@v1.3.0
with:
source-dir: ${{ matrix.package }}
cxx-compiler: cl
run-build: true

Expand Down
20 changes: 10 additions & 10 deletions error/CMakeLists.txt → CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
cmake_minimum_required(VERSION 3.0)

project(error)
project(errors)

# Import dependencies
include(cmake/CPM.cmake)
cpmaddpackage("gh:fmtlib/fmt#10.0.0")

# Build the main library
add_library(error src/error.cpp)
target_include_directories(error PUBLIC include)
target_link_libraries(error PUBLIC fmt)
target_compile_features(error PRIVATE cxx_std_20)
add_library(errors src/error.cpp)
target_include_directories(errors PUBLIC include)
target_link_libraries(errors PUBLIC fmt)
target_compile_features(errors PRIVATE cxx_std_20)

# Check if this project is the main project
if(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
Expand All @@ -22,7 +22,7 @@ if(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
# Import Format.cmake to format source code
if(CHECK_FORMAT)
cpmaddpackage("gh:threeal/Format.cmake#auto-install-cmake-format")
add_dependencies(error fix-format)
add_dependencies(errors fix-format)
endif()

if(BUILD_TESTING)
Expand All @@ -33,9 +33,9 @@ if(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
include("${Catch2_SOURCE_DIR}/extras/Catch.cmake")

# Build tests for the main library
add_executable(error_test test/error_test.cpp)
target_link_libraries(error_test PRIVATE error Catch2::Catch2WithMain)
catch_discover_tests(error_test)
add_executable(errors_test test/error_test.cpp)
target_link_libraries(errors_test PRIVATE errors Catch2::Catch2WithMain)
catch_discover_tests(errors_test)
endif()

# Get all targets in this directory
Expand All @@ -61,6 +61,6 @@ if(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
# Build XML documentation
if(BUILD_DOCS)
include(cmake/add_xml_docs.cmake)
add_xml_docs(docs include/error/error.hpp)
add_xml_docs(docs include/errors/error.hpp)
endif()
endif()
12 changes: 4 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
# Overview
# Error C++

[![build status](https://img.shields.io/github/actions/workflow/status/threeal/cpp/build.yml?branch=main)](https://github.com/threeal/cpp/actions/workflows/build.yml)
[![deploy status](https://img.shields.io/github/actions/workflow/status/threeal/cpp/deploy.yaml?branch=main&label=deploy)](https://github.com/threeal/cpp/actions/workflows/deploy.yaml)
[![build status](https://img.shields.io/github/actions/workflow/status/threeal/errors-cpp/build.yml?branch=main)](https://github.com/threeal/errors-cpp/actions/workflows/build.yml)
[![deploy status](https://img.shields.io/github/actions/workflow/status/threeal/errors-cpp/deploy.yaml?branch=main&label=deploy)](https://github.com/threeal/errors-cpp/actions/workflows/deploy.yaml)

A comprehensive collection of [C++](https://isocpp.org/) utility packages.

## Packages

- [Error](./error) [WIP]: Provides utilities for error handling.
A C++ package that provides utilities for error handling.

## License

Expand Down
File renamed without changes.
File renamed without changes.
10 changes: 5 additions & 5 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import os, subprocess

project = 'cpp'
project = 'Errors C++'
copyright = '2023, Alfi Maulana'
author = 'Alfi Maulana'

extensions = ['breathe']

subprocess.call('cmake ../error -B ../error/build -D BUILD_DOCS=ON', shell=True)
subprocess.call('cmake --build ../error/build --target docs', shell=True)
subprocess.call('cmake .. -B ../build -D BUILD_DOCS=ON', shell=True)
subprocess.call('cmake --build ../build --target docs', shell=True)

breathe_projects = {"error": "../error/build/docs"}
breathe_default_project = "error"
breathe_projects = {"errors": "../build/docs"}
breathe_default_project = "errors"

html_theme = 'furo'
html_static_path = ['_static']
54 changes: 0 additions & 54 deletions docs/error/index.rst

This file was deleted.

16 changes: 9 additions & 7 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
Overview
========
Errors C++
=============

A comprehensive collection of `C++`_ utility packages.
A `C++`_ package that provides utilities for error handling.

.. _C++: https://isocpp.org

Packages
API Docs
--------

.. toctree::
:maxdepth: 1
.. doxygenfunction:: error::make

error/index.rst
.. doxygenfunction:: error::format

.. doxygenstruct:: error::Error
:members:

License
-------
Expand Down
21 changes: 0 additions & 21 deletions error/LICENSE

This file was deleted.

9 changes: 0 additions & 9 deletions error/README.md

This file was deleted.

File renamed without changes.
2 changes: 1 addition & 1 deletion error/src/error.cpp → src/error.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <error/error.hpp>
#include <errors/error.hpp>

namespace error {

Expand Down
2 changes: 1 addition & 1 deletion error/test/error_test.cpp → test/error_test.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include <fmt/core.h>

#include <catch2/catch_test_macros.hpp>
#include <error/error.hpp>
#include <errors/error.hpp>
#include <sstream>
#include <string>

Expand Down