Page MenuHomeWildfire Games

[WIP] Add a with-system-cxxtest
Needs ReviewPublic

Authored by Stan on Nov 19 2020, 1:50 AM.

Details

Reviewers
fabio
Trac Tickets
#5792
Summary

See ticket

Test Plan

Test on linux. Install cxxtest and make sure the game builds with normal and the jenkins-test flag

Unit TestsFailed

TimeTest
0 msJenkins > cxxtest_debug.xml::[failed-to-read]
Failed to read test report file E:\Jenkins\workspace\vs2015-differential\cxxtest_debug.xml org.dom4j.DocumentException: Error on line 347 of document : Content is not allowed in trailing section. at org.dom4j.io.SAXReader.read(SAXReader.java:511)
0 msJenkins > TestAllocators::Debug Build & Tests / test_da
0 msJenkins > TestAllocators::Release Build & Tests / test_da
0 msJenkins > TestAllocators::test_da
0 msJenkins > TestAllocators::test_da
View Full Test Results (1 Failed · 1,699 Passed)

Event Timeline

Stan created this revision.Nov 19 2020, 1:50 AM

Build failure - The Moirai have given mortals hearts that can endure.

builderr-debug-macos.txt
fatal error: file '/Users/wfg/Jenkins/workspace/macos-differential/build/workspaces/gcc/../../../libraries/source/spidermonkey/include-unix-debug/mozilla/MacroArgs.h' has been modified since the precompiled header 'obj/atlas_Debug/precompiled.h.gch' was built
fatal error: fatal error: file '/Users/wfg/Jenkins/workspace/macos-differential/build/workspaces/gcc/../../../libraries/source/spidermonkey/include-unix-debug/mozilla/MacroArgs.h' has been modified since the precompiled header 'obj/atlas_Debug/precompiled.h.gch' was built
fatal errorfile '/Users/wfg/Jenkins/workspace/macos-differential/build/workspaces/gcc/../../../libraries/source/spidermonkey/include-unix-debug/mozilla/MacroArgs.h' has been modified since the precompiled header 'obj/atlas_Debug/precompiled.h.gch' was built
: file '/Users/wfg/Jenkins/workspace/macos-differential/build/workspaces/gcc/../../../libraries/source/spidermonkey/include-unix-debug/mozilla/MacroArgs.h' has been modified since the precompiled header 'obj/atlas_Debug/precompiled.h.gch' was built
1 error generated.
1 error generated.
1 error generated.
1 error generated.
make[1]: *** [obj/atlas_Debug/CameraCtrlHandlers.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: *** [obj/atlas_Debug/GameLoop.o] Error 1
make[1]: *** [obj/atlas_Debug/ActorViewer.o] Error 1
make[1]: *** [obj/atlas_Debug/Brushes.o] Error 1
make: *** [atlas] Error 2

Link to build: https://jenkins.wildfiregames.com/job/macos-differential/1983/display/redirect

Stan updated this revision to Diff 14037.Nov 19 2020, 1:52 AM

Fix path

Build failure - The Moirai have given mortals hearts that can endure.

builderr-debug-macos.txt
fatal error: file '/Users/wfg/Jenkins/workspace/macos-differential/build/workspaces/gcc/../../../libraries/source/spidermonkey/include-unix-debug/mozilla/MacroArgs.h' has been modified since the precompiled header 'obj/atlas_Debug/precompiled.h.gch' was built
fatal error: file '/Users/wfg/Jenkins/workspace/macos-differential/build/workspaces/gcc/../../../libraries/source/spidermonkey/include-unix-debug/mozilla/MacroArgs.h' has been modified since the precompiled header 'obj/atlas_Debug/precompiled.h.gch' was built
fatal error: file '/Users/wfg/Jenkins/workspace/macos-differential/build/workspaces/gcc/../../../libraries/source/spidermonkey/include-unix-debug/mozilla/MacroArgs.h' has been modified since the precompiled header 'obj/atlas_Debug/precompiled.h.gch' was built
fatal error: file '/Users/wfg/Jenkins/workspace/macos-differential/build/workspaces/gcc/../../../libraries/source/spidermonkey/include-unix-debug/mozilla/MacroArgs.h' has been modified since the precompiled header 'obj/atlas_Debug/precompiled.h.gch' was built
1 error generated.
1 error generated.
make[1]: *** [obj/atlas_Debug/Brushes.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: *** [obj/atlas_Debug/CameraCtrlHandlers.o] Error 1
1 error generated.
make[1]: *** [obj/atlas_Debug/ActorViewer.o] Error 1
1 error generated.
make[1]: *** [obj/atlas_Debug/GameLoop.o] Error 1
make: *** [atlas] Error 2

Link to build: https://jenkins.wildfiregames.com/job/macos-differential/1984/display/redirect

Stan requested review of this revision.Nov 19 2020, 2:02 AM
mammadori added inline comments.
build/premake/extern_libs5.lua
224

It should be sufficient to remove this "else" statement, "cxxtest" is in the standard include "/usr/include" path.

Stan updated this revision to Diff 14169.Nov 24 2020, 12:19 AM

Remove package config call as the files are in the right directory

Stan added a subscriber: s0600204.EditedNov 24 2020, 12:23 AM

As noted in the log above this segfaults. maybe @fabio or @s0600204 have some idea.

This one is a weird one

ERROR: JavaScript error: simulation/components/BuildRestrictions.js line 317
markForTranslationWithContext is not defined
  @simulation/components/BuildRestrictions.js:317:1

Segfault is probably caused by

ERROR: Net server: enet_host_create failed

Would be interesting to know what we patched.

 user@user-Surface-Pro-2  ~/0ad  /usr/bin/cxxtestgen --version
This is CxxTest version 4.4.

Successful build - Chance fights ever on the side of the prudent.

builderr-debug-macos.txt
ld: warning: direct access in function 'RLMgCallback(mg_event, mg_connection*, mg_request_info const*)' from file 'obj/pyrogenesis_Debug/main.o' to global weak symbol 'std::__1::char_traits<char>::eq(char, char)' from file '../../../libraries/osx/gloox/lib/libgloox.a(clientbase.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'RLMgCallback(mg_event, mg_connection*, mg_request_info const*)' from file 'obj/pyrogenesis_Debug/main.o' to global weak symbol 'std::__1::char_traits<char>::eq(char, char)' from file '../../../libraries/osx/gloox/lib/libgloox.a(clientbase.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'tinygettext::POParser::parse()' from file '../../../binaries/system/libtinygettext_dbg.a(po_parser.o)' to global weak symbol 'std::__1::char_traits<char>::eq(char, char)' from file '../../../libraries/osx/gloox/lib/libgloox.a(clientbase.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'JSI_Network::StartNetworkJoin(ScriptInterface::CmptPrivate*, CStrW const&, CStr8 const&, unsigned short, bool, CStr8 const&)' from file '../../../binaries/system/libengine_dbg.a(JSInterface_Network.o)' to global weak symbol 'std::__1::char_traits<char>::eq(char, char)' from file '../../../libraries/osx/gloox/lib/libgloox.a(clientbase.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'CStr8::Find(CStr8 const&) const' from file '../../../binaries/system/libengine_dbg.a(CStr.o)' to global weak symbol 'std::__1::char_traits<char>::eq(char, char)' from file '../../../libraries/osx/gloox/lib/libgloox.a(clientbase.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'CStr8::ReverseFind(CStr8 const&) const' from file '../../../binaries/system/libengine_dbg.a(CStr.o)' to global weak symbol 'std::__1::char_traits<char>::eq(char, char)' from file '../../../libraries/osx/gloox/lib/libgloox.a(clientbase.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'CStr8::AfterLast(CStr8 const&, unsigned long) const' from file '../../../binaries/system/libengine_dbg.a(CStr.o)' to global weak symbol 'std::__1::char_traits<char>::eq(char, char)' from file '../../../libraries/osx/gloox/lib/libgloox.a(clientbase.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'CStr8::BeforeLast(CStr8 const&, unsigned long) const' from file '../../../binaries/system/libengine_dbg.a(CStr.o)' to global weak symbol 'std::__1::char_traits<char>::eq(char, char)' from file '../../../libraries/osx/gloox/lib/libgloox.a(clientbase.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'CStr8::AfterFirst(CStr8 const&, unsigned long) const' from file '../../../binaries/system/libengine_dbg.a(CStr.o)' to global weak symbol 'std::__1::char_traits<char>::eq(char, char)' from file '../../../libraries/osx/gloox/lib/libgloox.a(clientbase.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'CStr8::BeforeFirst(CStr8 const&, unsigned long) const' from file '../../../binaries/system/libengine_dbg.a(CStr.o)' to global weak symbol 'std::__1::char_traits<char>::eq(char, char)' from file '../../../libraries/osx/gloox/lib/libgloox.a(clientbase.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'CStr8::Remove(CStr8 const&)' from file '../../../binaries/system/libengine_dbg.a(CStr.o)' to global weak symbol 'std::__1::char_traits<char>::eq(char, char)' from file '../../../libraries/osx/gloox/lib/libgloox.a(clientbase.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'CStr8::Replace(CStr8 const&, CStr8 const&)' from file '../../../binaries/system/libengine_dbg.a(CStr.o)' to global weak symbol 'std::__1::char_traits<char>::eq(char, char)' from file '../../../libraries/osx/gloox/lib/libgloox.a(clientbase.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'CTemplateLoader::LoadTemplateFile(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int)' from file '../../../binaries/system/libengine_dbg.a(TemplateLoader.o)' to global weak symbol 'std::__1::char_traits<char>::eq(char, char)' from file '../../../libraries/osx/gloox/lib/libgloox.a(clientbase.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'SplitExts(char const*)' from file '../../../binaries/system/libengine_dbg.a(Util.o)' to global weak symbol 'std::__1::char_traits<char>::eq(char, char)' from file '../../../libraries/osx/gloox/lib/libgloox.a(clientbase.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'SplitExts(char const*)' from file '../../../binaries/system/libengine_dbg.a(Util.o)' to global weak symbol 'std::__1::char_traits<char>::eq(char, char)' from file '../../../libraries/osx/gloox/lib/libgloox.a(clientbase.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'COList::HandleAdditionalChildren(XMBElement const&, CXeromyces*)' from file '../../../binaries/system/libgui_dbg.a(COList.o)' to global weak symbol 'std::__1::char_traits<char>::eq(char, char)' from file '../../../libraries/osx/gloox/lib/libgloox.a(clientbase.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'TestCLogger::ParseOutput()' from file 'obj/test_Debug/test_CLogger.o' to global weak symbol 'std::__1::char_traits<char>::eq(char, char)' from file '../../../libraries/osx/gloox/lib/libgloox.a(clientbase.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'CxxTest::XmlFormatter::enterSuite(CxxTest::SuiteDescription const&)' from file 'obj/test_Debug/test_root.o' to global weak symbol 'std::__1::char_traits<char>::eq(char, char)' from file '../../../libraries/osx/gloox/lib/libgloox.a(clientbase.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'ts_str_contains(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)' from file 'obj/test_Debug/test_setup.o' to global weak symbol 'std::__1::char_traits<char>::eq(char, char)' from file '../../../libraries/osx/gloox/lib/libgloox.a(clientbase.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'tinygettext::POParser::parse()' from file '../../../binaries/system/libtinygettext_dbg.a(po_parser.o)' to global weak symbol 'std::__1::char_traits<char>::eq(char, char)' from file '../../../libraries/osx/gloox/lib/libgloox.a(clientbase.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'JSI_Network::StartNetworkJoin(ScriptInterface::CmptPrivate*, CStrW const&, CStr8 const&, unsigned short, bool, CStr8 const&)' from file '../../../binaries/system/libengine_dbg.a(JSInterface_Network.o)' to global weak symbol 'std::__1::char_traits<char>::eq(char, char)' from file '../../../libraries/osx/gloox/lib/libgloox.a(clientbase.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'CStr8::Find(CStr8 const&) const' from file '../../../binaries/system/libengine_dbg.a(CStr.o)' to global weak symbol 'std::__1::char_traits<char>::eq(char, char)' from file '../../../libraries/osx/gloox/lib/libgloox.a(clientbase.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'CStr8::ReverseFind(CStr8 const&) const' from file '../../../binaries/system/libengine_dbg.a(CStr.o)' to global weak symbol 'std::__1::char_traits<char>::eq(char, char)' from file '../../../libraries/osx/gloox/lib/libgloox.a(clientbase.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'CStr8::AfterLast(CStr8 const&, unsigned long) const' from file '../../../binaries/system/libengine_dbg.a(CStr.o)' to global weak symbol 'std::__1::char_traits<char>::eq(char, char)' from file '../../../libraries/osx/gloox/lib/libgloox.a(clientbase.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'CStr8::BeforeLast(CStr8 const&, unsigned long) const' from file '../../../binaries/system/libengine_dbg.a(CStr.o)' to global weak symbol 'std::__1::char_traits<char>::eq(char, char)' from file '../../../libraries/osx/gloox/lib/libgloox.a(clientbase.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'CStr8::AfterFirst(CStr8 const&, unsigned long) const' from file '../../../binaries/system/libengine_dbg.a(CStr.o)' to global weak symbol 'std::__1::char_traits<char>::eq(char, char)' from file '../../../libraries/osx/gloox/lib/libgloox.a(clientbase.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'CStr8::BeforeFirst(CStr8 const&, unsigned long) const' from file '../../../binaries/system/libengine_dbg.a(CStr.o)' to global weak symbol 'std::__1::char_traits<char>::eq(char, char)' from file '../../../libraries/osx/gloox/lib/libgloox.a(clientbase.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'CStr8::Remove(CStr8 const&)' from file '../../../binaries/system/libengine_dbg.a(CStr.o)' to global weak symbol 'std::__1::char_traits<char>::eq(char, char)' from file '../../../libraries/osx/gloox/lib/libgloox.a(clientbase.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'CStr8::Replace(CStr8 const&, CStr8 const&)' from file '../../../binaries/system/libengine_dbg.a(CStr.o)' to global weak symbol 'std::__1::char_traits<char>::eq(char, char)' from file '../../../libraries/osx/gloox/lib/libgloox.a(clientbase.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'CTemplateLoader::LoadTemplateFile(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int)' from file '../../../binaries/system/libengine_dbg.a(TemplateLoader.o)' to global weak symbol 'std::__1::char_traits<char>::eq(char, char)' from file '../../../libraries/osx/gloox/lib/libgloox.a(clientbase.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'SplitExts(char const*)' from file '../../../binaries/system/libengine_dbg.a(Util.o)' to global weak symbol 'std::__1::char_traits<char>::eq(char, char)' from file '../../../libraries/osx/gloox/lib/libgloox.a(clientbase.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'SplitExts(char const*)' from file '../../../binaries/system/libengine_dbg.a(Util.o)' to global weak symbol 'std::__1::char_traits<char>::eq(char, char)' from file '../../../libraries/osx/gloox/lib/libgloox.a(clientbase.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'COList::HandleAdditionalChildren(XMBElement const&, CXeromyces*)' from file '../../../binaries/system/libgui_dbg.a(COList.o)' to global weak symbol 'std::__1::char_traits<char>::eq(char, char)' from file '../../../libraries/osx/gloox/lib/libgloox.a(clientbase.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
builderr-release-macos.txt
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../../../binaries/system/libscriptinterface.a(precompiled.o) has no symbols

Link to build: https://jenkins.wildfiregames.com/job/macos-differential/2097/display/redirect

In D3119#138238, @Stan wrote:

As noted in the log above this segfaults. maybe @fabio or @s0600204 have some idea.

I do, as it happens.

In our bundled cxxtest, there is a file called "cxxtest-cmdline.patch". Opening it reveals that, amongst other things, it permits tests to be "disabled" - that is to say, to be skipped - by tacking on "DISABLED" to the end of the test name.

Opening ./source/network/tests/test_Net.h we see two tests that have such a suffix to their respective names. Two tests that will get skipped with the bundled cxxtest, but not with the system-provided cxxtest.

Insert return; as the first line of each of the tests, recompile, and system/test now proceeds past the two bypassed tests... but then segfaults with the following:

In TestCmpPathfinder::test_performance_DISABLED:
../../../source/simulation2/components/tests/test_Pathfinder.h:139: Error: Test failed: File_OpenFailed

This one is a weird one

ERROR: JavaScript error: simulation/components/BuildRestrictions.js line 317
markForTranslationWithContext is not defined
  @simulation/components/BuildRestrictions.js:317:1

Seeing as this doesn't appear once the two network tests have been bypassed, we can make an educated guess and check the top of the test_Net.h file. There we find a g_VFS->Mount() call to mount the public mod... but not one to mount the mod mod, inside which the global function markForTranslationWithContext() is defined.

Stan added a comment.Nov 24 2020, 1:57 AM

So I assume that in the current state we can't use the system one?

In D3119#138246, @Stan wrote:

So I assume that in the current state we can't use the system one?

Probably, but our "disabled" tests are quite probably broken too. Maybe we could rename them to something else that still doesn't get seen as a test.

Stan added a comment.Dec 13 2020, 1:31 AM

Well basically anything that's a function is detected. It even ignores preprocessor macros...

Stan added a comment.EditedDec 26 2020, 1:03 PM

Looks like we can remove our hack entirely. We don't run disabled tests anyway since they fail. From
http://striker.interhact.net/inkscape/inkscape-svn/cxxtest/docs/guide.html

(v3.10.0) If you need to comment out tests, use C++-style comments. Also, if you just don't want CxxTest to run a specific test function, you can temporarily change its name, e.g. by prefixing it with x:

class MyTest : public CxxTest::TestSuite
{
public:
// void testFutureStuff()
// {
// }

   void xtestFutureStuff()
   {
   }
};