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

flatbuffers failed to run tests on windows with MSVC #6838

Closed
YangYang129 opened this issue Sep 13, 2021 · 6 comments
Closed

flatbuffers failed to run tests on windows with MSVC #6838

YangYang129 opened this issue Sep 13, 2021 · 6 comments
Labels

Comments

@YangYang129
Copy link

YangYang129 commented Sep 13, 2021

Hi All,
flatbuffers failed to run tests on windows with MSVC, this issue can be reproduced on latest version 47d35f1, can you help look?

Reproduce steps:

  1. git clone https://github.com/google/flatbuffers
  2. cd flatbuffers
  3. mkdir build_amd64
  4. cd build_amd64
  5. cmake -G "Visual Studio 16 2019" -A x64 -DCMAKE_SYSTEM_VERSION=10.0.18362.0 -DCMAKE_BUILD_TYPE=Release ..
  6. msbuild /m /p:Configuration=Release;Platform=x64 FlatBuffers.sln
  7. ctest --build-config Release --output-on-failure

Test log:
run_test.log

Error info:
Test project E:/test0819/flatbuffers/build_amd64
Start 1: flattests
1/1 Test #1: flattests ........................***Failed 0.35 sec
EXPECTED: "//../../tests/monster_test.fbs"
VALUE: "//monster_test.fbs"
TEST FAILED: E:\test0819\flatbuffers\tests\test.cpp:934, 'root_table->declaration_file()->c_str()' != '"//monster_test.fbs"' in
EXPECTED: "//../../tests/include_test/include_test1.fbs"
VALUE: "//include_test/include_test1.fbs"
TEST FAILED: E:\test0819\flatbuffers\tests\test.cpp:937, 'schema.objects()->LookupByKey("TableA")->declaration_file()->c_str()' != '"//include_test/include_test1.fbs"' in
EXPECTED: "//../../tests/include_test/sub/include_test2.fbs"
VALUE: "//include_test/sub/include_test2.fbs"
TEST FAILED: E:\test0819\flatbuffers\tests\test.cpp:942, 'schema.objects() ->LookupByKey("MyGame.OtherNameSpace.Unused") ->declaration_file() ->c_str()' != '"//include_test/sub/include_test2.fbs"' in
EXPECTED: "//../../tests/include_test/sub/include_test2.fbs"
VALUE: "//include_test/sub/include_test2.fbs"
TEST FAILED: E:\test0819\flatbuffers\tests\test.cpp:947, 'schema.enums() ->LookupByKey("MyGame.OtherNameSpace.FromInclude") ->declaration_file() ->c_str()' != '"//include_test/sub/include_test2.fbs"' in
EXPECTED: "//../../tests/include_test/include_test1.fbs"
VALUE: "//include_test/include_test1.fbs"
TEST FAILED: E:\test0819\flatbuffers\tests\test.cpp:953, 'fbs0->filename()->c_str()' != '"//include_test/include_test1.fbs"' in
EXPECTED: "//../../tests/include_test/include_test1.fbs"
VALUE: "//include_test/include_test1.fbs"
TEST FAILED: E:\test0819\flatbuffers\tests\test.cpp:959, 'fbs0_includes->Get(0)->c_str()' != '"//include_test/include_test1.fbs"' in
EXPECTED: "//../../tests/include_test/sub/include_test2.fbs"
VALUE: "//include_test/sub/include_test2.fbs"
TEST FAILED: E:\test0819\flatbuffers\tests\test.cpp:961, 'fbs0_includes->Get(1)->c_str()' != '"//include_test/sub/include_test2.fbs"' in
EXPECTED: "//../../tests/include_test/sub/include_test2.fbs"
VALUE: "//include_test/sub/include_test2.fbs"
TEST FAILED: E:\test0819\flatbuffers\tests\test.cpp:965, 'fbs1->filename()->c_str()' != '"//include_test/sub/include_test2.fbs"' in
EXPECTED: "//../../tests/include_test/include_test1.fbs"
VALUE: "//include_test/include_test1.fbs"
TEST FAILED: E:\test0819\flatbuffers\tests\test.cpp:969, 'fbs1_includes->Get(0)->c_str()' != '"//include_test/include_test1.fbs"' in
EXPECTED: "//../../tests/include_test/sub/include_test2.fbs"
VALUE: "//include_test/sub/include_test2.fbs"
TEST FAILED: E:\test0819\flatbuffers\tests\test.cpp:971, 'fbs1_includes->Get(1)->c_str()' != '"//include_test/sub/include_test2.fbs"' in
EXPECTED: "//../../tests/monster_test.fbs"
VALUE: "//monster_test.fbs"
TEST FAILED: E:\test0819\flatbuffers\tests\test.cpp:974, 'fbs2->filename()->c_str()' != '"//monster_test.fbs"' in
EXPECTED: "//../../tests/include_test/include_test1.fbs"
VALUE: "//include_test/include_test1.fbs"
TEST FAILED: E:\test0819\flatbuffers\tests\test.cpp:978, 'fbs2_includes->Get(0)->c_str()' != '"//include_test/include_test1.fbs"' in
12 FAILED TESTS

0% tests passed, 1 tests failed out of 1

Total Test time (real) = 0.38 sec

The following tests FAILED:
1 - flattests (Failed)

@aardappel
Copy link
Collaborator

Looking at the failures, it must be a problem with the dir you're running from.. it's supposed to be run from the root of the repo.

If I do so, it works for me, both running flattests exe directly and thru ctest (didn't know that was a thing), with latest master, VS2019.

@YangYang129
Copy link
Author

YangYang129 commented Sep 14, 2021

@aardappel Thanks for your reply and info. According to your info, l have try change dir to root, run tests display "No tests were found!!!"

Reproduce steps:
E:\test0819\flatbuffers\build_amd64>cd ..
E:\test0819\flatbuffers>ctest --build-config Release --output-on-failure

Error info:
Test project E:/test0819/flatbuffers
No tests were found!!!

@aardappel
Copy link
Collaborator

well, no idea how your setup differs from mine then, since in my case it displays that all tests pass.

@github-actions
Copy link

This issue is stale because it has been open 6 months with no activity. Please comment or this will be closed in 14 days.

@enum-class
Copy link
Contributor

I had a same problem, and I solve the problem by running flattest from root of project,

C:\enum-class\flatbuffers> .\build_amd64\Release\flattests.exe

@enum-class
Copy link
Contributor

enum-class commented Nov 17, 2022

You can chane --bfbs-filenames in compile_flatbuffers_schema_to_binary function in CMakeLists.txt to
--bfbs-filenames "${CMAKE_CURRENT_SOURCE_DIR}/${SRC_FBS_DIR}" and then it will work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants