package adapters import ( "io" "log" "text/template" ) func UnitTemplate() *template.Template { tmpl, err := template.New("gtest_unit").Parse(` add_executable( {{.Cname}} {{.File}} {{.Srcs}} ) target_link_libraries( {{.Cname}} gtest_main ) gtest_discover_tests( {{.Cname}} ) `) if err != nil { log.Fatalf("Cannot load Gtest Unit Template %v", err) } return tmpl } func WriteCMakeBoiler(w io.Writer) { w.Write([]byte(` cmake_minimum_required (VERSION 3.1.0) project(PlanRGtestAdapter) include(FetchContent) FetchContent_Declare( googletest URL https://github.com/google/googletest/archive/609281088cfefc76f9d0ce82e1ff6c30cc3591e5.zip ) include(GoogleTest) FetchContent_MakeAvailable(googletest) `)) }