OSLC Analyser for Unite
Project description
unic4py
unic4py is a Python module intended as an adapter
for transforming non-interactive command-line analysis tools to
OSLC-compliant web services
Installation
To use unic4py, install it using pip:
pip install unic4py
Additionally, ensure that the oslc4py-client and oslc4py-domains-auto dependencies are installed:
pip install oslc4py-client oslc4py-domains-auto
Features
The unic4py module includes the following main classes:
UniteAnalyser: A utility class for registering, compiling, and analyzing systems under test (SUTs).SUT: A resource representation of a system under test, designed with OSLC principles.
Example Usage
Using UniteAnalyser for Compilation and Analysis
from unic4py.UniteAnalyser import UniteAnalyser
# Initialize the UniteAnalyser with the server's base URL and ports
analyser = UniteAnalyser("http://example.com", "8081", "8080")
# Set up compilation and analysis arguments
analyser.add_compilation_argument("sourceBase64", "encoded_source_code_here")
analyser.add_analysis_argument("SUT", "http://example.com:8080/compilation/services/resources/sUTs/155")
# Specify the analysis tool to use
analyser.pass_data['analysis_tool'] = "infer"
# Run the analysis
analyser.analyse()
UniteAnalyser Class
The UniteAnalyser class automates the process of registering, compiling, and analyzing SUTs. It uses the OSLCPythonClient for communicating with OSLC servers.
Methods
__init__
def __init__(self, unite_url, compilation_port, analysis_port)
- Initializes the analyser with the base URL and ports for compilation and analysis services.
add_compilation_argument
def add_compilation_argument(self, name, value)
- Adds an argument for the compilation process.
add_analysis_argument
def add_analysis_argument(self, name, value)
- Adds an argument for the analysis process.
analyse
def analyse(self)
- Executes the full pipeline: registering the SUT, checking its registration, performing the analysis, and retrieving the result.
register_sut
def register_sut(self)
- Registers the system under test (SUT) using a compilation request.
check_sut_registration
def check_sut_registration(self)
- Verifies the SUT registration by polling the compilation results.
perform_analysis
def perform_analysis(self)
- Sends an analysis request for the registered SUT.
get_analysis_result
def get_analysis_result(self)
- Retrieves the results of the analysis.
SUT Class
The SUT class represents a System Under Test resource and provides properties for working with OSLC-compliant resources.
Key Properties
launch_command: The command used to launch the system under test.build_command: The command used to build the system under test.title: The title of the system under test.description: A description of the system under test.identifier: A unique identifier for the system under test.sut_directory_path: Path to the directory containing the SUT.compiled: Indicates whether the SUT has been compiled.produced_by_automation_request: Link to the automation request that produced this SUT.
Notes
- Ensure the
OSLC4PY_ACTIVE_INSTALLED_DOMAINSorOSLC4PY_EXTRA_DOMAINS_DIRenvironment variables are set if additional class discovery is needed. - Dependencies:
oslc4py-clientoslc4py-domains-auto
Install dependencies using:
pip install oslc4py-client oslc4py-domains-auto
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file unic4py-0.1.4.tar.gz.
File metadata
- Download URL: unic4py-0.1.4.tar.gz
- Upload date:
- Size: 10.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ada717f72e82d36796dee5e9e84611c5403ca9100236cde2d354da16ce4e02e7
|
|
| MD5 |
606f767bf13c293e8c14a1ee77c4a553
|
|
| BLAKE2b-256 |
f1c391e72b51617fc2736ed7f7bc82cd8463d1a175e70f167c8323258ba03f8b
|
File details
Details for the file unic4py-0.1.4-py3-none-any.whl.
File metadata
- Download URL: unic4py-0.1.4-py3-none-any.whl
- Upload date:
- Size: 11.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a50da75dc856ee1bb28f700b37349a85de1af07a82192f7a1667132f68c4850b
|
|
| MD5 |
6f68686f01a7142362b96349e0caeae3
|
|
| BLAKE2b-256 |
55b20a53b6d4071683a533c9a54c715304f7e6551f616692bca41b7b48a6752d
|