I want to build the Xcode in command line by enabling 'Generate test coverage files' and 'Instrument program flow' - xcode4.5

I want to build the Xcode in command line by enabling 'Generate test coverage files' and 'Instrument program flow'
Since i want to do the code coverage from jenkins i want to set the 'Generate test coverage files' and 'Instrument program flow' of XCode to be enabled.
I know the GUI option where to set but i want to run from Terminal since from jenkins it will build thorough the command line
xcodebuild -workspace ../x.xcodeproj/project.xcworkspce -scheme y
then what should i give in the above command to enable the 'Generate test coverage files' and 'Instrument program flow'

Add .xcconfig file to your project with following content
GCC_INSTRUMENT_PROGRAM_FLOW_ARCS = YES
GCC_GENERATE_TEST_COVERAGE_FILES = YES
and run xcodebuild with -xcconfig flag passing it path to your config file

Related

Why is dotnet test command line not respecting run settings?

When I use the code coverage option in Visual Studio, I set the runsettings to my custom file and the results only include the dlls that are specified in my custom file. However, if I use the command line to run the tests, the code coverage results include all dlls, not just the ones from my run settings file. What do I need to do to get the command line to respect the runsettings file?
dotnet.exe test MyTestProj.csproj -l:xunit --collect:"Code Coverage"
/p:settings=runsettings.runsettings
So, /p:settings=runsettings.runsettings is not a valid way to set parameters, anymore. I switched to --settings:"runsettings.runsettings", and now it all works.

How can i setting Bullseye Code Coverage for Qt

I want to use Bullseye Code Coverage for Qt. But, I can not set the environment.(Qt creator)
I found below links and follow https://www.bullseye.com/help/tool-qtCreator.html
Bullseye Code Coverage for Qt
step1. I added below at main.pro
QMAKE_CC = "\"C:/Program Files (x86)/BullseyeCoverage/bin/gcc\""
QMAKE_CXX = "\"C:/Program Files (x86)/BullseyeCoverage/bin/g++\""
QMAKE_LINK = $$QMAKE_CXX
QMAKE_LINK_C = $$QMAKE_CC
step2. I checked the Makefile.Debug.
MAKEFILE = Makefile.Debug
####### Compiler, tools and options
CC = "C:/Program Files (x86)/BullseyeCoverage/bin/gcc"
CXX = "C:/Program Files (x86)/BullseyeCoverage/bin/g++"
But step3, How can "Enable coverage build" ??
Can anyone easily explain the next steps?
For anyone having the same issue, the "Coverage Build" is a Bullseye option, accessible from its Tools menu (i thought it was some QtCreator's option).
Once you have done steps 1. and 2. in the OP question:
go to Bullseye and activate the Coverage Build (if you don't activate it, a normal build will be made)
Compile
A test.cov file should appear in the Qt project's build directory
Create a COVFILE environment variable whose value is the full path to the test.cov file
Restart QtCreator and rebuild
One thing that helped troubleshooting was looking at the "Compile Output" in QtCreator. If COVFILE is correctly set, its value will be shown. If it isn't, the coverage statistics will be most likely empty.

Why my codelite execute 'make -j 0'

I'm using cmake-GUI on windows, generating for codelite, to build a simple "hello world" project (https://github.com/jameskbride/cmake-hello-world). I'm trying to use cygwin compilers but when I run the build command, I got the following error:
C:\WINDOWS\system32\cmd.exe /C C:/cygwin64/bin/make.exe -j 0
----------Building project:[ Debugging - Debug ]----------
make: the '-j' option requires a positive integer argument
Usage: make [options] [target] ...
Why it is happening?!?
My cygwin folder is in PATH. In cygwin terminal the project works.
Your project was generated by CMake - this means that the project is set to custom project so the command to execute (in your case make -j0) is set in the Project Settings->Customize->Custom build page.
On that page you have several entries with different titles (Build, Clean etc)
Double click each entry so it will open in Edit mode and remove the -j0 option
This looks like a bug in CodeLite - CMake generator

Can not call 'make clean' in cmd regarding qmake project

I'm reading Foundations of Qt Development - by Johan Thelin.
Here quote from page 450 about Building QMake Project.
If you choose to create a Makefile using QMake, you can build your project using a simple make command (or nmake if you’re using Visual Studio). You can clean up your intermediate files using make clean. The slightly more brutal step is to run make distclean, which cleans up all generated files, including the Makefile. You will have to run QMake again to get a Makefile for make.
I tried hard to clean the files using 'make clean'. But cmd displaying the message 'make' is not recognized as an internal or external command, operable program or batch file.
I searched here and tried to find the PATH to make inside Qt directory. But not successful. Then according to this solution I tried to use mingw32-make also. But same results.
Anyone of you can help me?
If you using mingw32, try mingw32-make clean. Remember, you must add mingw's bin directory to User Enviroment to use this command. Follow "My Computer" > "Properties" > "Advanced" > "Environment Variables" > "Path" and add ;C:\Qt\Tools\mingw492_32\bin
OR
use command: setx PATH %PATH%;C:\Qt\Tools\mingw492_32\bin

installing Autolit library

I am writing robot tests for web testing using Google's Robot Framework with SeleniumLibrary (a test library) , one of my test involves uploading a file from the desktop by clicking on a"Browse" button on the webpage and using the windows file explorer window that pops up to navigate to and select the file ( providing a text path to file is disabled on the website for security reasons.) I have tried digging around but found little on automating this Windows File Explorer action , is there a way I can do this ?
After downloading the AutoIt library and trying to install it is asking for wincom32./python window extensions.And i am trying to install it is giving some error like
Building pywin32 2.7.217.0
Trace-back (most recent call last):
File "setup.py", line1944, in <module>
""" % dirs).split(),
File "setup.py", line 603, in __init__
if os.path.isfile(os.path.join(sdk_dir, "include", "activdbg.h")):
File"C:\Python27\lib\ntpath.py", line 96 in join
assert len(path) > 0
TypeError: object of type 'NoneType' has no len()
Below is a quick step to step guide to install autoit for robotframework in Windows (as what versions work with what in python is a pain):
First you will need a 32 bit python as autoit will not install for windows 64bit. I have used:
Python 2.6
Then from http://sourceforge.net/projects/pywin32/files/pywin32/Build%20217/
Download the windows installer so for python 2.6 it will be:
pywin32-217.win32-py2.6.exe
Now on the command prompt go to the location of where you downloaded the autoit files ex:
- cd C:\Development\Downloaded files\AutoItLibrary-1.1
and then type
- python setup.py install
If successful you will see lines in the cmd line such as:
Generating...
Importing module
running install
running build
running build_py
creating build
creating build\lib
creating build\lib\AutoItLibrary
copying src\AutoItLibrary\Counter.py -> build\lib\AutoItLibrary
copying src\AutoItLibrary\Logger.py -> build\lib\AutoItLibrary
copying src\AutoItLibrary\__init__.py -> build\lib\AutoItLibrary
running install_lib
copying build\lib\AutoItLibrary\Counter.py -> C:\Python26\Lib\site- packages\AutoItLibrary
copying build\lib\AutoItLibrary\Logger.py -> C:\Python26\Lib\site-
Now run the test
C:\RobotFramework\Extensions\AutoItLibrary\tests
Note: Ensure you have the environment variables set correctly:i.e.
- c:\python26 for python
- c:\python26\scripts for pybot
You can now run your robotframework tests by creating an exe and calling
- Run C:\RobotFramework\Seans Autoit Files\FF_FileUpload.exe
To find how to create the autoit exe visit the autoit website.
Are you attempting to install the pywin32 extensions from source? There are windows installers for all flavours of windows so I would recommend you install using an installer.
(one other thing, google did not make robot framework. It was Nokia Siemens networks...)
Use the Keyword 'Choose File'. No need for AutoIT Lib
Name: Choose File
Source: Selenium2Library
Arguments: [ locator | file_path ]
Inputs the file_path into file input field found by identifier.
This keyword is most often used to input files into upload forms. The file specified with file_path must be available on the same host where the Selenium Server is running.
Example: Choose File my_upload_field C:\Automation\sample.csv
"Choose File" worked in my case. Please note that in my case this made robot write the file path into the input field which was otherwise not editable manually.

Resources