From 09d9565183cb934ccbfe3325ff392a6b1b829ee9 Mon Sep 17 00:00:00 2001 From: "Dave Musicant (home machine)" Date: Sun, 4 Dec 2022 09:24:57 -0600 Subject: [PATCH] start test with gitwatch launching --- othertests/tryit.bats | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/othertests/tryit.bats b/othertests/tryit.bats index 42050b7..fc85975 100644 --- a/othertests/tryit.bats +++ b/othertests/tryit.bats @@ -8,5 +8,38 @@ load startup-shutdown function commit_log_messages_working { #@test + # Start up gitwatch with logging, see if works + "${BATS_TEST_DIRNAME}"/../gitwatch.sh -l 10 "$testdir/local/remote" 3>&- & + GITWATCH_PID=$! + echo "Test complete" } + +# function commit_log_messages_working { #@test +# # Start up gitwatch with logging, see if works +# "${BATS_TEST_DIRNAME}"/../gitwatch.sh -l 10 "$testdir/local/remote" 3>&- & +# GITWATCH_PID=$! + +# # Keeps kill message from printing to screen +# disown + +# # Create a file, verify that it hasn't been added yet, then commit +# cd remote + +# # According to inotify documentation, a race condition results if you write +# # to directory too soon after it has been created; hence, a short wait. +# sleep 1 +# echo "line1" >> file1.txt + +# # Wait a bit for inotify to figure out the file has changed, and do its add, +# # and commit +# sleep "$WAITTIME" + +# # Make a new change +# echo "line2" >> file1.txt +# sleep "$WAITTIME" + +# # Check commit log that the diff is in there +# run git log -1 --oneline +# [[ $output == *"file1.txt"* ]] +# }