Setting Environment variables and supply arguments
Hi,
I am currently using the cpptest plugin v9.5 for Eclipse Luna on a RHEL 7.2 environment. My c++ application requires some command line arguments to be supplied, as well as me setting an environment variable for loading of shared libraries. Where do I set them?
In addition, somehow it is unable to find and read the test log. Any idea why?
Thanks in advance!
Console Log: Running tests... /home/user/.../Test.exe: error while loading shared libraries ...done Reading test log... Cannot find test log file /home/user/Parasoft/cpptest/9.5/workspace/.cpptest/Test/unit-data/..../cpptest_results.tlog Please make sure that the test executable /home/user/.../Test.exe was built and run properly. ...failed.
Comments
-
Hello,
1. Setting environment variables
You should set-up all required environment variables before launching C++test/Eclipse IDE (in the console shell etc.)
In addition, if your project is of "CDT Managed C/C++ Project" type*, then you can configure environment variables directly in the IDE:
Project Properties> C/C++ Build> Environment(*) Be sure Project Properties> Parasoft> C++test> Build Settings> Options Source is set to "Use options from Managed C/C++ project"
2. Setting application command line arguments
When "Unit Testing" your code, C++test will call functions under tests directly - the application's main entry point will not be executed - so command line arguments are not relevant here.
When "Application Monitoring" your app, the command line arguments can be configured in Test Configuration> Execution> General> Execution Details> Application command line.
3. "Cannot find test log file" message
The test binary was not executed successfully - most probably because of "[...] error while loading shared libraries", so the test log could not be created. Please be sure the environment is set-up correctly (see #1).
1