API for Projects

Part of the Object based program API.

class ProjectApi

API to access projects

Returned by

ComponentApi

Returns the ComponentApi namespace.

Returns:

ComponentApi namespace

Return type:

ComponentApi

CreateProject()

Creates a new project.

Returns:

New empty project

Return type:

Project

GetChanges(oldProject, newProject)

Get the changes that exist between two given projects.

Parameters:
oldProject

The old project to compare.

newProject

The new project to compare.

Returns:

The changes that exist between the two projects.

Return type:

list[Change]

OpenProject(filename, execInCurrentPkgDir=False, filterExpression='')

Opens an existing project. The project may not be opened in ecu.test.

Parameters:
filename : str

Absolute path to the project file or relative path in regard to the package directory

execInCurrentPkgDir : boolean

Whether to treat relative references in the project like the project file “belongs” in the root of the current workspace’s package folder instead of its actual location.

filterExpression : str

A valid project filter expression

Returns:

Existing project

Return type:

Project

OpenProjectFromArchive(filename)

Extracts an existing project archive into the current workspace and opens the main project.

Parameters:
filename : str

Absolute path to the project archive file.

Returns:

Opened main project from extracted project archive

Return type:

Project

SearchProjects(searchCriteria, useExtendedMode=False)

Searches the current workspace and library workspaces for projects matching the given search criteria.

Parameters:
searchCriteria : str

The search criteria expressed in the ecu.test filter syntax. See section “Handling” => “Filter” of the ecu.test User Documentation.

useExtendedMode : boolean

If True, extended search strings are enabled. The default is False, meaning each word in the searchCriteria will be enclosed by wildcards and mapped to the filename. (e.g. “hello world” => “Name = ‘*hello*’ and Name = ‘*world*’”)

Returns:

All matching projects. If no project matches, an emtpy list is returned.

Return type:

list[Project]

Raises:

ApiError – If the searchCriteria has an illegal syntax.