Skip to content
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
33 changes: 0 additions & 33 deletions .circleci/config.yml

This file was deleted.

10 changes: 10 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: 2
updates:
# Maintain dependencies for GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
labels:
- "dependencies"
- "github-actions"
40 changes: 40 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: CI

on:
push:
branches:
- master
- 'release/*'
pull_request:
branches:
- master
workflow_dispatch:

jobs:
test:
runs-on: ubuntu-latest
permissions:
contents: read
strategy:
matrix:
build_type: [Debug, Release]

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive

- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y cmake g++ make

- name: Configure CMake
run: cmake -B build -DCMAKE_BUILD_TYPE=${{ matrix.build_type }}

- name: Build
run: cmake --build build

- name: Run tests
run: ./build/test/testmain
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,9 @@
*.app

/cmake-build-*/
/build-*/
/build/
/_codeql_build_dir/
/_codeql_detected_source_root
/.idea/
/test/catch.hpp
7 changes: 0 additions & 7 deletions .ycm_extra_conf.py

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![Build Status](https://circleci.com/gh/tschijnmo/fbitset.svg?style=shield)](https://circleci.com/gh/tschijnmo/fbitset)
[![CI](https://github.com/DrudgeCAS/fbitset/workflows/CI/badge.svg)](https://github.com/DrudgeCAS/fbitset/actions)

# fbitset
A highly optimized and tunable C++ bitset library
Expand Down
20 changes: 12 additions & 8 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
# Download the Catch2 single header.
# Fetch Catch2 v3 using FetchContent
# To update Catch2, change the GIT_TAG to the desired version
# Check releases at: https://github.com/catchorg/Catch2/releases
include(FetchContent)

file(DOWNLOAD
"https://github.com/catchorg/Catch2/releases/download/v2.0.1/catch.hpp"
"${CMAKE_CURRENT_BINARY_DIR}/catch.hpp"
)
FetchContent_Declare(
Catch2
GIT_REPOSITORY https://github.com/catchorg/Catch2.git
GIT_TAG v3.11.0 # renovate: datasource=github-releases depName=catchorg/Catch2
)

FetchContent_MakeAvailable(Catch2)


# The main test driver.
Expand All @@ -12,9 +18,7 @@ add_executable(testmain
basic.cpp
)

target_include_directories(testmain
PRIVATE ${CMAKE_CURRENT_BINARY_DIR}
)
target_link_libraries(testmain PRIVATE Catch2::Catch2)

# Tests supposed to crash with assertion failure.
add_executable(crash_no_ext crash_no_ext.cpp)
Expand Down
13 changes: 11 additions & 2 deletions test/basic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,20 @@
#include <type_traits>
#include <utility>
#include <vector>

#include <catch.hpp>
#include <ostream>

#include <fbitset.hpp>

// Provide stream operator for Fbitset to prevent Catch2 from trying to treat it as a range
namespace fbitset {
template<Size N, typename Int, typename Cont>
std::ostream& operator<<(std::ostream& os, const Fbitset<N, Int, Cont>& bs) {
return os << "{Fbitset}";
}
}

#include <catch2/catch_test_macros.hpp>

using namespace fbitset;

TEST_CASE("Fbitset has basic behaviour")
Expand Down
3 changes: 1 addition & 2 deletions test/testmain.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#define CATCH_CONFIG_RUNNER
#include <catch.hpp>
#include <catch2/catch_session.hpp>

int main(int argc, char* argv[])
{
Expand Down