Google-test Emscripten Port

912 views
Skip to first unread message

raytrace

unread,
May 28, 2015, 5:26:49 AM5/28/15
to emscripte...@googlegroups.com
Hi guys, Just want to know: is Google-Test Emscripten Port available? if not, how to integrate it in Emscripten?  Any advice would be greatly appreciated.

Thanks

chai2010

unread,
May 28, 2015, 5:32:07 AM5/28/15
to emscripte...@googlegroups.com
I create a mini test (similar with gtest), and it can works on emscripten.


2015-05-28 17:26 GMT+08:00 raytrace <dawe...@gmail.com>:
Hi guys, Just want to know: is Google-Test Emscripten Port available? if not, how to integrate it in Emscripten?  Any advice would be greatly appreciated.

Thanks

--
You received this message because you are subscribed to the Google Groups "emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to emscripten-disc...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

Jukka Jylänki

unread,
May 28, 2015, 5:41:31 AM5/28/15
to emscripte...@googlegroups.com
Haven't overheard of anyone who would have built that and I'm not familiar with Google Test code, but quickly glancing here https://code.google.com/p/googletest/source/browse/#svn%2Ftrunk%2Fsrc and here https://code.google.com/p/googletest/source/browse/#svn%2Ftrunk%2Finclude%2Fgtest , I don't see any platform-specific code files, so it might all just be platform independent C++ code, in which case it will most likely compile without modifications. There does exist a CMakeLists.txt at https://code.google.com/p/googletest/source/browse/#svn%2Ftrunk%253Fstate%253Dclosed and a configure script, so using either of those to build might work.

2015-05-28 12:26 GMT+03:00 raytrace <dawe...@gmail.com>:
Hi guys, Just want to know: is Google-Test Emscripten Port available? if not, how to integrate it in Emscripten?  Any advice would be greatly appreciated.

Thanks

--

chronotext

unread,
May 29, 2015, 7:53:41 PM5/29/15
to emscripte...@googlegroups.com
Hi was able to build Google Test for Emscripten via cmake as follows:

cd googletest
mkdir build
cd build
emcmake cmake -Dgtest_disable_pthreads=ON ..

And then:
emmake make

Note that it failed with 'cxxabi.h' file not found,  so I had to create a symbolic-link
to ${EMSCRIPTEN_ROOT}/system/lib/libcxxabi/include/cxxabi.h
in ${EMSCRIPTEN_ROOT}/system/local/include

I wonder cxxabi.h is not automatically included by Emscripten? (as it seems to be properly linked into libc.bc...)
(FWIW: I'm on OSX, with a manual-build of Emscripten 1.32.)

HTH

Dawei Fei

unread,
May 31, 2015, 10:06:05 AM5/31/15
to emscripte...@googlegroups.com
Awsome. Thanks for you guys. It sounds Chronotext resolved this problem perfectly. 

--
You received this message because you are subscribed to a topic in the Google Groups "emscripten-discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/emscripten-discuss/WEYYbA29E6Y/unsubscribe.
To unsubscribe from this group and all its topics, send an email to emscripten-disc...@googlegroups.com.

Jean-Marc Le Roux

unread,
Jun 1, 2015, 2:56:42 AM6/1/15
to emscripte...@googlegroups.com
We encountered the same problem. The symbolic link might work, but that's still a problem if you have to patch Emscripten.
Can we expect this to be fixed anytime soon?
Having Google Test working out of the box would be lovely for us since and would be incredibly helpful to diagnose Emscripten-specific issues in our code.

Thanks you!

Alon Zakai

unread,
Jun 1, 2015, 1:31:18 PM6/1/15
to emscripte...@googlegroups.com
Discussion on the symbolic link issue with cxxabi.h is at https://github.com/kripken/emscripten/issues/3484

- Alon


--
You received this message because you are subscribed to the Google Groups "emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to emscripten-disc...@googlegroups.com.

chronotext

unread,
Jun 1, 2015, 8:26:26 PM6/1/15
to emscripte...@googlegroups.com
Follow-up:

I have created a git repo for building Google Test for Emscripten (and a few other platforms...)

https://github.com/arielm/chronotext-gtest

HTH,
Ariel

Dawei Fei

unread,
Jun 2, 2015, 4:32:22 AM6/2/15
to emscripte...@googlegroups.com
Good Job! Thanks, Ariel.

--
You received this message because you are subscribed to a topic in the Google Groups "emscripten-discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/emscripten-discuss/WEYYbA29E6Y/unsubscribe.
To unsubscribe from this group and all its topics, send an email to emscripten-disc...@googlegroups.com.

Warren Seine

unread,
Oct 17, 2015, 1:49:11 PM10/17/15
to emscripten-discuss
Hi,

This issue still exists. I've managed to workaround it by adding an additional "-I" in the search path, but there's something else now.

When I compile link against Google Test (which compiles fine), Emscripten complains about an unresolved symbol: putchar.

I can't find any reference to putchar anywhere in the source code of Google Test, and from what I read, putchar is usually a compiler macro which resolves to putc(c, stdout).

I simply added a JavaScript function that somehow simulates the behavior (it's not actually critical to the project...) and it works. Here's how it looks:

    putchar: function(c) {
        console.log(String.fromCharCode(c));
    }

Should I report the bug on GitHub?

Alon Zakai

unread,
Oct 17, 2015, 9:57:00 PM10/17/15
to emscripten-discuss
Yes, please report it and provide a testcase to reproduce the problem.

--
You received this message because you are subscribed to the Google Groups "emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to emscripten-disc...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages