## What is Unity? Unity is a powerful unit testing framework for C language that is used in embedded software development. It is open-source and written entirely in ANSI-compliant C code, making it portable across platforms from 8-bit microcontrollers to 64-bit machines. ## Prerequisites 1. Experience with C programming. 2. Familiarity with Makefiles. 3. Background in embedded systems is a plus. ## Installing Unity There are two primary methods to set up Unity: 1. **Using Ceedling**: A build system for C projects based on Ruby's Rake build tool. 2. **Using Build Tools**: This includes options like CMake or Makefiles, which we'll cover in more detail later. ### 1. Installing Unity with Ceedling Build System Ceedling (build system) simplifies the process of using Unity in C projects by handling the build process and dependencies. Here's how to set it up: #### Steps for Installation: 1. **Install GNU GCC Compiler** Download and install the GCC compiler for your operating system. For Windows, you can find it [here-GCC](https://www.naukri.com/code360/library/gcc-compiler-for-windows). 2. **Install Ruby** Ensure you have Ruby version 1.8.6 or newer. You can download it from [Ruby Installer](https://rubyinstaller.org/). 3. **Install Ceedling** You can install Ceedling from the RubyGems package repository: ```bash gem install ceedling ``` Or from [Ruby Gems](http://rubygems.org/gems/ceedling). 4. **Verify Installation** Once installed, confirm that Ceedling is working by running: ```bash ceedling help ``` You should see an output similar to this: ![image](https://hackmd.io/_uploads/HJQo2t7Z1x.png) ### 2. Using Build Tools > In addition to Ceedling, Unity can be integrated with build tools such as CMake or Makefiles. This method will be covered in detail in future articles. ## Running Your First Test Suite Now that Unity is set up, let's run a sample project that’s fully tested to see how everything works. 1. Create an example project with Ceedling: ```bash ceedling example temp_sensor ``` 2. Navigate to the project directory and run the tests: ```bash cd temp_sensor ceedling test:all ``` 3. You'll see various files created and linked. At the end, you should get a test summary like this: ```bash -------------------- OVERALL TEST SUMMARY -------------------- TESTED: 47 PASSED: 47 FAILED: 0 IGNORED: 0 ``` **Don't worry** if it seems like a lot of details, this is just the beginning, and we'll dive deeper into how it works in future articles. See you in the next article! Bye for now.