Purpose of Code-Based Test
Code-Based Test is a feature that takes a different approach from traditional unit and integration testing. Instead of configuring the test structure and data through the UI, it allows writing and executing tests directly based on test code.
This feature is useful in the following situations:
- When existing GTest-based test assets are available
- When code-level control or complex test logic such as conditional execution or looped tests is required
- When user-defined test code is more suitable than automatically generated tests
Key Features of Code-Based Test
CT supports the following key features of Code-Based Test:
- Enables creation and direct editing of test code based on C++.
- CT allows importing externally written GTest-style test code. If the test code contains unsupported GTest macros, some features may be limited.
- CT displays test results and logs in the [Code-Based Test View], [Console View], and [Coverage View], allowing result verification within CT.
- CT supports debugging of test cases using [Debug in VS Code].
Limitations and Considerations:
- Code-Based Test does not support C projects. It is available only in C++ projects.
- Code-Based Test requires toolchains such as GCC 5.0 or later, Visual Studio 2015 or later, and Clang 8.0 or later.
- Code-Based Test supports execution in “C/C++ Project from Docker Environment” and “Team Projects”.
- Code-Based Test cannot be executed in Target Environments.
Code-Based Test Usage
This document describes how to use Code-Based Test.
Need more help with this?
Don’t hesitate to contact us here.