Home | History | Annotate | Line # | Download | only in gdb.dap
      1 # Copyright 2024 Free Software Foundation, Inc.
      2 
      3 # This program is free software; you can redistribute it and/or modify
      4 # it under the terms of the GNU General Public License as published by
      5 # the Free Software Foundation; either version 3 of the License, or
      6 # (at your option) any later version.
      7 #
      8 # This program is distributed in the hope that it will be useful,
      9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
     10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     11 # GNU General Public License for more details.
     12 #
     13 # You should have received a copy of the GNU General Public License
     14 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
     15 
     16 # Test that EOF is handled gracefully.
     17 
     18 require allow_dap_tests
     19 
     20 load_lib dap-support.exp
     21 
     22 # The test doesn't matter much.
     23 standard_testfile scopes.c
     24 
     25 if {[build_executable ${testfile}.exp $testfile $srcfile] == -1} {
     26     return
     27 }
     28 
     29 if {[dap_initialize] == ""} {
     30     return
     31 }
     32 
     33 catch "close -i $gdb_spawn_id"
     34 catch "wait -i $gdb_spawn_id"
     35 unset gdb_spawn_id
     36 
     37 dap_check_log_file
     38 
     39 # Check that first log message is present.
     40 dap_check_log_file_re [string_to_regexp "starting DAP server"]
     41 
     42 # There should be one "READ:" for the initialize request, and at least one
     43 # "WROTE:" for the initialize response.
     44 dap_check_log_file_re "READ:"
     45 dap_check_log_file_re "WROTE:"
     46 
     47 # Check that all thread termination messages are there.
     48 dap_check_log_file_re "JSON writer: terminating"
     49 dap_check_log_file_re "DAP: terminating"
     50