EnglishFrenchSpanish

OnWorks favicon

ggcov-run - Online in the Cloud

Run ggcov-run in OnWorks free hosting provider over Ubuntu Online, Fedora Online, Windows online emulator or MAC OS online emulator

This is the command ggcov-run that can be run in the OnWorks free hosting provider using one of our multiple free online workstations such as Ubuntu Online, Fedora Online, Windows online emulator or MAC OS online emulator

PROGRAM:

NAME


ggcov-run - run an instrumented test program

SYNOPSIS


ggcov-run [options] [--] program args...

DESCRIPTION


Ggcov-run can be used to run a test program, instrumented using gcc --coverage when built,
under certain conditions. It's use is entirely optional, as the default behaviour of the
gcc instrumention is designed to be useful under most conditions.

Ggcov-run takes as arguments a program and it's arguments, and runs the program with some
behavioural modifications (in the manner of strace). If given no options, the program is
run without any modifications.

GCDA FILE LOCATIONS


One problem with the default behaviour of the gcc instrumentation involves the locations
of coverage data. Instrumented test programs will read, modify and re-write .gcda files
when the program exits. The locations of those files are chosen by the compiler at
compile time; the files will be placed in the build directory next to the corresponding .c
file. The compiler saves this information in the .o file. For example, if you compile
the file foo.c in the directory /home/me/software/quux, then the pathname
/home/me/software/quux/foo.gcda is hardcoded in the test program. Of course, programs
that examine coverage data, like ggcov, look for the .gcda files there.

For many test applications this works just fine. Problems arise however when the
instrumented program needs to be run on another machine, or as another userid, or the
build directory is volatile, or in any other test scenario where the build directory
either does not exist or is not writable by the running test program. In these cases, you
need to do some ad-hoc file moving before and after testing in order to get the .gcda
files in the right location on the right machine with the right permissions.

A better approach is to use ggcov-run with the --gcda-prefix option. This option takes as
a value a directory which is prepended to the pathname of each .gcda file the test program
accesses. So, continuing the above example, running the test program like this:

me$ ggcov-run --gcda-prefix=/tmp/gcda ./testprogram test-args...

will result in a .gcda file being written to /tmp/gcda/home/me/software/quux/foo.gcda.
The directory tree will be automatically created as the .gcda files are written, and the
file and directory permissions will allow read access for all users.

Note that ggcov also has a --gcda-prefix option which can be used to search for .gcda
files in locations other than the build directory. In our example:

me$ cd /home/me/software/quux
me$ ggcov --gcda-prefix=/tmp/gcda -r .

OPTIONS


-p dir, --gcda-prefix=dir
Cause the test program, and any child processes it runs, to redirect any absolute
filename ending in .gcda to a filename underneath the directory dir.

CAVEATS


Ggcov-run uses a shared library shim and the LD_PRELOAD feature of the runtime linker to
intercept certain library calls by the instrumented program. For very good security
reasons, LD_PRELOAD is disabled for setuid or setgid programs. So if your test program
relies on setuid behaviour, ggcov-run will not work. One possible workaround is to use
sudo or su to change userid before using ggcov-run, like this:

me$ sudo -u otheruser ggcov-run --gcda-prefix=/foo ./testprogram

Use ggcov-run online using onworks.net services


Free Servers & Workstations

Download Windows & Linux apps

  • 1
    Psi
    Psi
    Psi is cross-platform powerful XMPP
    client designed for experienced users.
    There are builds available for MS
    Windows, GNU/Linux and macOS.. Audience:
    End Users...
    Download Psi
  • 2
    Blobby Volley 2
    Blobby Volley 2
    Official continuation of the famous
    Blobby Volley 1.x arcade game..
    Audience: End Users/Desktop. User
    interface: OpenGL, SDL. Programming
    Language: C++, Lua. C...
    Download Blobby Volley 2
  • 3
    SuiteCRM
    SuiteCRM
    SuiteCRM is the award-winning Customer
    Relationship Management (CRM)
    application brought to you by authors
    and maintainers, SalesAgility. It is the
    world�s mos...
    Download SuiteCRM
  • 4
    Poweradmin
    Poweradmin
    Poweradmin is a web-based DNS
    administration tool for PowerDNS server.
    The interface has full support for most
    of the features of PowerDNS. It has full
    support...
    Download Poweradmin
  • 5
    Gin Web Framework
    Gin Web Framework
    Gin is an incredibly fast web framework
    written in Golang that can perform up to
    40 times faster, thanks to its
    martini-like API and custom version of
    httprout...
    Download Gin Web Framework
  • 6
    CEREUS LINUX
    CEREUS LINUX
    CEREUS LINUX basado en MX LINUX con
    varios entornos de escritorios. This is
    an application that can also be fetched
    from
    https://sourceforge.net/projects/cereu...
    Download CEREUS LINUX
  • More »

Linux commands

  • 1
    aa-clickquery
    aa-clickquery
    aa-clickquery - program for querying
    click-apparmor DESCRIPTION: This program
    is used to query click-apparmor for
    information. USAGE: aa-clickquery
    --click-fra...
    Run aa-clickquery
  • 2
    aa-exec-click
    aa-exec-click
    aa-exec-click - program for executing
    click packages under confinement
    DESCRIPTION: This program is used to
    execute click package under AppArmor
    confinement. I...
    Run aa-exec-click
  • 3
    cpio
    cpio
    cpio - copy files to and from archives ...
    Run cpio
  • 4
    cpipe
    cpipe
    cpipe - copy stdin to stdout while
    counting bytes and reporting progress ...
    Run cpipe
  • 5
    FvwmSave
    FvwmSave
    FvwmSave - the Fvwm desktop-layout
    saving module ...
    Run FvwmSave
  • 6
    FvwmSave1
    FvwmSave1
    FvwmSave - the FVWM desktop-layout
    saving module ...
    Run FvwmSave1
  • More »

Ad