Skip to content

Commit

Permalink
enabled cpp17 tests in CI (#7524)
Browse files Browse the repository at this point in the history
  • Loading branch information
dbaileychess committed Sep 11, 2022
1 parent 56e6022 commit c49aff4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
8 changes: 8 additions & 0 deletions .github/workflows/build.yml
Expand Up @@ -82,10 +82,14 @@ jobs:
CXX=${{ matrix.cxx }} cmake -G "Unix Makefiles"
-DCMAKE_BUILD_TYPE=Release -DFLATBUFFERS_STRICT_MODE=ON
-DFLATBUFFERS_CPP_STD=${{ matrix.std }}
-DFLATBUFFERS_BUILD_CPP17=${{ matrix.std >= 17 && 'On' || 'Off'}}
- name: build
run: make -j
- name: test
run: ./flattests
- name: test C++17
if: matrix.std >= 17
run: ./flattests_cpp17

build-windows-cpp-std:
name: Build Windows C++
Expand All @@ -103,10 +107,14 @@ jobs:
cmake -G "Visual Studio 16 2019" -A x64 -DCMAKE_BUILD_TYPE=Release
-DFLATBUFFERS_STRICT_MODE=ON
-DFLATBUFFERS_CPP_STD=${{ matrix.std }}
-DFLATBUFFERS_BUILD_CPP17=${{ matrix.std >= 17 && 'On' || 'Off'}}
- name: build
run: msbuild.exe FlatBuffers.sln /p:Configuration=Release /p:Platform=x64
- name: test
run: Release\flattests.exe
- name: test C++17
if: matrix.std >= 17
run: Release\flattests_cpp17.exe

build-windows:
permissions:
Expand Down
4 changes: 3 additions & 1 deletion tests/cpp17/test_cpp17.cpp
Expand Up @@ -146,6 +146,8 @@ void StringifyAnyFlatbuffersTypeTest() {
any_unique_type = 0
any_ambiguous_type = 0
signed_enum = -1
long_enum_non_enum_default = 0
long_enum_normal_default = 2
})";

// Call a generic function that has no specific knowledge of the flatbuffer we
Expand Down Expand Up @@ -251,7 +253,7 @@ int FlatBufferCpp17Tests() {
StringifyAnyFlatbuffersTypeTest();
return 0;
}
} // namespace
} // namespace

int main(int /*argc*/, const char * /*argv*/[]) {
InitTestEngine();
Expand Down

0 comments on commit c49aff4

Please sign in to comment.