Search code examples
testingopenwrt

Google Test inside OpenWrt


I'd like to execute GMOCK and GTEST tests inside OpenWRT. I have x86_64 machine. My package is for x32 device. I tried copy headers manually, but, of course, it does not work. It is important to run tests inside the device, this is the main reason.

Is it false that the only possible way for me is to compile inside the device?(Such approach is strongly not desired) If not, how to add gtest&gmock to the package?


Solution

  • You can make a custom package for gtest. Then use that as a dependency for your package. For the headers you will need to setup an InstallDev section in the gtest openwrt package makefile. Use this section to copy the header files to the staging directory where they can be used by your package for compilation.

    Follow the documentation for openwrt here: https://openwrt.org/docs/guide-developer/packages#use_packed_source_code_archive