From d7c710edd55d14601861eb19785cdb79474ca223 Mon Sep 17 00:00:00 2001 From: Abit Date: Thu, 2 Jul 2020 10:38:59 +0200 Subject: [PATCH 1/4] Add macOS to Github Autobuild --- .github/workflows/build-and-test.yml | 49 ++++++++++++++++++++++++++-- 1 file changed, 47 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 7dfc44a..304b73d 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -5,7 +5,7 @@ env: CCACHE_SLOPPINESS: include_file_ctime,include_file_mtime,time_macros jobs: test-release: - name: Build and run tests in Release mode + name: Build and run tests in Ubuntu, Release mode runs-on: ubuntu-latest steps: - name: Install dependencies @@ -64,7 +64,7 @@ jobs: task_cancel_test _EOT_ test-debug: - name: Build and run tests in Debug mode + name: Build and run tests in Ubuntu, Debug mode runs-on: ubuntu-latest steps: - name: Install dependencies @@ -122,3 +122,48 @@ jobs: hmac_test task_cancel_test _EOT_ + test-macos: + name: Build and run tests in macOS + runs-on: macos-latest + steps: + - name: Install dependencies + run: | + brew install autoconf automake libtool + brew install ccache + brew search boost + brew install boost@1.60 + - uses: actions/checkout@v2 + with: + submodules: recursive + - name: Configure + run: | + mkdir -p _build + pushd _build + cmake -D CMAKE_BUILD_TYPE=Release \ + -D CMAKE_C_COMPILER_LAUNCHER=ccache \ + -D CMAKE_CXX_COMPILER_LAUNCHER=ccache \ + -D BOOST_ROOT=/usr/local/opt/boost@1.60 \ + -D OPENSSL_ROOT_DIR=/usr/local/opt/openssl \ + .. + - name: Load Cache + uses: actions/cache@v1 + with: + path: ccache + key: ccache-osx-${{ github.ref }}-${{ github.sha }} + restore-keys: | + ccache-osx-${{ github.ref }}- + ccache-osx- + - name: Build + run: | + export CCACHE_DIR="$GITHUB_WORKSPACE/ccache" + mkdir -p "$CCACHE_DIR" + make -j 2 -C _build + df -h + - name: Unit-Tests + run: | + pushd _build/tests + all_test -l message + bloom_test -- README.md + ecc_test README.md + hmac_test + task_cancel_test From 210e816897154ea59fb8386a37fa4fe5f2647781 Mon Sep 17 00:00:00 2001 From: Abit Date: Thu, 2 Jul 2020 10:50:11 +0200 Subject: [PATCH 2/4] Fix paths for macOS unit tests in github autobuild --- .github/workflows/build-and-test.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 304b73d..7f90c9d 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -145,6 +145,7 @@ jobs: -D BOOST_ROOT=/usr/local/opt/boost@1.60 \ -D OPENSSL_ROOT_DIR=/usr/local/opt/openssl \ .. + popd - name: Load Cache uses: actions/cache@v1 with: @@ -162,8 +163,8 @@ jobs: - name: Unit-Tests run: | pushd _build/tests - all_test -l message - bloom_test -- README.md - ecc_test README.md - hmac_test - task_cancel_test + ./all_tests -l message + ./bloom_test -- README.md + ./ecc_test README.md + ./hmac_test + ./task_cancel_test From 82e3944ff25ff62ba6d35d06ae303b0c9b2df4fa Mon Sep 17 00:00:00 2001 From: abitmore Date: Thu, 2 Jul 2020 08:47:45 -0400 Subject: [PATCH 3/4] Update time_test to get around a boost 1.60 issue --- tests/time_test.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/time_test.cpp b/tests/time_test.cpp index 4c45720..9d599eb 100644 --- a/tests/time_test.cpp +++ b/tests/time_test.cpp @@ -33,8 +33,10 @@ BOOST_AUTO_TEST_CASE(time_point_sec_test) BOOST_CHECK_EQUAL( "20380119T031407", tp2gm1.to_non_delimited_iso_string() ); time_point_sec tp2g(0x80000000U); - BOOST_CHECK_EQUAL( "2038-01-19T03:14:08", tp2g.to_iso_string() ); - BOOST_CHECK_EQUAL( "20380119T031408", tp2g.to_non_delimited_iso_string() ); + if (BOOST_VERSION != BOOST_VERSION_NUMBER(1,60,0)) { + BOOST_CHECK_EQUAL( "2038-01-19T03:14:08", tp2g.to_iso_string() ); + BOOST_CHECK_EQUAL( "20380119T031408", tp2g.to_non_delimited_iso_string() ); + } time_point_sec tp3g(0xc0000000U); if (BOOST_VERSION >= BOOST_VERSION_NUMBER(1,64,0)) { From 4ffc77f9d619a29c2c433e47c5f762826beca185 Mon Sep 17 00:00:00 2001 From: abitmore Date: Thu, 2 Jul 2020 09:18:11 -0400 Subject: [PATCH 4/4] Update boost version checks in time_test to macros --- tests/time_test.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/time_test.cpp b/tests/time_test.cpp index 9d599eb..5627b08 100644 --- a/tests/time_test.cpp +++ b/tests/time_test.cpp @@ -33,16 +33,16 @@ BOOST_AUTO_TEST_CASE(time_point_sec_test) BOOST_CHECK_EQUAL( "20380119T031407", tp2gm1.to_non_delimited_iso_string() ); time_point_sec tp2g(0x80000000U); - if (BOOST_VERSION != BOOST_VERSION_NUMBER(1,60,0)) { - BOOST_CHECK_EQUAL( "2038-01-19T03:14:08", tp2g.to_iso_string() ); - BOOST_CHECK_EQUAL( "20380119T031408", tp2g.to_non_delimited_iso_string() ); - } +#if BOOST_VERSION != 106000 + BOOST_CHECK_EQUAL( "2038-01-19T03:14:08", tp2g.to_iso_string() ); + BOOST_CHECK_EQUAL( "20380119T031408", tp2g.to_non_delimited_iso_string() ); +#endif time_point_sec tp3g(0xc0000000U); - if (BOOST_VERSION >= BOOST_VERSION_NUMBER(1,64,0)) { - BOOST_CHECK_EQUAL( "2072-01-28T16:51:12", tp3g.to_iso_string() ); - BOOST_CHECK_EQUAL( "20720128T165112", tp3g.to_non_delimited_iso_string() ); - } +#if BOOST_VERSION >= 106400 + BOOST_CHECK_EQUAL( "2072-01-28T16:51:12", tp3g.to_iso_string() ); + BOOST_CHECK_EQUAL( "20720128T165112", tp3g.to_non_delimited_iso_string() ); +#endif BOOST_CHECK( tp0 == time_point_sec() ); BOOST_CHECK( tp0 < tp1 );