Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » 4DIAC - Framework for Distributed Industrial Automation and Control » Set up Unit Test project in VS(Attempting to set up a unit test project for testing function blocks in VS)
Set up Unit Test project in VS [message #1764025] Wed, 24 May 2017 07:59 Go to next message
Marc Jakobi is currently offline Marc JakobiFriend
Messages: 67
Registered: April 2017
Member
Hi.

I am attempting to set up a Unit Test project using the Microsoft Unit Testing Framework for C++, with which I intend to validate function blocks against data stored in CSV files.

I have created a project in VS and set the following additional include directories:


  • ...\FORTE\src\stdfblib\events;
  • ...\FORTE\src\modules\mqtt_paho;
  • ...\FORTE\src\core\utils;
  • ...\FORTE\src\core\datatypes;
  • ...\FORTE\src\core\cominfra;
  • ...\FORTE\src\core;
  • ...\FORTE\src\arch\win32;
  • ...\FORTE\src\arch;
  • ...\FORTE\src\.;
  • ...\FORTE\bin\win32;
  • ...\FORTE\bin\win32\src_gen;
  • ...\FORTE\src\modules\PVprog;


When building the solution, I get the following error in the forte_any header: "Endianess is not defined!" (if I #include any of my FB classes).

This is where I am currently stuck. Are there any other directories I need to include or is this a different issue? (I am relatively new to Visual Studio).

Thanks in advance for any support!

[Updated on: Wed, 24 May 2017 08:04]

Report message to a moderator

Re: Set up Unit Test project in VS [message #1764034 is a reply to message #1764025] Wed, 24 May 2017 08:30 Go to previous messageGo to next message
Eclipse UserFriend
hi,

we allready use Boost-test as unit test framework. This is already integrated in the cmake configuration files and you just need to check the flag forte tests and provide links to the boost libraries. I think there should even some docu in our docs.

the problem with your setup is that our FBs need some infrastructure generated from our cmake infrastructure. doing this manually can be rather elaborate and errorprone.
Re: Set up Unit Test project in VS [message #1764068 is a reply to message #1764034] Wed, 24 May 2017 14:12 Go to previous messageGo to next message
Marc Jakobi is currently offline Marc JakobiFriend
Messages: 67
Registered: April 2017
Member
Thanks for your reply.
I added the path to the boost library (...\boost\) as an additional include source and most of the build seems to work. But I am still getting two error messages when building:

- Cannot open include file: 'CWin32SerComParameterParser.h': No such file or directory
- Cannot open include file: 'cwin32sercomparameterparser.h': No such file or directory

I noticed that CMake has two more entries:
- FORTE_TESTS_INC_DIRS
- FORTE_TESTS_LINK_DIRS

Do I have to specify something here?
Re: Set up Unit Test project in VS [message #1764108 is a reply to message #1764068] Wed, 24 May 2017 22:20 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1585
Registered: January 2014
Senior Member

argh yes i stumbled across this issue myself some time ago and I must confess I forgot to further dig into it. As a quick fix for you could you please open the file tests/arch/win32/CmakeLists.txt and comment out the first and only line in this file.
Re: Set up Unit Test project in VS [message #1764119 is a reply to message #1764108] Thu, 25 May 2017 08:31 Go to previous messageGo to next message
Marc Jakobi is currently offline Marc JakobiFriend
Messages: 67
Registered: April 2017
Member
Thanks, it builds without errors now. Now I just have to hope MS releases a test explorer extension soon.

I realized path to the Boost library is removed from the additional include sources every time I reconfigure/generate the project in CMake. Can I add the directory in the forte_tests CMakeLists file somewhere?
Re: Set up Unit Test project in VS [message #1764184 is a reply to message #1764119] Fri, 26 May 2017 13:22 Go to previous message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1585
Registered: January 2014
Senior Member

Strange. The values should be stored in the cmakechache.txt and be persited there. only when you do delete cache they should go away.
Previous Topic:No Tracing Events in Forte Console
Next Topic:SIFB SIGPIPE Handler
Goto Forum:
  


Current Time: Thu Apr 25 16:58:06 GMT 2024

Powered by FUDForum. Page generated in 0.04066 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top