Skip to content

Commit

Permalink
Introduce GitHub workflow and update to Catch2
Browse files Browse the repository at this point in the history
  • Loading branch information
jweyrich committed Mar 10, 2024
1 parent 34d9fd4 commit b3d9058
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 12 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/makefile.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: C/C++ CI

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
# - name: configure
# run: ./configure
- name: Install Catch2
run: |
git clone --depth 1 --branch v3.5.3 --single-branch https://github.com/catchorg/Catch2.git lib/Catch2
cd lib/Catch2
cmake -Bbuild -H. -DBUILD_TESTING=OFF
DESTDIR=installdir cmake --build build/ --target install
- name: make
run: make
# - name: make check
# run: make check
# - name: make distcheck
# run: make distcheck
- name: run unit tests
run: |
cd build
LD_LIBRARY_PATH=. ./run_tests
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
build/
/build/
/lib/Catch2
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ endif
DEST = $(DESTDIR)$(libdir)
INCPATH = -Iinclude
override LFLAGS += -lssl -lcrypto
override CFLAGS += -pipe -O0 -g3 -Wall -Wextra -pedantic -fmessage-length=0 -std=c99
override CXXFLAGS += -pipe -O0 -g3 -Wall -Wextra -pedantic -fmessage-length=0 -std=c++11
override CFLAGS += -pipe -O0 -g3 -Wall -Wextra -pedantic -fmessage-length=0 -std=c11
override CXXFLAGS += -pipe -O0 -g3 -Wall -Wextra -pedantic -fmessage-length=0 -std=c++14
override CPPFLAGS += -DDEBUG

ifeq ($(PLATFORM_OS), Darwin)
Expand Down Expand Up @@ -84,8 +84,8 @@ test_OBJS = $(addprefix ${libsslpkix_BUILDDIR}/, $(addsuffix .o, $(basename ${te
all: libsslpkix test

test: libsslpkix
test: INCPATH += -Ilib/Catch/include
test: LFLAGS += -L$(libsslpkix_BUILDDIR) -lsslpkix
test: INCPATH += -Ilib/Catch2/build/installdir/usr/local/include
test: LFLAGS += -L$(libsslpkix_BUILDDIR) -lsslpkix lib/Catch2/build/installdir/usr/local/lib/libCatch2.a
test: $(test_OBJS)
@echo 'Building test binary: $(libsslpkix_BUILDDIR)/$(TESTNAME)'
$(LINK) -o $(libsslpkix_BUILDDIR)/$(TESTNAME) $(test_OBJS) $(LFLAGS)
Expand Down
1 change: 0 additions & 1 deletion lib/Catch
Submodule Catch deleted from af8cd9
8 changes: 5 additions & 3 deletions test/test.cpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
#include <cstdlib>
#include <fstream>
#include <iostream>
#include "sslpkix/sslpkix.h"
#include <sstream>

#define CATCH_CONFIG_RUNNER
#include "catch.hpp"
#include "sslpkix/sslpkix.h"

#include <catch2/catch_session.hpp>
#include <catch2/catch_test_macros.hpp>

static int prime_generation_callback(int p, int n, BN_GENCB *arg) {
(void)n;
Expand Down

0 comments on commit b3d9058

Please sign in to comment.