Skip to content

Commit

Permalink
Enable tests for gazebosim#202 on macOS with Xcode 12+, add catalina …
Browse files Browse the repository at this point in the history
…workflow (gazebosim#414)

Signed-off-by: Steve Peters <scpeters@openrobotics.org>
  • Loading branch information
scpeters committed Nov 10, 2020
1 parent f9c31c9 commit 0e77816
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 8 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: macOS latest

on: [push, pull_request]

jobs:
build:

env:
PACKAGE: sdformat8
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: Set up Homebrew
id: set-up-homebrew
uses: Homebrew/actions/setup-homebrew@master
- run: brew config

- name: Install base dependencies
run: |
brew tap osrf/simulation;
brew install --only-dependencies ${PACKAGE};
- run: mkdir build
- name: cmake
working-directory: build
run: cmake .. -DCMAKE_INSTALL_PREFIX=/usr/local/Cellar/${PACKAGE}/HEAD
- run: make
working-directory: build
- run: make test
working-directory: build
env:
CTEST_OUTPUT_ON_FAILURE: 1
- name: make install
working-directory: build
run: |
make install;
brew link ${PACKAGE};
- name: Compile example code
working-directory: examples
run: |
mkdir build;
cd build;
cmake ..;
make;
./simple ../simple.sdf;
16 changes: 8 additions & 8 deletions src/SDF_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,9 @@ TEST(SDF, UpdateElement)
staticParam->Get(flagCheck);
EXPECT_EQ(flagCheck, fixture.flag);
poseParam->Get(poseCheck);
// test fails on homebrew see issue 202
// test fails on homebrew with Xcode 11 and earlier, see issue 202
// https://github.com/osrf/sdformat/issues/202
#ifndef __APPLE__
#if !(defined(__APPLE__) && defined(__clang_major__) && __clang_major__ < 12)
EXPECT_EQ(poseCheck, fixture.pose);
#endif
}
Expand Down Expand Up @@ -419,9 +419,9 @@ TEST(SDF, GetAny)
}
catch(std::bad_any_cast &/*_e*/)
{
// test fails on homebrew see issue 202
// test fails on homebrew with Xcode 11 and earlier, see issue 202
// https://github.com/osrf/sdformat/issues/202
#ifndef __APPLE__
#if !(defined(__APPLE__) && defined(__clang_major__) && __clang_major__ < 12)
FAIL();
#endif
}
Expand All @@ -437,9 +437,9 @@ TEST(SDF, GetAny)
}
catch(std::bad_any_cast &/*_e*/)
{
// test fails on homebrew see issue 202
// test fails on homebrew with Xcode 11 and earlier, see issue 202
// https://github.com/osrf/sdformat/issues/202
#ifndef __APPLE__
#if !(defined(__APPLE__) && defined(__clang_major__) && __clang_major__ < 12)
FAIL();
#endif
}
Expand Down Expand Up @@ -481,9 +481,9 @@ TEST(SDF, GetAny)
}
catch(std::bad_any_cast &/*_e*/)
{
// test fails on homebrew see issue 202
// test fails on homebrew with Xcode 11 and earlier, see issue 202
// https://github.com/osrf/sdformat/issues/202
#ifndef __APPLE__
#if !(defined(__APPLE__) && defined(__clang_major__) && __clang_major__ < 12)
FAIL();
#endif
}
Expand Down

0 comments on commit 0e77816

Please sign in to comment.