"C" Unit-Test Support on Visual Studio


Guy <guy.tal@...>
 

Hello,

The payload unit tests do not run on VS 2012, I have fixed this and produced a large patch with all "C" unit tests. I have prepared the patch against the 'master' (rev. 2.3.1 and not the 'next' branch) with unit-tests ported to Visual Studio 2005 format.

I've tested the unit tests to build on VS2005 against Google-tests 1.6.0, then I tested them to build in VS2012.

If any one has other versions of Visual Studio and wants to check it out with VS 2010, 2008 and 2005 that would be great.

The patch consists of changes to the source and few additional projects as described below:
  1. Added additional projects for each unit-test following the naming conventions in the make files.
  2. Added only necessary missing dll-exports for correct compilation of used libraries.
  3. Added missing functions to port.h/c for Windows (strndup)
  4. Replaced non-working traits (because of min/max macros) with equivalents from port.h, see example:
-    ret = aBridge->msgPayloadAddU8 (testPayload, NULL, ++fid, std::numeric_limits<mama_u8_t>::max ());
+      ret = aBridge->msgPayloadAddU8 (testPayload, NULL, ++fid, UINT8_MAX);
  1. Fixed issues related to Visual Studio 2012 (should apply to 2010) in the unit test projects. see preprocessor: _VARIADIC_MAX=10.
  2. Removed unnecessary warnings with _CRT_SECURE_NO_WARNINGS
  3. Changed the path for linking x64 build of gtest.lib. I found that building x64 version of gtest.lib by adding x64 configuration and then using VS default output directories a better way, which is expected to build easily with no extra work.
Regards,
Guy
Tick42




Guy <guy.tal@...>
 

Hi Damian,

I've prepared here a revised version of the last experimental patch to support MAMA C Unit-Tests in Visual Studio.
I removed in the last version both implementation and use of strndup, other than that it should almost be the same as last version.

This should work against the master branch.

I'm working now on a patch that should work correctly on 'next' branch (including git format etc.)

This mail is a follow up for the bug #125 in bugzilla, basically for other people to experiment with that too.

Regards,
Guy
Tick42

On 11/09/2014 16:06, Guy wrote:
Hello,

The payload unit tests do not run on VS 2012, I have fixed this and produced a large patch with all "C" unit tests. I have prepared the patch against the 'master' (rev. 2.3.1 and not the 'next' branch) with unit-tests ported to Visual Studio 2005 format.

I've tested the unit tests to build on VS2005 against Google-tests 1.6.0, then I tested them to build in VS2012.

If any one has other versions of Visual Studio and wants to check it out with VS 2010, 2008 and 2005 that would be great.

The patch consists of changes to the source and few additional projects as described below:
  1. Added additional projects for each unit-test following the naming conventions in the make files.
  2. Added only necessary missing dll-exports for correct compilation of used libraries.
  3. Added missing functions to port.h/c for Windows (strndup)
  4. Replaced non-working traits (because of min/max macros) with equivalents from port.h, see example:
-    ret = aBridge->msgPayloadAddU8 (testPayload, NULL, ++fid, std::numeric_limits<mama_u8_t>::max ());
+      ret = aBridge->msgPayloadAddU8 (testPayload, NULL, ++fid, UINT8_MAX);
  1. Fixed issues related to Visual Studio 2012 (should apply to 2010) in the unit test projects. see preprocessor: _VARIADIC_MAX=10.
  2. Removed unnecessary warnings with _CRT_SECURE_NO_WARNINGS
  3. Changed the path for linking x64 build of gtest.lib. I found that building x64 version of gtest.lib by adding x64 configuration and then using VS default output directories a better way, which is expected to build easily with no extra work.
Regards,
Guy
Tick42





_______________________________________________
Openmama-dev mailing list
Openmama-dev@...
https://lists.openmama.org/mailman/listinfo/openmama-dev


Guy <guy.tal@...>
 

Hi,

My last patch had an error with strndup/strdup changes.
Attached here fixed patch against 'master' branch.

Guy
Tick42

On 16/09/2014 16:55, Guy wrote:
Hi Damian,

I've prepared here a revised version of the last experimental patch to support MAMA C Unit-Tests in Visual Studio.
I removed in the last version both implementation and use of strndup, other than that it should almost be the same as last version.

This should work against the master branch.

I'm working now on a patch that should work correctly on 'next' branch (including git format etc.)

This mail is a follow up for the bug #125 in bugzilla <http://bugs.openmama.org/show_bug.cgi?id=125>, basically for other people to experiment with that too.

Regards,
Guy
Tick42

On 11/09/2014 16:06, Guy wrote:
Hello,

The payload unit tests do not run on VS 2012, I have fixed this and produced a large patch with all "C" unit tests. I have prepared the patch against the 'master' (rev. 2.3.1 and not the 'next' branch) with unit-tests ported to Visual Studio 2005 format.

I've tested the unit tests to build on VS2005 against Google-tests 1.6.0, then I tested them to build in VS2012.

If any one has other versions of Visual Studio and wants to check it out with VS 2010, 2008 and 2005 that would be great.

The patch consists of changes to the source and few additional projects as described below:

1. Added additional projects for each unit-test following the naming
conventions in the make files.
2. Added only necessary missing dll-exports for correct compilation
of used libraries.
3. Added missing functions to port.h/c for Windows (strndup)
4. Replaced non-working traits (because of min/max macros) with
equivalents from port.h, see example:

- ret = aBridge->msgPayloadAddU8 (testPayload, NULL, ++fid,
std::numeric_limits<mama_u8_t>::max ());
+ ret = aBridge->msgPayloadAddU8 (testPayload, NULL, ++fid,
UINT8_MAX);

5. Fixed issues related to Visual Studio 2012 (should apply to 2010)
in the unit test projects. see preprocessor: _VARIADIC_MAX=10.
6. Removed unnecessary warnings with _CRT_SECURE_NO_WARNINGS
7. Changed the path for linking x64 build of gtest.lib. I found that
building x64 version of gtest.lib by adding x64 configuration and
then using VS default output directories a better way, which is
expected to build easily with no extra work.

Regards,
Guy
Tick42





_______________________________________________
Openmama-dev mailing list
Openmama-dev@lists.openmama.org
https://lists.openmama.org/mailman/listinfo/openmama-dev


_______________________________________________
Openmama-dev mailing list
Openmama-dev@lists.openmama.org
https://lists.openmama.org/mailman/listinfo/openmama-dev


Damian Maguire
 

Cheers for that Guy, this stuff looks pretty nice. We'll take a look at the changes and follow up on the Bugzilla ticket if we need any further information. 

Cheers, 

D

On Tue, Sep 16, 2014 at 5:40 PM, Guy <guy.tal@...> wrote:
Hi,

My last patch had an error with strndup/strdup changes.
Attached here fixed patch against 'master' branch.

Guy
Tick42

On 16/09/2014 16:55, Guy wrote:
Hi Damian,

I've prepared here a revised version of the last experimental patch to support MAMA C Unit-Tests in Visual Studio.
I removed in the last version both implementation and use of strndup, other than that it should almost be the same as last version.

This should work against the master branch.

I'm working now on a patch that should work correctly on 'next' branch (including git format etc.)

This mail is a follow up for the bug #125 in bugzilla <http://bugs.openmama.org/show_bug.cgi?id=125>, basically for other people to experiment with that too.

Regards,
Guy
Tick42

On 11/09/2014 16:06, Guy wrote:
Hello,

The payload unit tests do not run on VS 2012, I have fixed this and produced a large patch with all "C" unit tests. I have prepared the patch against the 'master' (rev. 2.3.1 and not the 'next' branch) with unit-tests ported to Visual Studio 2005 format.

I've tested the unit tests to build on VS2005 against Google-tests 1.6.0, then I tested them to build in VS2012.

If any one has other versions of Visual Studio and wants to check it out with VS 2010, 2008 and 2005 that would be great.

The patch consists of changes to the source and few additional projects as described below:

 1. Added additional projects for each unit-test following the naming
    conventions in the make files.
 2. Added only necessary missing dll-exports for correct compilation
    of used libraries.
 3. Added missing functions to port.h/c for Windows (strndup)
 4. Replaced non-working traits (because of min/max macros) with
    equivalents from port.h, see example:

    -    ret = aBridge->msgPayloadAddU8 (testPayload, NULL, ++fid,
    std::numeric_limits<mama_u8_t>::max ());
    +      ret = aBridge->msgPayloadAddU8 (testPayload, NULL, ++fid,
    UINT8_MAX);

 5. Fixed issues related to Visual Studio 2012 (should apply to 2010)
    in the unit test projects. see preprocessor: _VARIADIC_MAX=10.
 6. Removed unnecessary warnings with _CRT_SECURE_NO_WARNINGS
 7. Changed the path for linking x64 build of gtest.lib. I found that
    building x64 version of gtest.lib by adding x64 configuration and
    then using VS default output directories a better way, which is
    expected to build easily with no extra work.

Regards,
Guy
Tick42





_______________________________________________
Openmama-dev mailing list
Openmama-dev@....org
https://lists.openmama.org/mailman/listinfo/openmama-dev



_______________________________________________
Openmama-dev mailing list
Openmama-dev@....org
https://lists.openmama.org/mailman/listinfo/openmama-dev


_______________________________________________
Openmama-dev mailing list
Openmama-dev@...
https://lists.openmama.org/mailman/listinfo/openmama-dev