Faux Console Application for Android NDK and Chrome Native Client SDK

While Android and the Chrome Native Client (NaCl) don’t actually provide support for console style applications, they are still useful for C++ unit testing.  As a second step towards developing cross-platform multi-threaded C++ unit tests, I developed a Visual Studio 2010 project that includes the platforms for Android and NaCl as well as the 32 and 64-bit versions of a Windows console application.  The VS project and source code can be directly browsed here.

To actually build and run the project, it is necessary to get the full Grail42 project and its subprojects Grail42 Core and Grail42 Templates, and install the Android NDK plug-in and the NaCl SDK plug-in for VS.  Note that the NaCl plug-in for VS requires a 64-bit version of Windows.

For NaCl platforms the project is configured so that it can run as a faux console application loaded into Chrome or be run standalone via the sel_ldr*.exe tool included in the NaCl SDK.

I completed the first step towards cross-platform multi-theaded unit tests, as explained here, after getting 5 threads running in a Windows console app where each thread was using a separate unit testing framework and all of the frameworks were configured to use a common thread safe results reporter.

Upon completing this first step, I thought it would be a good idea to ensure the code was portable and took a look the state of various cross platform build systems.  As I did not turn up any build systems that were generally better than the others*, and in my investigation I ran across the VS add-ins for the Android NDK and the Chrome Native Client SDK, I decided to stick with the build system I was most familiar (VS / msbuild.exe) to minimize the length of the detour I was taking away from developing the C++ unit testing framework.  It didn’t hurt that I had been considering investing in Android development anyway, and NaCl support OpenGL ES 2.0 so it provides the opportunity to write graphical code for Android, web pages, and possibly Windows as well (I suspect there may be an OpenGL ES 2.0 port for Windows, but I haven’t investigated yet).

The next step is to develop a Python script that can clone example projects so that they can be used as templates for new projects, and then I can get back to developing the framework for cross-platform, multi-threaded C++ unit tests.

* – certainly some build systems are better than others in specific situations or when measured against specific requirements.

This entry was posted in Coding and tagged , , , , , . Bookmark the permalink.

1 Response to Faux Console Application for Android NDK and Chrome Native Client SDK

  1. Pingback: Portability of 5 C++ Unit Test Frameworks to Android NDK and Chrome NaCl | Josh Heitzman on Codecrafting

Have something to say?

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s