mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-30 10:20:02 +00:00
enabled cpp17 tests in CI (#7524)
This commit is contained in:
8
.github/workflows/build.yml
vendored
8
.github/workflows/build.yml
vendored
@@ -82,10 +82,14 @@ jobs:
|
|||||||
CXX=${{ matrix.cxx }} cmake -G "Unix Makefiles"
|
CXX=${{ matrix.cxx }} cmake -G "Unix Makefiles"
|
||||||
-DCMAKE_BUILD_TYPE=Release -DFLATBUFFERS_STRICT_MODE=ON
|
-DCMAKE_BUILD_TYPE=Release -DFLATBUFFERS_STRICT_MODE=ON
|
||||||
-DFLATBUFFERS_CPP_STD=${{ matrix.std }}
|
-DFLATBUFFERS_CPP_STD=${{ matrix.std }}
|
||||||
|
-DFLATBUFFERS_BUILD_CPP17=${{ matrix.std >= 17 && 'On' || 'Off'}}
|
||||||
- name: build
|
- name: build
|
||||||
run: make -j
|
run: make -j
|
||||||
- name: test
|
- name: test
|
||||||
run: ./flattests
|
run: ./flattests
|
||||||
|
- name: test C++17
|
||||||
|
if: matrix.std >= 17
|
||||||
|
run: ./flattests_cpp17
|
||||||
|
|
||||||
build-windows-cpp-std:
|
build-windows-cpp-std:
|
||||||
name: Build Windows C++
|
name: Build Windows C++
|
||||||
@@ -103,10 +107,14 @@ jobs:
|
|||||||
cmake -G "Visual Studio 16 2019" -A x64 -DCMAKE_BUILD_TYPE=Release
|
cmake -G "Visual Studio 16 2019" -A x64 -DCMAKE_BUILD_TYPE=Release
|
||||||
-DFLATBUFFERS_STRICT_MODE=ON
|
-DFLATBUFFERS_STRICT_MODE=ON
|
||||||
-DFLATBUFFERS_CPP_STD=${{ matrix.std }}
|
-DFLATBUFFERS_CPP_STD=${{ matrix.std }}
|
||||||
|
-DFLATBUFFERS_BUILD_CPP17=${{ matrix.std >= 17 && 'On' || 'Off'}}
|
||||||
- name: build
|
- name: build
|
||||||
run: msbuild.exe FlatBuffers.sln /p:Configuration=Release /p:Platform=x64
|
run: msbuild.exe FlatBuffers.sln /p:Configuration=Release /p:Platform=x64
|
||||||
- name: test
|
- name: test
|
||||||
run: Release\flattests.exe
|
run: Release\flattests.exe
|
||||||
|
- name: test C++17
|
||||||
|
if: matrix.std >= 17
|
||||||
|
run: Release\flattests_cpp17.exe
|
||||||
|
|
||||||
build-windows:
|
build-windows:
|
||||||
permissions:
|
permissions:
|
||||||
|
|||||||
@@ -146,6 +146,8 @@ void StringifyAnyFlatbuffersTypeTest() {
|
|||||||
any_unique_type = 0
|
any_unique_type = 0
|
||||||
any_ambiguous_type = 0
|
any_ambiguous_type = 0
|
||||||
signed_enum = -1
|
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
|
// Call a generic function that has no specific knowledge of the flatbuffer we
|
||||||
@@ -251,7 +253,7 @@ int FlatBufferCpp17Tests() {
|
|||||||
StringifyAnyFlatbuffersTypeTest();
|
StringifyAnyFlatbuffersTypeTest();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
int main(int /*argc*/, const char * /*argv*/[]) {
|
int main(int /*argc*/, const char * /*argv*/[]) {
|
||||||
InitTestEngine();
|
InitTestEngine();
|
||||||
|
|||||||
Reference in New Issue
Block a user