diff --git a/.github/workflows/makefile.yml b/.github/workflows/makefile.yml new file mode 100644 index 0000000..3c35836 --- /dev/null +++ b/.github/workflows/makefile.yml @@ -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 \ No newline at end of file diff --git a/.gitignore b/.gitignore index 567609b..2099193 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -build/ +/build/ +/lib/Catch2 \ No newline at end of file diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index ee1802e..0000000 --- a/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "lib/Catch"] - path = lib/Catch - url = https://github.com/philsquared/Catch.git diff --git a/Makefile b/Makefile index b1ad85a..e252670 100644 --- a/Makefile +++ b/Makefile @@ -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) @@ -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) diff --git a/lib/Catch b/lib/Catch deleted file mode 160000 index af8cd98..0000000 --- a/lib/Catch +++ /dev/null @@ -1 +0,0 @@ -Subproject commit af8cd98f20a05828c0101e0344a28cc2a2bf9dd3 diff --git a/test/test.cpp b/test/test.cpp index 834a66a..5795346 100644 --- a/test/test.cpp +++ b/test/test.cpp @@ -1,10 +1,12 @@ #include +#include #include -#include "sslpkix/sslpkix.h" +#include -#define CATCH_CONFIG_RUNNER -#include "catch.hpp" +#include "sslpkix/sslpkix.h" +#include +#include static int prime_generation_callback(int p, int n, BN_GENCB *arg) { (void)n;