Essentially what I think is happening is that the WPILib gradle/intellisense is somehow not processing files in the src/test/cpp
folder. What first tipped me off to this is that for any files in this folder, intellisense reports it cannot open any WPILib specific files. It can find normal c++ files (although the browse path from the test folder finds them in the base /usr/include/c++/7
driectory, rather than in the one contained by wpilib/2022/roborio/arm-frc2022-linux-gnueabi
(for context I am using linux). It can also include files from other parts of the project, such as Robot.h. Basically it behaves exactly as though I had opened another c++ folder in VSCode that isnāt part of a WPILib project.
Additionally, when I try to induce a compile time error (such as by setting an integer equal to a string, ./gradlew build
compiles with no errors. The output of ./gradlew check
does include frUserProgramTest:cpp
as a source, but the output of ./gradlew build -console verbose
does not. When I try ./gradlew check -console verbose
, it shows frcUserProgramTest:cpp
as a source but doesnāt look to check it as a task (see below).
When I try to build a specific file with ./gradlew --build-file src/test/cpp/main.cpp
, I get a compiler error that says the ā#ā character in #include
is an āunexpected characterā. The line it errors on is the same as the first include statement, which does imply the test/cpp/main.cpp
file is being, read, but clearly it is not being parsed correctly. I donāt know what to make of that, and gradle does say this feature is deprecated so maybe thatās the problem; I just figured Iād include this in case it means anything.
I have tried re-installing WPILib several times and still run into the same problem. I tried this on my teammateās computer and he has the same issue as well.
If anyone knows anything about this issue, or if thereās something extra Iām supposed to do to set up the test environment that I donāt know about (I have enabled desktop support) please let me know!