Error running the makefile · Issue #776 · ThrowTheSwitch/Unity · GitHub
Skip to content

Error running the makefile #776

Open

Description

@CCarbone-Farid

I'm interested in implementing Unity to test my code, I'm working on a embedded C firmware for a microcontroller. To do this I tried modifying the makefile of my project to include the test folder, but found that this was not the best way. I then tried to create my own makefile, so I copied it from the Example2 folder, but got some errors. So for this reason i decided to start over and download your repo and try to run the makefile of example 2, but again i got the following errors:

Image

process_begin: CreateProcess(NULL, uname -s, ...) failed. make: makefile:10: pipe: No error process_begin: CreateProcess(NULL, uname -s, ...) failed. make: makefile:25: pipe: No error del /F /Q all_tests.exe Impossibile trovare C:\VSCodeProjects\Template-prova3-backup\Unity-master\examples\example_2\all_tests.exe gcc -std=c99 -Wall -Wextra -Wpointer-arith -Wcast-align -Wwrite-strings -Wswitch-default -Wunreachable-code -Winit-self -Wmissing-field-initializers -Wno-unknown-pragmas -Wstrict-prototypes -Wundef -Wold-style-definition -Isrc -I../../src -I../../extras/fixture/src -DUNITY_FIXTURE_NO_EXTRAS ../../src/unity.c ../../extras/fixture/src/unity_fixture.c src/ProductionCode.c src/ProductionCode2.c test/TestProductionCode.c test/TestProductionCode2.c test/test_runners/TestProductionCode_Runner.c test/test_runners/TestProductionCode2_Runner.c test/test_runners/all_tests.c -o all_tests.exe process_begin: CreateProcess(NULL, gcc -std=c99 -Wall -Wextra -Wpointer-arith -Wcast-align -Wwrite-strings -Wswitch-default -Wunreachable-code -Winit-self -Wmissing-field-initializers -Wno-unknown-pragmas -Wstrict-prototypes -Wundef -Wold-style-definition -Isrc -I../../src -I../../extras/fixture/src -DUNITY_FIXTURE_NO_EXTRAS ../../src/unity.c ../../extras/fixture/src/unity_fixture.c src/ProductionCode.c src/ProductionCode2.c test/TestProductionCode.c test/TestProductionCode2.c test/test_runners/TestProductionCode_Runner.c test/test_runners/TestProductionCode2_Runner.c test/test_runners/all_tests.c -o all_tests.exe, ...) failed. make (e=2): Impossibile trovare il file specificato. makefile:65: recipe for target 'default' failed make: *** [default] Error 2

I don't understand how to solve this after some attempts and I'm not sure I'm following the right way to test my code with unity. I'm aware that there is a script that generates a test runner but i'm not familiar with ruby and I can't implement something i dont understand

Activity

  1. Letme commented on Apr 17, 2025

    @Letme
    Contributor

    Seems like you are missing some tools (uname returns an error based on your screenshot) in your windowz powershell. Is there any reason why you want to stick with Makefile if you have trouble with it? Ceedling is probably the more user-friendly solution to generating a test runner and mocking than using Unity from scratch.

  2. memphis242 commented on Apr 17, 2025

    @memphis242

    I had issues with ThrowTheSwitch's Makefile example as well, though the example I looked at was from the ThrowTheSwitch.org page. Here's my working example for a personal project, although it's got more than just the test build in it. If you have questions on it, let me know. I've run this in Windows Powershell, git bash, and another bash terminal just fine, since I work from multiple laptops sometimes with different systems. Also, this file is a work-in-progress as I go about my project, but the test portion won't change soon until I try out mocking.

    Although I might try Ceedling at some point, I'm sticking with the Makefile I have for now because at the end of the day, it really should be no different than adding another source file to a build. I haven't gotten into mocking just yet.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions