]> git.notmuchmail.org Git - notmuch/commitdiff
test/libconfig: save and restore config file
authorDavid Bremner <david@tethera.net>
Sat, 11 Dec 2021 12:49:11 +0000 (08:49 -0400)
committerDavid Bremner <david@tethera.net>
Sat, 15 Jan 2022 19:49:00 +0000 (15:49 -0400)
Currently the config file is unusable for further tests requiring a
valid database path.

test/T590-libconfig.sh

index eb3034448116c45d0571f6c871f49760e4a52adc..089b4e58916326d87081943cb943d95c490ff02b 100755 (executable)
@@ -972,6 +972,7 @@ EOF
 test_expect_equal_file EXPECTED OUTPUT
 
 test_begin_subtest "open: database parameter overrides implicit config"
+cp $NOTMUCH_CONFIG ${NOTMUCH_CONFIG}.bak
 notmuch config set database.path ${MAIL_DIR}/nonexistent
 cat c_head3 - c_tail3 <<'EOF' | test_C ${MAIL_DIR}
   const char *path = NULL;
@@ -982,6 +983,7 @@ cat c_head3 - c_tail3 <<'EOF' | test_C ${MAIL_DIR}
   path = notmuch_database_get_path (db);
   printf ("path: %s\n", path ? path : "(null)");
 EOF
+cp ${NOTMUCH_CONFIG}.bak ${NOTMUCH_CONFIG}
 cat <<EOF> EXPECTED
 == stdout ==
 status: 0