commit 5bde47590bc2803fac92ad9b3362511f427d3c6a from: Mark Jamsek date: Sat Apr 15 11:34:29 2023 UTC tog: rename regress test script envvar As per stsp's idea: use a more descriptive name, and use the TOG_TEST_SCRIPT envvar both in tog.c and the test scripts. ok stsp@ commit - de7a51b7b8b94810307946710affa0f6e70de184 commit + 5bde47590bc2803fac92ad9b3362511f427d3c6a blob - 5d1923c4ca2250970b43c75113fe698afc43c8fa blob + e03be4c0dcc342c5c4bee7432c3f25219682d085 --- regress/tog/common.sh +++ regress/tog/common.sh @@ -62,7 +62,7 @@ widechar_commit() set_test_env() { - export GOT_TOG_TEST=$1 + export TOG_TEST_SCRIPT=$1 export TOG_SCR_DUMP=$2 if [ -n "${3}" ]; then blob - 902869a9ca413b91478973db6d9a321762064b65 blob + 04242def3c3bd1f7ec0b24922210fbedced28abb --- regress/tog/diff.sh +++ regress/tog/diff.sh @@ -31,7 +31,7 @@ test_diff_contiguous_commits() local head_id_truncated=`trim_obj_id 13 $head_id` local alpha_id=`get_blob_id $testroot/repo "" alpha` - cat <$testroot/diff_contiguous_commits + cat <$TOG_TEST_SCRIPT SCREENDUMP EOF @@ -94,7 +94,7 @@ test_diff_arbitrary_commits() local alpha_id=`get_blob_id $testroot/repo "" alpha` local new_id=`get_blob_id $testroot/repo "" new` - cat <$testroot/diff_arbitrary_commits + cat <$TOG_TEST_SCRIPT SCREENDUMP EOF blob - ebe153cb83ffd423e6db29b48c099f17ed6acdc9 blob + f48397af6cde738244b53c3c26263b6fa6031107 --- regress/tog/log.sh +++ regress/tog/log.sh @@ -25,7 +25,7 @@ test_log_hsplit_diff() local date=`date -u -r $author_time +"%a %b %e %X %Y UTC"` local ymd=`date -u -r $author_time +"%G-%m-%d"` - cat <$testroot/log_hsplit_diff + cat <$TOG_TEST_SCRIPT KEY_ENTER open diff view of selected commit S toggle horizontal split SCREENDUMP @@ -82,7 +82,7 @@ test_log_vsplit_diff() local blobid_alpha=`get_blob_id $testroot/repo "" alpha` local blobid_beta=`get_blob_id $testroot/repo "" beta` - cat <$testroot/log_vsplit_diff + cat <$TOG_TEST_SCRIPT KEY_ENTER open diff view of selected commit in vertical split SCREENDUMP EOF @@ -146,7 +146,7 @@ test_log_show_author() local commit1=`git_show_head $testroot/repo` local id1_len8=`trim_obj_id 32 $commit1` - cat <$testroot/log_show_author + cat <$TOG_TEST_SCRIPT @ toggle show author SCREENDUMP EOF @@ -186,7 +186,7 @@ test_log_scroll_right() local commit1=`git_show_head $testroot/repo` - cat <$testroot/log_scroll_right + cat <$TOG_TEST_SCRIPT l scroll right l scroll right SCREENDUMP @@ -219,7 +219,7 @@ test_log_hsplit_ref() local date=`date -u -r $author_time +"%a %b %e %X %Y UTC"` local ymd=`date -u -r $author_time +"%G-%m-%d"` - cat <$testroot/log_hsplit_ref + cat <$TOG_TEST_SCRIPT R open ref view S toggle horizontal split - reduce size of ref view split @@ -260,7 +260,7 @@ test_log_hsplit_tree() local date=`date -u -r $author_time +"%a %b %e %X %Y UTC"` local ymd=`date -u -r $author_time +"%G-%m-%d"` - cat <$testroot/log_hsplit_tree + cat <$TOG_TEST_SCRIPT T open tree view S toggle horizontal split j move selection cursor down one entry to "beta" @@ -306,7 +306,7 @@ test_log_logmsg_widechar() local commit1=`git_show_parent_commit $testroot/repo` local blobid=`get_blob_id $testroot/repo "" $(widechar_filename)` - cat <$testroot/log_logmsg_widechar + cat <$TOG_TEST_SCRIPT KEY_ENTER open selected commit in diff view F toggle fullscreen SCREENDUMP blob - e94969c6a9902f9b0f221e3e3dc2e5e2b10ff627 blob + b1b624c8f817efab9f0fca62e40bd69dab642202 --- tog/tog.c +++ tog/tog.c @@ -4168,7 +4168,7 @@ init_mock_term(const char *test_script_path) const struct got_error *err = NULL; if (test_script_path == NULL || *test_script_path == '\0') - return got_error_msg(GOT_ERR_IO, "GOT_TOG_TEST not defined"); + return got_error_msg(GOT_ERR_IO, "TOG_TEST_SCRIPT not defined"); tog_io.f = fopen(test_script_path, "re"); if (tog_io.f == NULL) { @@ -9738,7 +9738,7 @@ main(int argc, char *argv[]) * Test mode init must happen before pledge() because "tty" will * not allow TTY-related ioctls to occur via regular files. */ - test_script_path = getenv("GOT_TOG_TEST"); + test_script_path = getenv("TOG_TEST_SCRIPT"); if (test_script_path != NULL) { error = init_mock_term(test_script_path); if (error) {