Skip to content
Snippets Groups Projects
Commit 780c1a9c authored by Marc-Olivier Andrez's avatar Marc-Olivier Andrez
Browse files

show log when running Go tests

parent e9292627
No related branches found
No related tags found
No related merge requests found
......@@ -11,7 +11,7 @@ endif ()
function(gotest target source_dir test_source_files)
if (BUILD_TESTS)
add_test(NAME test-${target} COMMAND go test ${test_source_files}
add_test(NAME test-${target} COMMAND go test -v ${test_source_files}
WORKING_DIRECTORY ${source_dir})
set_tests_properties(test-${target} PROPERTIES LABELS "unit;all")
message(STATUS "Added test 'test-${target}'")
......
......@@ -9,6 +9,7 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"
"github.com/stretchr/testify/suite"
"fmt"
"io"
"net/http"
"net/http/httptest"
......@@ -105,6 +106,8 @@ func doRequest(path string, extra_params ...string) *httptest.ResponseRecorder {
mux := utils.NewRouter(listRoutes)
req, _ := http.NewRequest(m, ver+path, body)
fmt.Print(" req=")
fmt.Println(req)
w := httptest.NewRecorder()
mux.ServeHTTP(w, req)
return w
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment