In a CLI environment, it is possible to use various CT 2023.12 functions such as project creation and analysis, test case creation, execution, and generating test result reports.

  1. In CT 2023.12, click [Project] – [Generate command line interface INI file] to create a CLI.ini file.
  2. Edit the CLI.ini file. Refer to the [Editing the CLI Configuration File] section of this page.
  3. The following commands can be used to perform test-related functions. -e -w "%workSpacePath%" --ini -O "%iniFilePath%"
    • iniFilePath : CLI.ini path

Creating CLI configuration file

Creates a configuration file to run CT 2023.12 in CLI environment.

  • Clicking [Project] – [Generate command line interface INI file] creates a CLI.ini file in the path chosen by the user.

Editing the CLI configuration file

[Project]

Item Description
create Whether to create a project.
cpi_file If create=true, the path to the .cpi file for project creation.
force If create=true, delete and create the project if a project with the same name already exists.
name Project name.
toolchain Toolchain name (create in case of RTV project).
target_project Target project name (create in case of RTV project).

[Analysis]

Item Description
run Whether to perform analysis.

[InitializeTest]

Item Description
run If true, delete all existing tests.

[CreateTest]

Item Description
run Whether to generate unit tests.
target_function It is a function name for generating unit tests. Unit tests can be created for one or more functions.
When entering multiple functions, they can be separated with a semicolon (;) or Enter.
If there is no target_function list, create unit tests for all functions.
isolate Whether to create stubs for separating test target functions.

[CreateTestCase]

Item Description
run Whether to create a test case.
mode Test case generation mode. (flat, pairwise, random)
random_testcase_count In case of random, input the number of test cases generated.

[ImportTestInfo]

Item Description
run Whether to fetch test information.
testinfo_file Path to the testinfo.export file.
include_fault_injection Inclusion of fault injection.

[ExecuteTest]

Item Description
run Whether to run unit test.
remote_target RTV run or not.
run_robust If an error occurs while running a test, whether to exclude non-executable tests.
only_build Build only without test execution
build_option_file_path Compile command file path

[Report]

Item Description
run Whether to generate a report.
output_dir Report output path.
The default output path is project path.
include_project_info Include project information
test_env_kind Test environment kind (1: Host, 2: RTV or Target)
each_test Whether to generate a report by test.
jenkins_test_result Generate test result xml file
HTML, XLSX, PDF, DOCX,
PPTX
Specify Report Format

Individual import of test information

[ImportStub]

Item Description
run Whether to perform stub import.
stub_file Path to the stub file.
stub_dir Path to the stub directory.

[ImportTest]

Item Description
run Whether to perform test import.
test_source_file .utest file path.
When entering multiple source file paths, they can be separated with a semicolon (;) or Enter.
test_source_dir Path to the test source directory.
If you enter the test source directory path, perform a full test import included in the directory path.

[ImportTestCase]

Item Description
run Whether to perform test import.
testcase_dir Test case directory path.
If you enter the test case directory path, import all test cases included in the directory path.

[ImportIntegrationTest]

Item Description
run Whether to perform integration tests and import of test cases.
test_file .itest file path.
test_dir Common parent path for .itest file.
If the test and test case are in the same directory, perform an import.

Create CPI file

CPI file is a configuration file for creating a project in CLI environment. The project is created only when the [Project] – create option in the CLI.ini file is set to true.

You can set the option to create a project from the CPI template file in the path of CT 2023.12 installation path\plugins\com.codescroll.gp.cli_version\cpi.

Item Description
KIND Project creation type setting.
General project =1
Get Build Script = 2
Visual Studio Import =3
Import Embedded Project = 4
NAME Project name.
LANGUAGE Project type.
Java = 0, C/C++ = 1

SourceFileProject

Item Description
IUT_LANGUAGE Target language type.
C=0, C++=1, Java=2
LINKFLAG Link flag.
COMMON_COMPILEFLAG Compilation flag to apply to all TUs.
TOOLCHAIN_NAME Toolchain name.
BINARY_KIND Binary type.
SOURCE_TOP_DIR Source file top level directory.
SOURCE Absolute path to source file.
COMPILEFLAG Compilation flag to apply only to source files.
COMPILER_PATH Path to the compiler to apply only to source files.

VisualStudioPorject

Item Description
PROJECT_PATH Visual Studio project file to import.
ENVFILE Environment variable required for import.

BuildScriptProject

Item Description
BUILD_COMMAND Build script to perform the import.
WORKING_DIRECTORY Working directory to perform import.
ENVFILE Environment variable required for import.

EmbeddedProject

Item Description
COMMON_COMPILEFLAG Compilation flag to apply to all Source Files.
TOOLCHAIN_NAME Toolchain name.
PROJECT_PATH Visual Studio project file to import.

Need more help with this?
Don’t hesitate to contact us here.

Thanks for your feedback.