Skip to content

This repo contains shared testing resources for XMC-for-Arduino and arduino-core-psoc.

License

Notifications You must be signed in to change notification settings

Infineon/arduino-core-tests

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Infineon_arduino_core_unity_test

Repo as shared ardino core tests using unity platform.

Pre-conditions

Before running Unity tests, please ensure the following pre-conditions are met:

  1. Install Arduino CLI:

    • Download and install Arduino CLI. You can download the Windows version of Arduino CLI from the following link: Arduino CLI Download Link
    • Add arduino-cli.exe to your system's PATH environment variable to access it from the command line.
  2. Update submodule:

    • The Unity test framework is included as submodule in this project. The Unity test framework files should be located in the unity folder. Run git submodule update --init --recursive to update them. If you are nor familiar with submodules, check out: https://git-scm.com/book/en/v2/Git-Tools-Submodules

Usage

Build and Upload Test Code

Currently this test set relies only on arduino-cli for all compilation and uploading. Unity is included as a library, and the starting point for the tests is still in the arduino-specific .ino file.

Please refer to the Makefile and its comments for details.

Test Architecture

  • all test source file naming follow the conventions, e.g.test_module_connection_testname.cpp. The make target also have same name, e.g. test_module_connection_testname.
  • The preprocessor macro / test flag is all uppercase, e.g. TEST_MODULE_CONNECTION_TESTNAME.
  • The naming of test goup and all related functions removes prefix test, e.g. module_connection_testname.
  • TEST_IFX() is used for define test case. There is no naming convention for test case. As long as it explains the functionality to be tested. test_architecture

Folder stucture

└───arduino-core-tests
    │   .gitignore
    │   .gitmodules
    │   LICENSE
    │   Makefile // define test target and preprocessor macros/ test flag. 
    │   README.md
    │
    ├───build
    │
    ├───src
    │   │   test_common_includes.h
    │   │   test_main.ino // starting point of tests,
    │   │                 // selecting the test group according to the 
    │   │                 // test flag define in Makefile.
    │   │   unity_config.h
    │   │   unity_ifx.cpp
    │   │   unity_ifx.h
    │   │
    │   ├───corelibs // Tests for all Built-in library and core modules
    │   │   ├───module // module name, lower case!
    │   │   │       test_module_connection_name1.cpp
    │   │   │       test_module_connection_name2.cpp
    │   │   │       test_module_single.cpp
    │   │   │
    │   │   ├───can 
    │   │   │       test_can_connected2_node1.cpp
    │   │   │       test_can_connected2_node2.cpp
    │   │   │       test_can_single.cpp
    │   │   │
    │   │   ├───wire 
    │   │   │       test_wire_connected1_pingpong.cpp
    │   │   │       test_wire_connected2_masterpingpong.cpp
    │   │   │       test_wire_connected2_slavepingpong.cpp
    │   │   │
    │   │   └───....
    │   │           
    │   │    
    │   │
    │   └───utils
    │           utilities.cpp
    │           utilities.hpp
    │
    └───Unity
└───hil-unity-checklist.yaml // project specific test list to run in CI/CD HIL setup
└───test_config.h // project specific test configurations, e.g. test pins

About

This repo contains shared testing resources for XMC-for-Arduino and arduino-core-psoc.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •