1set(GO_FILES 2 nghttpx_http1_test.go 3 nghttpx_http2_test.go 4 server_tester.go 5) 6 7# XXX unused 8set(EXTRA_DIST 9 ${GO_FILES} 10 server.key 11 server.crt 12 alt-server.key 13 alt-server.crt 14 setenv 15 req-set-header.rb 16 resp-set-header.rb 17 req-return.rb 18 resp-return.rb 19) 20 21add_custom_target(itprep 22 COMMAND go get -d -v golang.org/x/net/http2 23 COMMAND go get -d -v github.com/tatsuhiro-t/go-nghttp2 24 COMMAND go get -d -v golang.org/x/net/websocket 25) 26 27# 'go test' requires both config.go and the test files in the same directory. 28# For out-of-tree builds, config.go is normally not placed next to the source 29# files, so copy the tests to the build directory as a workaround. 30set(GO_BUILD_FILES) 31if(NOT CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_CURRENT_BINARY_DIR) 32 foreach(gofile IN LISTS GO_FILES) 33 set(outfile "${CMAKE_CURRENT_BINARY_DIR}/${gofile}") 34 add_custom_command(OUTPUT "${outfile}" 35 COMMAND ${CMAKE_COMMAND} -E copy 36 "${CMAKE_CURRENT_SOURCE_DIR}/${gofile}" "${outfile}" 37 DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/${gofile}" 38 ) 39 list(APPEND GO_BUILD_FILES "${outfile}") 40 endforeach() 41endif() 42 43add_custom_target(it 44 COMMAND sh setenv go test -v 45 DEPENDS ${GO_BUILD_FILES} 46) 47