platformio-core: The system cannot find the file specified

I am getting this issue (replicated in full below)when trying to run tests for my project (unity has been successfully installed). Related to having a space in the path name?

I am on PlatformIO Core, version 6.1.4

Full error output

 Executing task: C:\Users\David Stewart\.platformio\penv\Scripts\platformio.exe test --verbose --environment QUTy 

Collected 1 tests (*)

Processing * in QUTy environment
------------------------------------------------------------------------------------------------------------------
Building...


Testing...
[WinError 2] The system cannot find the file specified
--------------------------------------- QUTy:* [ERRORED] Took 1.63 seconds ---------------------------------------

==================================================== SUMMARY ====================================================
Environment    Test    Status    Duration
-------------  ------  --------  ------------
QUTy           *       ERRORED   00:00:01.627
=================================== 1 test cases: 0 succeeded in 00:00:01.627 ===================================

 *  The terminal process "C:\Users\David Stewart\.platformio\penv\Scripts\platformio.exe 'test', '--verbose', '--environment', 'QUTy'" terminated with exit code: 1. 
 *  Terminal will be reused by tasks, press any key to close it. 

Test file

#include <stdio.h>
#include <stdbool.h>
#include "unity.h"

void setUp(void)
{
    // set stuff up here
}

void tearDown(void)
{
    // clean stuff up here
}

void test_ex(void)
{
    UNITY_TEST_ASSERT_EQUAL_UINT(1, 2, 17, "Intentionally failing test to sanity check the test setup");    
}


int main(void)
{
    UNITY_BEGIN();
    RUN_TEST(test_ex);
    return UNITY_END();
}

Test folder structure

The source file with the tests in it is directly under the test/ directory in the project. image

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 21 (13 by maintainers)

Most upvoted comments

Any updates?

@davidjmstewart I’ve setup https://github.com/maxgerhardt/quty_unittest as a base project that referenced the fixed platform and adds a null-implementation to the needed unity functions. It compiles and PlatformIO wants to upload it. Try and make it work by giving it the actually needed UART implementation and test on your board.

Aha. On Linux, it directly gives away what it cannot find.

[Errno 2] No such file or directory: '/home/max/temp/quty/.pio/build/QUTy/program'

which seems to be at least referenced in https://github.com/cab202/quty/blob/ea7a16e5dde4452f20d82334d06aa60213ce791c/builder/main.py#L148-L150.

PIO might be confusing itself on what the test firmware to upload is.