diff options
author | Paul Phillips <paulp@improving.org> | 2016-03-01 10:37:51 -0800 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2016-03-01 10:40:40 -0800 |
commit | 8b5888fd2bc4e860c40cc6202f051777c3829d6a (patch) | |
tree | 33dfc56d33bf59fad3b95228925a678cec2c266f /src | |
parent | 4a63622308da64cb22f6fbd917fb6dcd6dd3542a (diff) | |
download | unison-8b5888fd2bc4e860c40cc6202f051777c3829d6a.zip unison-8b5888fd2bc4e860c40cc6202f051777c3829d6a.tar.gz unison-8b5888fd2bc4e860c40cc6202f051777c3829d6a.tar.bz2 |
Set the logfile pref during self test.
Otherwise it drops a unison.log file in $HOME, which is not cool.
Diffstat (limited to 'src')
-rw-r--r-- | src/uicommon.ml | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/uicommon.ml b/src/uicommon.ml index c6ebd53..620754b 100644 --- a/src/uicommon.ml +++ b/src/uicommon.ml @@ -550,13 +550,18 @@ let initPrefs ~profileName ~displayWaitMessage ~getFirstRoot ~getSecondRoot (* Install dummy roots and backup directory if we are running self-tests *) if Prefs.read runtests then begin + let tmpdir = makeTempDir ( "unison-selftest" ); + if Globals.rawRoots() = [] then Prefs.loadStrings [ - String.concat " = " ["root"; makeTempDir "test-a"]; - String.concat " = " ["root"; makeTempDir "test-b"] + String.concat "" [ "root = "; tmpdir; "a" ]; + String.concat "" [ "root = "; tmpdir; "b" ]; + String.concat "" [ "logfile = "; tmpdir; "unison.log" ]; ]; if (Prefs.read Stasher.backupdir) = "" then - Prefs.loadStrings [ String.concat " = " ["backupdir"; makeTempDir "test-backup"] ] + Prefs.loadStrings [ + String.concat "" [ "backupdir = "; tmpdir; "backup" ]; + ] end; (* Print the preference settings *) |