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