Vcast Quick Start
Vcast Quick Start
Update packages may be used between editions. The manual printing date changes when a
new edition is printed. The contents and format of this manual are subject to change without
notice.
Rev: 447e070
© Copyright 2024, Vector Informatik, GmbH All rights reserved. No part of the material
protected by this copyright notice may be reproduced or utilized in any form or by any means,
electronic or mechanical, including photocopying, recording, or by any informational storage
and retrieval system, without written permission from the copyright owner.
This computer software and related documentation are provided with Restricted Rights. Use,
duplication or disclosure by the Government is subject to restrictions as set forth in the
governing Rights in Technical Data and Computer Software clause of
Vector Informatik reserves the right to make changes in specifications and other information
contained in this document without prior notice. Contact Vector Informatik to determine
whether such changes have been made.
Third-Party copyright notices are contained in the file: 3rdPartyLicenses.txt, located in the
VectorCAST installation directory.
2
TABLE OF CONTENTS
Introduction 4
VectorCAST Overview 5
Starting VectorCAST (Windows Users) 5
Starting VectorCAST (Linux Users) 6
Troubleshooting 8
VectorCAST Interface 8
Index 22
3
Introduction
VECTORCAST OVERVIEW 5
VectorCAST Overview
VectorCAST is a suite of test automation tools:
> VectorCAST/C++ and VectorCAST/Ada automate the unit and integration testing of C, C++, and
Ada code, allowing you to easily test any subset of files (or packages for Ada) in isolation from the
rest of the application.
> VectorCAST/QA enables teams to implement consistent and repeatable processes for managing
test activities and reporting key quality metrics such as code coverage.
This Quick Start Guide is intended to get you started with the basic features of VectorCAST. Use it for
a quick reference.
For more detailed information about VectorCAST product features, please refer to the User's Guides for
VectorCAST/C++, VectorCAST/Ada, Enterprise Testing, and VectorCAST/QA.
To start VectorCAST, a startup script is recommended. A startup script makes it easier for you to
understand configuration settings and allows more flexibility regarding the initial startup. It is a good
practice to have two scripts, one to setup the environment and another to start VectorCAST. For
example, you may have a need to integrate VectorCAST into a CI system such as Jenkins, and having
a script that only sets up the environment will be useful.
To begin, create an empty directory you can use for the examples in this guide. There can be no spaces
in the path and there are some restricted characters, so it is suggested to start off simple. In this
example, we use D:\setup_dir.
In this example, we have two environment variables that VectorCAST uses to find where VectorCAST
is installed and identify what license manager it should use. There are multiple ways to do this, but to
get started, we will start with a basic example.
Create a script file like the one shown below and name it setup_env.bat
@ECHO OFF
REM VECTORCAST_DIR - Environment variable pointing to the base directory for VectorCAST.
SET "VECTORCAST_DIR=D:\VCAST\2024-beta"
Create a script file like the one shown below and name it Start_VectorCAST.bat.
@ECHO OFF
CALL setup_env.bat
if not defined VECTOR_LICENSE_FILE echo VECTOR_LICENSE_FILE is not set. Will attempt to use
an NVLM license.
if defined VECTOR_LICENSE_FILE echo VECTOR_LICENSE_FILE is set to:
%VECTOR_LICENSE_FILE% Will attempt to use a legacy license.
To start VectorCAST, a startup script is recommended. A startup script makes it easier for you to
understand configuration settings and allows more flexibility regarding the initial startup. It is a good
practice to have two scripts, one to setup the environment and another to start VectorCAST. For
example, you may have a need to integrate VectorCAST into a CI system such as Jenkins, and having
a script that only sets up the environment will be useful.
To begin, create an empty directory you can use for the examples in this guide. There can be no spaces
in the path and there are some restricted characters, so it is suggested to start off simple. In this
example, we use /home/vector/setup_dir.
In this example, we have two environment variables that VectorCAST uses to find where VectorCAST
is installed and identify what license manager it should use. There are multiple ways to do this, but to
get started, we will start with a basic example.
Create a script file like the one shown below and name it setup_env.sh
#!/bin/bash
export VECTORCAST_DIR=/home/vector/vcast/2024-beta
export [email protected]
#unset VECTOR_LICENSE_FILE
Create a script file like the one shown below and name it Start_VectorCAST.sh.
#!/bin/bash
. ./setup_env.sh
echo "VECTORCAST_DIR is set to: ${VECTORCAST_DIR}"
echo "VECTOR_LICENSE_FILE is set to: ${VECTOR_LICENSE_FILE}"
if [ -n "${VECTOR_LICENSE_FILE}" ]
then
echo "VECTOR_LICENSE_FILE is set to: ${VECTOR_LICENSE_FILE}"
elseif [ "${VECTOR_LICENSE_FILE+defined}" = defined ]
then
echo “VECTOR_LICENSE_FILE empty but defined, possible error”
else
echo 'VECTOR_LICENSE_FILE is unset, will attempt to use an NVLM license'
# Start VectorCAST
${VECTORCAST_DIR}/vcastqt
Troubleshooting
If the script did not work, there are a few things to check to be sure you have everything correct:
VectorCAST Interface
Below we discuss the default controls of the VectorCAST GUI. Note that you can return to this
default arrangement at any time by using: View =>Default Layout from the menu bar.
> The Project Tree is located on the left-hand side of the main window. It provides a high level view
of the project structure.
> The Message Window is located along the bottom left of the main window. It contains tabs for
informational messages and for error messages.
> The Multiple Document Interface (MDI) Window is located to the right of the Project Tree. It
displays a variety of windows, including Test Case editors, Coverage Viewers, Report Viewers
and Text Editors. Windows are collected into groups. See the VectorCAST User Guides for more
information on MDI Window Groups.
> The Jobs Monitor is located on the bottom of the main window. It displays the status of jobs as
they execute and exposes the associated back-end commands. See the VectorCAST User's
Guides for more information on the Jobs Monitor.
Enterprise Testing can import existing VectorCAST/C++ and VectorCAST/Ada test environments, or
be used to create new environments.
In this section, you will create a new VectorCAST Project starting with an initial unit test environment.
To prepare for this step, some initial setup is required. First, you will copy the source files used in this
example. The following examples show how this is done for both Windows and Linux hosts.
Windows Example
Linux Example
Next, you will start VectorCAST using the Start_VectorCAST.bat script located in this directory.
From the Menu Bar, select File => Set Working Directory.... Navigate to your working directory and
select Choose. For our example, we select the lab01 directory as our working directory.
The next step is to name the Project and select a compiler suite to use. The compiler suite selection will
be different depending on if you are using Windows or a Linux host. With Windows, VectorCAST
includes a Windows MinGW compiler that can be used. For Linux, you need to use a native gcc
compiler and insure that the compiler is on the current path.
Windows Example
Linux Example
Select the Create button. The new VectorCAST Project, lab01, is displayed in the Project View.
Enter the Environment name. Our example environment is named UNIT_TESTS. Select the Next
button.
Select the Testing Method. For our example, we select Traditional Unit Testing. Select the Next
button.
Select the Coverage Type. Using the Coverage type drop-down menu, select Statement coverage.
Select the Next button.
button. Add the c directory that was created earlier. Select the Choose button.
Use Relative Paths. Check the Use relative paths checkbox. Select the Next button.
Choose the UUT. For our example, we will select manager.c as our UUT. Under the Unit Names
tab, select manager.c. Click the move-to-right button to place manager.c in the Units Under
Test list.
Build the Environment. Once a UUT is designated, the Build button is enabled. Select the Build
button.
You now have an initial Unit Test environment in your VectorCAST Project.
Select Add_Party_To_Waiting_list and right click. Select Insert Test Case from the menu to
open the Unit Test Case Editor.
You will see that VectorCAST has already parsed the UUT and all the parameters and their type are
listed. For this unit, we have one parameter called “Name” which is of type string. For this test case,
we will add a string to pass to the unit. Select the cell under Input Values on the same row as “Name”.
Type in Vector.
Right-click on the test Add_Party_To_Waiting_List in the Environment View and select Execute
from the menu.
Once the test executes, the Coverage Viewer opens and you will see the lines that were executed as a
result of this test displayed in green.
Close the environment and return to the Project View by selecting File => Close Environment from
the Menu Bar.
A dialog box appears asking you to confirm the changes you made to the environment. Select the
Accept Changes button. The Project View is displayed.
You can follow the execute process in the Manage Status viewer which opens in the MDI Window. As
test cases are executed data is stored in a SQL database and used to generate reports showing testing
status and trends, making it easy to analyze regression trends.
The Status Panel updates to display testing status. On the status panel you will see status for the
Environment Build, Test Execution and Statement Coverage. Hover over the Statement Coverage bar
to see a pop-up of the Build and Coverage details.
Index VectorCAST
starting linux 6
add a test case 18
starting windows 5
add unit test environment 13
VectorCAST interface
build the environment 17
jobs monitor 8
choose uut 16
MDI window 8
close environment 20
message window 8
coverage type 15
project tree 8
create a vectorcast project 11-12
windows
create new environment wizard 14
create a vectorcast project 11
create unit test environment 13
environment variables 5
enterprise testing 11
example setup script 5
create a project 11
example startup script 6
environment name 14
startup script 5
execute a test case 19
working directory 11
execute all tests 20
insert a test case 18
jobs monitor 9
linux
create a vectorcast project 11
environment variables 7
example setup script 7
example startup script 7
startup script 6
manage status viewer 21
MDI window 9
message window 9
project tree
location of 9
relative paths 16
search directory 15
starting vectorcast
linux 6
windows 5
status panel 21
testing method 14
troubleshooting scripts 8
22