return [list $home_dir $xdg_home_dir]
}
+# Restart GDB and ensure that there's no license text, we should just
+# drop straight to the prompt.
+proc check_gdb_startups_up_quietly { message } {
+ global gdb_prompt
+
+ gdb_exit
+ gdb_spawn
+
+ gdb_test_multiple "" $message {
+ -re "^$gdb_prompt $" {
+ pass $gdb_test_name
+ }
+ }
+}
+
save_vars { env(TERM) } {
# We need an ANSI-capable terminal to get the output.
setenv TERM ansi
check_gdb_startup_version_string none \
"check version string is unstyled using XDG_CONFIG_HOME"
}
+
+ # Create two directories to use for the quiet startup test.
+ set dirs [setup_home_directories "quiet" "set startup-quietly on"]
+ set home_dir [lindex $dirs 0]
+ set xdg_home_dir [lindex $dirs 1]
+
+ # Now arrange to use the fake home directory startup file.
+ save_vars { INTERNAL_GDBFLAGS env(HOME) env(XDG_CONFIG_HOME) } {
+ set INTERNAL_GDBFLAGS [string map {"-nx" ""} $INTERNAL_GDBFLAGS]
+
+ # Now test GDB when using the HOME directory.
+ set env(HOME) $home_dir
+ unset -nocomplain env(XDG_CONFIG_HOME)
+ check_gdb_startups_up_quietly \
+ "check GDB starts quietly using HOME"
+
+ # Now test using the XDG_CONFIG_HOME folder. We still need to
+ # have a HOME directory set otherwise GDB will issue an error
+ # about not knowing where to place the index cache.
+ set env(XDG_CONFIG_HOME) $xdg_home_dir
+ set env(HOME) $empty_home_dir
+ check_gdb_startups_up_quietly \
+ "check GDB starts quietly using XDG_CONFIG_HOME"
+ }
}