Skip to content

feat(test): add basic testing suite along with user DSPQueue Test Cases - #376

Open
Dhruv Menon (malto101) wants to merge 5 commits into
qualcomm:developmentfrom
malto101:intro-test
Open

feat(test): add basic testing suite along with user DSPQueue Test Cases#376
Dhruv Menon (malto101) wants to merge 5 commits into
qualcomm:developmentfrom
malto101:intro-test

Conversation

@malto101

Copy link
Copy Markdown
Contributor
  • Add base_test directory with a comprehensive CMake build system supporting Linux (aarch64) and Android (API 35) target platforms
  • Integrate Unity test framework as a git submodule under test/base_test/vendor/unity for unit testing
  • Include platform-specific CMake toolchain configurations for cross-compilation targeting linux and android
  • Add XML stream writer utility for structured test reporting output
  • Provide BASIC documentation in CMakeLists.txt covering quick start, running tests, and instructions for adding new test suites or individual test cases

@quic-vkatoch

Copy link
Copy Markdown
Contributor

Dhruv Menon (@malto101), can we split this single commit into multiple independent, incremental commits? It'll be easier to review.

@malto101

Copy link
Copy Markdown
Contributor Author

Dhruv Menon (Dhruv Menon (@malto101)), can we split this single commit into multiple independent, incremental commits? It'll be easier to review.

updated it

- Add root CMakeLists.txt with full quick-start, run, and extension docs
- Register Unity test framework as a git submodule under vendor/unity
- Add platform-specific CMake toolchain files for Linux (aarch64) and
  Android (API 35) cross-compilation
- Add bin/CMakeLists.txt to produce deployable test binary artifacts
- Add README.md with developer quick-start and contribution guide

Signed-off-by: Dhruv Menon <dhrumeno@qti.qualcomm.com>
- Add streaming XML writer with layered architecture:
  streaming/ core writer, core/ data model, config/ configuration,
  error/ error handler, logging/ logger, facade/ public output API
- Add utils/CMakeLists.txt to build xml_writer and future util targets
- Utility is standalone with no dependency on test logic

Signed-off-by: Dhruv Menon <dhrumeno@qti.qualcomm.com>
- Add Allure reporter (unity_allure_output) for structured test output
- Add Unity fixture file reporter (unity_fixture_file_output)
- Add shared fastrpc_utils (test_utils) with common test helpers
- Add log_capture utility for capturing DSP/kernel log output
- All utilities are consumed by both unit and feature test suites

Signed-off-by: Dhruv Menon <dhrumeno@qti.qualcomm.com>
- Add fastrpc_test.idl defining the test RPC interface contract
- Add AEEStdDef.idl and remote.idl as base IDL type dependencies
- Add fastrpc_test_imp.c as the DSP-side stub implementation
- Add idl/CMakeLists.txt to compile and link the IDL stub

Signed-off-by: Dhruv Menon <dhrumeno@qti.qualcomm.com>
- Add root_all_tests.c as the top-level test runner entry point
- Add unit tests for all DSPQueue API functions:
  create, close, write, read, peek, export, get_stat
- Add feature tests covering end-to-end DSPQueue flows:
  echo flow, buffer management, data processing flow
- Add dspqueue_feature_utils for shared feature test helpers
- Add scripts/generate_report.sh for post-run report generation
- Add CMakeLists.txt for both unit/ and feature/ test directories

Signed-off-by: Dhruv Menon <dhrumeno@qti.qualcomm.com>
@@ -0,0 +1,114 @@
# Copyright (c) 2024, Qualcomm Innovation Center, Inc. All rights reserved.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use year-less copyright

# Copyright (c) 2024, Qualcomm Innovation Center, Inc. All rights reserved.
# SPDX-License-Identifier: BSD-3-Clause
#
# bin/CMakeLists.txt

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this file really needed? Is it possible to stick with automake? Or do you think using cmake is better here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CMake is not strictly necessary, but it is genuinely the better tool for what base_test is doing. Migrating it to Automake is possible but would cost you real things.

  • submodule integration: Cmake makes it a 1 liner
  • CONFIGURE_DEPENDS auto-discovery -> makes it easier to create new test/auto discovers tests without hardcoding file source into build files for every new addition
  • Each layer propagates include paths and compile definitions transitively via target_include_directories(... INTERFACE ...).
unity_dep → utils_dep → fastrpc_dep → common_test_dep → suite libs → test_fastrpc

In Automake, there is no equivalent — you would have to repeat _CFLAGS and _LDADD on every binary, or use a shared AM_CFLAGS that applies globally

  • each platform file sets the full LLVM toolchain (clang, ld.lld, llvm-ar, etc.) and the right --target= triple. Under Automake this is done by ./configure --host=aarch64-linux-gnu or --host=aarch64-linux-android, which works but the Android NDK path resolution (ANDROID_NDK_HOME) and the NDK clang wrapper name (aarch64-linux-android35-clang) would need custom AC_ARG_WITH and AC_SUBST logic in configure.ac.

if i do move to automake, can we saperate it from top level automake build? because
the tests are architecturally a standalone consumer project, not part of the library build

@@ -0,0 +1,73 @@
# Copyright (c) 2024, Qualcomm Innovation Center, Inc. All rights reserved.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

year-less copyright everywhere

@@ -0,0 +1,91 @@
#ifndef AEESTDDEF_IDL

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there are plans to bring this IDL here: #356

can you use the same one?

@@ -0,0 +1,32 @@
interface remote_handle64 {
/**
* Opens the handle in the specified domain. If this is the first

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same comment as above

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants