require 'gem2deb/rake/testtask'

Gem2Deb::Rake::TestTask.new do |t|
  t.libs = ['test']
  t.test_files = FileList['test/**/*_test.rb'] + FileList['test/**/test_*.rb'] - FileList[
    'test/test_integration_cluster.rb',
    'test/test_worker_gem_independence.rb',
    'test/test_rack_version_restriction.rb',
    'test/test_preserve_bundler_env.rb',
    'test/test_plugin.rb',
  ]
  t.verbose = true
end.tap do |t|
  exclude = %w[
    test_application_logs_are_flushed_on_write
    test_hot_restart_does_not_drop_connections
    test_logs_all_localhost_bindings
    test_multiple_requests_waiting_on_less_busy_worker
    test_term_not_accepts_new_connections
    test_prune_bundler_with_multiple_workers
    test_closed_listener
    test_phased_restart_cluster
    test_refork_cluster
    test_control_gc_stats_tcp
    test_control_gc_stats_unix
    test_systemd_notify_usr2_hot_restart_single
    test_systemd_cluster_notify
    test_systemd_notify
    test_systemd_watchdog
    test_ssl_run
    test_ssl_run_with_pem
    test_ssl_run_with_encrypted_pem
    test_ssl_run_with_encrypted_key
    test_ssl_run_with_localhost_authority
    test_ssl_run_with_curl_client
    test_verify_client_cert_roundtrip
    test_verify_client_cert_roundtrip_tls1_2
    test_dflt
    test_dflt_tls1_2
    test_dflt_tls1_3
    test_off_tls1_3
    test_1000_10_tls1_2
    test_1000_tls1_2
    test__10_tls1_2
    test_sighup_redirects_io_single
    test_int_refuse
    test_after_booted_and_after_stopped
    test_usr2_restart
    test_usr2_restart_restores_environment
    test_term_exit_code
    test_term_suppress
    test_puma_started_log_writing
    test_puma_started_log_writing_with_custom_logging
    t test_write_to_log
    test_require_dependencies
    test_http_11_req_oversize_content_length
    test_chunked_keep_alive_two_back_to_back
    test_illegal_character_in_value_when_override_content_length
    test_update_thread_pool_min_max
    test_back_to_back_chunked
    test_form_data_encoding_windows
    test_form_data_encoding_windows_bom
    test_socket_activation_unix
    test_home_alters_listeners_for_tcp_addresses
  ]
  t.options << ' ' << "-e'/" << exclude.join('|') << "/'"
end
