From 4e396d47bc5200309977c0b8942e74415b3a812e Mon Sep 17 00:00:00 2001 From: engedy Date: Thu, 22 Dec 2022 17:48:48 +0100 Subject: [PATCH] Add CI step to build with -DFLATBUFFERS_NO_FILE_TESTS. (#7729) * Add CI step to build with -DFLATBUFFERS_NO_FILE_TESTS * Fix cmake syntax * Further fix cmake argumetns * Add workaround for unused-parameter. * Remove build matrix Co-authored-by: Derek Bailey --- .github/workflows/build.yml | 10 ++++++++++ tests/test.cpp | 3 +++ 2 files changed, 13 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 40a9e3ede..60832d128 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -62,6 +62,16 @@ jobs: if: matrix.cxx == 'g++-10' && startsWith(github.ref, 'refs/tags/') id: hash-gcc run: echo "::set-output name=hashes::$(sha256sum Linux.flatc.binary.${{ matrix.cxx }}.zip | base64 -w0)" + + build-linux-no-file-tests: + name: Build Linux with -DFLATBUFFERS_NO_FILE_TESTS + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: cmake + run: CXX=clang++-12 cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DFLATBUFFERS_STRICT_MODE=ON -DFLATBUFFERS_CXX_FLAGS="-DFLATBUFFERS_NO_FILE_TESTS" . + - name: build + run: make -j build-linux-cpp-std: name: Build Linux C++ diff --git a/tests/test.cpp b/tests/test.cpp index 96a076401..e13bc6ee2 100644 --- a/tests/test.cpp +++ b/tests/test.cpp @@ -1511,6 +1511,9 @@ int FlatBufferTests(const std::string &tests_data_path) { ParseIncorrectMonsterJsonTest(tests_data_path); FixedLengthArraySpanTest(tests_data_path); DoNotRequireEofTest(tests_data_path); +#else + // Guard against -Wunused-parameter. + (void)tests_data_path; #endif UtilConvertCase();