• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
22add_custom_target(itprep
23  COMMAND go get -d -v golang.org/x/net/http2
24  COMMAND go get -d -v github.com/tatsuhiro-t/go-nghttp2
25  COMMAND go get -d -v golang.org/x/net/websocket
26)
27
28# 'go test' requires both config.go and the test files in the same directory.
29# For out-of-tree builds, config.go is normally not placed next to the source
30# files, so copy the tests to the build directory as a workaround.
31set(GO_BUILD_FILES)
32if(NOT CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_CURRENT_BINARY_DIR)
33  foreach(gofile IN LISTS GO_FILES)
34    set(outfile "${CMAKE_CURRENT_BINARY_DIR}/${gofile}")
35    add_custom_command(OUTPUT "${outfile}"
36      COMMAND ${CMAKE_COMMAND} -E copy
37              "${CMAKE_CURRENT_SOURCE_DIR}/${gofile}" "${outfile}"
38      DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/${gofile}"
39    )
40    list(APPEND GO_BUILD_FILES "${outfile}")
41  endforeach()
42endif()
43
44if(ENABLE_HTTP3)
45  set(GO_TEST_TAGS quic)
46endif()
47
48add_custom_target(it
49  COMMAND sh setenv go test -v --tags=${GO_TEST_TAGS}
50  DEPENDS ${GO_BUILD_FILES}
51)
52