Escape backslash in windows path
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.base / setshow.exp
index 661431c546906f048dfcfbf3ccdde4d290bd775b..639ca723ad9ec554b45e7cbe42f8849034758b18 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright 1992-2013 Free Software Foundation, Inc.
+# Copyright 1992-2014 Free Software Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -165,11 +165,38 @@ gdb_test_no_output "set height unlimited"
 gdb_test_no_output "set history expansion on" "set history expansion on" 
 #test show history expansion on
 gdb_test "show history expansion on" "History expansion on command input is on.*" "show history expansion" 
+#get home directory path
+set HOME ""
+set test "show environment HOME"
+gdb_test_multiple $test $test {
+    -re "\nHOME = (\[^\r\n\]*)\[\r\n\]+$gdb_prompt $" {
+        set HOME $expect_out(1,string)
+        pass $test
+    }
+}
+#test set history filename ~/foobar.baz
+gdb_test_no_output "set history filename ~/foobar.baz" \
+    "set history filename ~/foobar.baz"
+#test show history filename ~/foobar.baz
+gdb_test "show history filename" \
+    "The filename in which to record the command history is \"[string_to_regexp $HOME]/foobar.baz\"..*" \
+    "show history filename (~/foobar.baz)"
+#get current working directory
+set PWD ""
+set test "show working directory"
+gdb_test_multiple "pwd" $test {
+    -re "\nWorking directory (\[^\r\n\]*)\\.\[\r\n\]+$gdb_prompt $" {
+        set PWD $expect_out(1,string)
+        pass $test
+    }
+}
 #test set history filename foobar.baz
 gdb_test_no_output "set history filename foobar.baz" \
-    "set history filename foobar.baz" 
+    "set history filename foobar.baz"
 #test show history filename foobar.baz
-gdb_test "show history filename" "The filename in which to record the command history is \"foobar.baz\"..*"  "show history filename (foobar.baz)" 
+gdb_test "show history filename" \
+    "The filename in which to record the command history is \"[string_to_regexp $PWD]/foobar.baz\"..*" \
+    "show history filename (current_directory/foobar.baz)"
 #test set history save on
 gdb_test_no_output "set history save on" "set history save on" 
 #test show history save on
This page took 0.025137 seconds and 4 git commands to generate.