google / flatbuffers

FlatBuffers: Memory Efficient Serialization Library

Home Page:http://google.github.io/flatbuffers/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

flattests fails if out-of-source build directory is used

Tatsh opened this issue · comments

This is on Linux x86-64, 2.0.6 release. 2.0.0 does not have this issue.

cd flatbuffers
mkdir build
cmake -G Ninja ..
ninja
ninja test

Output:

0/1] Running tests...
Test project /home/tatsh/dev/flatbuffers/build
    Start 1: flattests
1/1 Test #1: flattests ........................Subprocess aborted***Exception:   0.05 sec

0% tests passed, 1 tests failed out of 1

Total Test time (real) =   0.05 sec

The following tests FAILED:
          1 - flattests (Subprocess aborted)
Errors while running CTest
Output from these tests are in: /home/tatsh/dev/flatbuffers/build/Testing/Temporary/LastTest.log
Use "--rerun-failed --output-on-failure" to re-run the failed cases verbosely.
FAILED: CMakeFiles/test.util
cd /home/tatsh/dev/flatbuffers/build && /usr/bin/ctest --force-new-ctest-process
ninja: build stopped: subcommand failed.

The paths that are set in various fields such as declaration_file are relative, and the tests are not expecting this.

EXPECTED: "//../../tests/monster_test.fbs"
VALUE: "//monster_test.fbs"
TEST FAILED: /home/tatsh/dev/flatbuffers/tests/test.cpp:932, 'root_table->declaration_file()->c_str()' != '"//monster_test.fbs"' in
flattests: /home/tatsh/dev/flatbuffers/tests/test_assert.cpp:24: void TestFail(const char*, const char*, const char*, const char*, int, const char*): Assertion `0' failed.
Aborted (core dumped)

https://github.com/google/flatbuffers/blob/master/tests/test.cpp#L952=

https://bugs.gentoo.org/842060

Yeah, our out-of-source build setup is not good at the moment. I would welcome any PRs to fix this.

ezoic increase your site revenue