Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enabled cpp17 tests in CI #7524

Merged
merged 1 commit into from Sep 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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