add C++ code for a test
File.executable? requires an absolute path.
refactoring for a function to format