I build a program for my Arduino for which i use alongside the .ino file also .cpp and .h files.
For these .cpp and .h files I build test cases with ArduinoUnit library.
In order to work neatly (the way i learned it at school) I have this folder structure:
(note: the names have been changed for this example)
Enable verbose mode when compiling. Navigate to the Testing.cpp file that is created from the Testing .ino file. Go up one level. Do you see the files you are trying to include?
PaulS, is this the location rule to follow? I think this has worked for me for .h libraries:
"filename" has to be in same folder as the .ino,
has to be the /libraries (/library ?) folder in the File:Preferences:sketchbook location
PaulS:
Enable verbose mode when compiling. Navigate to the Testing.cpp file that is created from the Testing .ino file. Go up one level. Do you see the files you are trying to include?
I did as you suggested. Verbose mode on, it lead me to something like:
/AppData/Local/Temp/build/sketch/Testing.ino.cpp
The basic problem is that the Arduino IDE copies your source code files to another directory before it tries to compile them and relative file references don't work in that situation - they are relative from the wrong place.
Absolute file references should work - but they can be a PITA for other reasons.
To solve a somewhat different problem I created a short Python program that copies my program files to a directory called ArduinoTemp and it renames my project file to ArduinoTemp.ino (so it matches the directory name to keep the IDE happy). Then it calls the IDE to verify or upload as required. This allows me to use a common .h file with two separate Arduino programs - one for a receiver and the other for the transmitter.
I suspect this general approach could be used to meet your need.