Merge branch 'release-2.140.126' 2.140.126
authorChris Koeritz <cak0l@virginia.edu>
Thu, 20 Aug 2020 13:27:42 +0000 (09:27 -0400)
committerChris Koeritz <cak0l@virginia.edu>
Thu, 20 Aug 2020 13:27:42 +0000 (09:27 -0400)
14 files changed:
infobase/fortunes.dat
production/feisty_meow_config.ini
scripts/archival/snarf_notes.pl
scripts/core/functions.sh
scripts/processes/pszap.sh
testkit/doc/makefile [new file with mode: 0644]
testkit/doc/rebrand.sh [new file with mode: 0644]
testkit/doc/testkit_reference-source.html [new file with mode: 0644]
testkit/doc/testkit_reference.html
testkit/examples/blank_test.sh
testkit/examples/fred-testkit.config
testkit/makefile
testkit/prepare_tools.sh
testkit/testkit.config

index 19252d88631d7ccb91f70d3d0cacf05fc4f96c19..1c983a9237f7c192501bf3f51618cc7dc3a4a188 100644 (file)
@@ -43909,4 +43909,8 @@ So all the "lefthanders" stay away and do not disturben the brainstorming von
 here working intelligencies.
 Otherwise you will be out thrown and kicked anderswhere!
 Also: please keep still and only watchen astaunished the blinkenlights.
-
+~
+Naval Lint!  Belly up to the finest barnacle scrub on the market, and have
+your teams boat bright as a button!
+Only $9.99 a bottle, sold at all Ben Franklin Department Stores.
+  -- fictional product developed due to misspelling of navel lint
index 81ff4b6a6824ed93bda20713b4559a09dbe679be..38cd778096db755b2cf938dc6b11aaf0468eb266 100644 (file)
@@ -3,7 +3,7 @@
 # specifies the version of the code that is being constructed here.
 major=2
 minor=140
-revision=125
+revision=126
 build=420
 
 # specifies the remainder of the version record info.
index 56fe7a6fc51ae5a786ee4d8fdddfd2cecd0b6819..b14d05d7dd876055926c3006aca564fda32ece4e 100644 (file)
@@ -42,10 +42,12 @@ local($snarf_file) = &snarf_name($snarf_file_base, $number);
 
 # gather any directories in our home that match these often recurring patterns.
 &snarf_by_pattern($snarf_file_base, "$root", "crucial");
+&snarf_by_pattern($snarf_file_base, "$root", "Documents");
 &snarf_by_pattern($snarf_file_base, "$root", "idea");
 &snarf_by_pattern($snarf_file_base, "$root", "issue");
 &snarf_by_pattern($snarf_file_base, "$root", "list");
 &snarf_by_pattern($snarf_file_base, "$root", "note");
+&snarf_by_pattern($snarf_file_base, "$root", "nuage");
 &snarf_by_pattern($snarf_file_base, "$root", "project");
 &snarf_by_pattern($snarf_file_base, "$root", "task");
 &snarf_by_pattern($snarf_file_base, "$root", "invention");
index db08274fadf8bb762d5bf9f6030c48fa5afa018b..28c2f05822fc851b0f0025cc09147ef806bdde43 100644 (file)
@@ -239,26 +239,51 @@ if [ -z "$skip_all" ]; then
   ##############
 
   # locates a process given a search pattern to match in the process list.
-  # supports a single command line flag style parameter of "-u USERNAME";
-  # if the -u flag is found, a username is expected afterwards, and only the
-  # processes of that user are considered.
+  #
+  # + the -u flag specifies a user name, e.g. "-u joe", which causes only
+  #   the processes of that user "joe" to be considered.
+  #
+  # + the -x flag specifies a pattern to exclude from the list, e.g. "-x pszap.sh"
+  #   would ignore any processes that mention the phrase "pszap.sh".
   function psfind() {
+    local user_flag="-e"
+      # default user flag is for all users.
+    local excluder="ScrengeflebbitsAPhraseWeNeverExpecttomatchanythingYO298238"
+      # for our default, pick an exclusion string we would never match.
+
+    local found_flag=1
+    while [ $found_flag -eq 1 ]; do
+      # reset our sentinel now that we're safely in our loop.
+      found_flag=0
+
+      # save the first argument, since we're going to shift the args.
+      local arg1="$1"
+      if [ "$arg1" == "-u" ]; then
+        # handle the user flag.
+        user_flag="-u $2" 
+#echo "found a -u parm and user=$2" 
+        found_flag=1  # signal that we found one.
+        # skip these two arguments, since we've consumed them.
+        shift
+        shift
+      elif [ "$arg1" == "-x" ]; then
+        # handle the exclusion flag.
+        excluder="$2" 
+#echo "found a -x parm and excluder=$excluder" 
+        found_flag=1  # signal that we found one.
+        # skip these two arguments, since we've consumed them.
+        shift
+        shift
+      fi
+    done
+
+    # now that we've yanked any flags out, we can pull the rest of the
+    # arguments in as patterns to seek in the process list.
     local -a patterns=("${@}")
 #echo ====
 #echo patterns list is: "${patterns[@]}"
 #echo ====
 
-    local user_flag
-    if [ "${patterns[0]}" == "-u" ]; then
-      user_flag="-u ${patterns[1]}" 
-#echo "found a -u parm and user=${patterns[1]}" 
-      # void the two elements with that user flag so we don't use them as patterns.
-      unset patterns[0] patterns[1]=
-    else
-      # select all users.
-      user_flag="-e"
-    fi
-
     local PID_DUMP="$(mktemp "$TMP/zz_pidlist.XXXXXX")"
     local -a PIDS_SOUGHT
 
@@ -287,8 +312,10 @@ if [ -z "$skip_all" ]; then
     # ids out of the results.
     local i
     for i in "${patterns[@]}"; do
+#echo "pattern curr is '$i'"
       PIDS_SOUGHT+=($(cat $PID_DUMP \
         | grep -i "$i" \
+        | grep -v "$excluder" \
         | sed -n -e "$pid_finder_pattern"))
     done
 #echo ====
index 31e119f838bd215c738e2f786f5aa2377e25ef05..93b137b9be49cc97963b2b67d9eae5e4256007d0 100644 (file)
@@ -6,7 +6,9 @@ fi
 
 source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh"
 
-PIDLIST=$(psfind $1)
+SCRIPT_NAME="pszap.sh"
+
+PIDLIST=$(psfind -x $SCRIPT_NAME $1)
 #echo "PIDS are $PIDLIST"
 if [ -z "$PIDLIST" ]; then
   echo "Your process name was not found in the system."
diff --git a/testkit/doc/makefile b/testkit/doc/makefile
new file mode 100644 (file)
index 0000000..7bc9877
--- /dev/null
@@ -0,0 +1,5 @@
+
+all: testkit_reference.html
+
+testkit_reference.html: testkit_reference-source.html
+       @bash rebrand.sh
diff --git a/testkit/doc/rebrand.sh b/testkit/doc/rebrand.sh
new file mode 100644 (file)
index 0000000..093a1f1
--- /dev/null
@@ -0,0 +1,17 @@
+#!/bin/bash
+
+# makes a new copy of the testkit reference with branding info installed.
+
+echo "Rebranding the TestKit reference for: $TESTKIT_BRANDING"
+
+# pull in our testkit config.
+source ../prepare_tools.sh ../prepare_tools.sh 
+source $TESTKIT_ROOT/library/process_configuration.sh
+define_and_export_variables
+
+# just a search and replace.  the source doc had better still have "$BRANDING" tags in it.
+sed -e "s/\$BRANDING/$TESTKIT_BRANDING/g" \
+  < testkit_reference-source.html \
+  > testkit_reference.html
+
+
diff --git a/testkit/doc/testkit_reference-source.html b/testkit/doc/testkit_reference-source.html
new file mode 100644 (file)
index 0000000..255738b
--- /dev/null
@@ -0,0 +1,280 @@
+<html>
+  <head>
+    <meta http-equiv="content-type" content="text/html; charset=utf-8">
+    <title>TestKit Reference Manual</title>
+  </head>
+  <body vlink="purple" link="blue" lang="EN-US">
+    <h1 style=" text-align:center">$BRANDING TestKit Reference Manual</h1>
+    <h3 style=" text-align:center">Author: Chris Koeritz</h3>
+    <address style=" text-align:center"> Version 1.0 ― Updated August 14 2020</address>
+    <h1>The $BRANDING TestKit</h1>
+    <p>The TestKit is a collection of scripts that leverages the ShUnit unit
+      testing environment.&nbsp; The TestKit provides a pattern for creating
+      test suites using a simple configuration file approach.&nbsp; Full
+      reporting on test runs is provided in a convenient tabular format.</p>
+    <p>Generally, writing a test script using the TestKit is a matter of
+      minutes.&nbsp; A blank test is provided as a template, and that can be
+      expanded with whatever test steps are needed.</p>
+    <p>TestKit (and ShUnit) are implemented in the GNU Bash script language, but
+      a TestKit test script can invoke external applications, written in
+      whatever programming language or scripting tool is desired, using the
+      standard POSIX interfaces.<br>
+    </p>
+    <h2> Getting the TestKit</h2>
+    <p>Follow these steps to download and install a new "vanilla" version of the
+      TestKit:<br>
+    </p>
+    <div style="border:solid windowtext 1.0pt;padding:1.0pt 4.0pt 1.0pt 4.0pt;
+background:#DDD9C3;margin-left:.1in;margin-right:.1in">
+      <p class="Code-Box" style="margin-top:6.0pt;margin-right:0in;margin-bottom:6.0pt;
+margin-left:0in;background:#DDD9C3"><span style="font-family: Courier New,Courier,monospace;">sudo
+          mkdir /opt/feistymeow.org<br>
+          sudo chown -R $USER /opt/feistymeow.org<br>
+          cd /opt/feistymeow.org<br>
+          git clone git://feistymeow.org/feisty_meow<br>
+          ls feisty_meow/testkit&nbsp; # the testkit location; can be copied
+          elsewhere for use.</span><span style="font-family: monospace;"><br>
+        </span></p>
+    </div>
+    <p>The above steps were used to kick-start the local version of the TestKit.</p>
+    <p>It is possible to check out the TestKit within one's own code base (by
+      adding the Feisty Meow® Codebase that was retrieved above).&nbsp; Then one
+      can retrieve an updated Feisty Meow® TestKit by running "git pull" on the
+      "feisty_meow" folder.&nbsp; This will get the latest version of TestKit
+      without disturbing whatever project's revision control repository contains
+      the TestKit for testing.</p>
+    <h3>Preparing the TestKit on Linux</h3>
+    <p>Linux is the easiest environment for running the TestKit, given that the
+      tests were built using the bash shell within a Linux environment.&nbsp; If
+      some of the packages used in the tests are missing (such as expect and gnu
+      awk), these may need to be installed from the appropriate repository for
+      your Linux distribution.&nbsp; Most distributions include these packages
+      automatically however.</p>
+    <h3> Preparing the TestKit on Mac OS X</h3>
+    <p>The test suite runs well on modern Macs with Intel CPUs.&nbsp; Due to
+      some differences in the versions of a few applications on the Mac, some
+      GNU tools may need to be installed to run the TestKit.&nbsp; These are
+      available via the Brew installer tool. <br>
+    </p>
+    <h3> </h3>
+    <h3> Preparing the TestKit on MS-Windows</h3>
+    <p>The Cygwin Unix emulation system is required to run the TestKit on
+      Windows.&nbsp; This package is available at: <a href="http://cygwin.com/install.html">http://cygwin.com/install.html</a></p>
+    <p>The default packages selected by Cygwin are the starting point of the
+      install.&nbsp; In addition to those packages, the following packages are
+      also required (see list below).&nbsp; Rather than using the cygwin setup
+      program for this task, the next section describes how to install Cygwin
+      with the apt-cyg tool.&nbsp; Apt-cyg is the preferred method, since it
+      involves less interaction with the somewhat clunky Cygwin installer.&nbsp;
+      If necessary, it is possible to install all the packages without apt-cyg
+      just by using the Cygwin setup program.&nbsp; To find each of these
+      packages more easily, try switching the “View” button on the Cygwin setup
+      program to “Full” to get an alphabetized list.</p>
+    <div style="border:solid windowtext 1.0pt;padding:1.0pt 4.0pt 1.0pt 4.0pt;
+background:#DDD9C3;margin-left:.1in;margin-right:.1in">
+      <p class="Code-Box" style="margin-top:6.0pt;margin-right:0in;margin-bottom:0in;
+margin-left:0in;margin-bottom:.0001pt;background:#DDD9C3"><span style="font-family: Courier New,Courier,monospace;">bc
+          <br> crypt <br>
+          cygutils <br>
+          emacs <br>
+          email <br>
+          expect <br>
+          gcc-g++<br>
+          git <br>
+          gitk <br>
+          gvim <br>
+          inetutils <br>
+          less <br>
+          make <br>
+          mutt <br>
+          ncftp <br>
+          openssh <br>
+          perl <br>
+          procps<br>
+          python <br>
+          sharutils <br>
+          shutdown <br>
+          subversion <br>
+          time <br>
+          unzip <br>
+          util-linux <br>
+          vim<br>
+          wget<br>
+          xinit <br>
+          xterm <br>
+          zip </span></p>
+    </div>
+    <h3>Apt-cyg Installation Process</h3>
+    <p>The apt-cyg program brings the convenience of the Debian and Ubuntu
+      installer application (apt-get) to Cygwin.&nbsp; This program does require
+      a couple of additional setup steps.&nbsp; This material is drawn from the
+      apt-cyg home page: <a href="https://github.com/transcode-open/apt-cyg">https://github.com/transcode-open/apt-cyg</a></p>
+    <p>1.&nbsp; Install the basic Cygwin packages with setup.exe (rather than
+      the long list above), but add these two packages which are not selected by
+      default:</p>
+    <ul>
+      <li>subversion</li>
+      <li>wget</li>
+    </ul>
+    <p>2.&nbsp;&nbsp; Download and install the apt-cyg program from within a
+      Cygwin bash prompt:</p>
+    <div style="border:solid windowtext 1.0pt;padding:1.0pt 4.0pt 1.0pt 4.0pt;
+background:#DDD9C3;margin-left:.5in;margin-right:.1in">
+      <p class="Code-Box" style="margin-top:6.0pt;margin-right:0in;margin-bottom:6.0pt;
+margin-left:0in;background:#DDD9C3"><span style="font-family: Courier New,Courier,monospace;">lynx
+          -source rawgit.com/transcode-open/apt-cyg/master/apt-cyg &gt; apt-cyg<br>
+          install apt-cyg /bin</span></p>
+    </div>
+    <p>3.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Install the packages required for
+      the TestKit:</p>
+    <div style="border:solid windowtext 1.0pt;padding:1.0pt 4.0pt 1.0pt 4.0pt;
+background:#DDD9C3;margin-left:.5in;margin-right:.1in">
+      <p class="Code-Box" style="margin-top:6.0pt;margin-right:0in;margin-bottom:0in;
+margin-left:0in;margin-bottom:.0001pt;background:#DDD9C3"><span style="font-family: Courier New,Courier,monospace;">apt-cyg
+          install bc crypt cygutils emacs email expect gcc-g++ git gitk gvim \<br>
+          &nbsp; inetutils less make mutt ncftp openssh perl procps python
+          sharutils \<br>
+          &nbsp; shutdown time unzip util-linux vim xinit xterm zip</span></p>
+    </div>
+    <p>4.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; The installation will run for a
+      while but then should conclude with all required packages installed.</p>
+    <h2> Setting up a Test Suite</h2>
+    <p>Running tests in TestKit uses a configuration file called
+      “testkit.config” to define the environment and, optionally, which test
+      scripts to run.&nbsp; This file is the main switchboard that defines where
+      the tests will find the resources they require.</p>
+    <p>The configuration file can be specified via the environment variable
+      “TESTKIT_CFG_FILE”.&nbsp; This variable can be set to any location,
+      enabling the configuration file to reside in a directory other than the
+      toolkit folder.&nbsp; If the variable is not defined, then the testing
+      config file defaults to “$TESTKIT_ROOT/testkit.config”.</p>
+    The TESTKIT_ROOT variable is frequently referred to in command
+    examples.&nbsp; It is set up automatically by the prepare_tools script (see
+    below).
+    <h2>Running a Test Suite</h2>
+    <p>Once the TestKit configuration file has been established, running a whole
+      test suite can be accomplished with this command:<br>
+    </p>
+    <div style="border:solid windowtext 1.0pt;padding:1.0pt 4.0pt 1.0pt 4.0pt;
+background:#DDD9C3;margin-left:.1in;margin-right:.1in">
+      <p class="Code-Box" style="margin-top:6.0pt;margin-right:0in;margin-bottom:6.0pt;
+margin-left:0in;background:#DDD9C3"><span style="font-family: Courier New,Courier,monospace;">&nbsp;bash
+          <i>{TESTKIT_FOLDER}</i>/test_driver.sh </span></p>
+    </div>
+    <p>Where the <i>{TESTKIT_FOLDER}</i> should be replaced with whatever path
+      the TestKit is stored in.</p>
+    <p>Alternatively, if the TESTKIT_ROOT folder is already established, the
+      tests can be run with:</p>
+    <div style="border:solid windowtext 1.0pt;padding:1.0pt 4.0pt 1.0pt 4.0pt;
+background:#DDD9C3;margin-left:.1in;margin-right:.1in">
+      <p class="Code-Box" style="margin-top:6.0pt;margin-right:0in;margin-bottom:6.0pt;
+margin-left:0in;background:#DDD9C3"><span style="font-family: Courier New,Courier,monospace;">&nbsp;bash
+          "$TESTKIT_ROOT/test_driver.sh"</span></p>
+    </div>
+    <p></p>
+    <h3> What to Expect From the Test Run</h3>
+    <p>The test_driver.sh script will output a few informative lines of text
+      before printing a table of the tests that it intends to run.</p>
+    <p>After the test plan is shown, all of the tests listed will be executed in
+      the order they are listed in, and they will each produce output.&nbsp;
+      Each individual test (usually a separate bash script) produces a summary
+      at the end of its run with a count of tests and a report of the tests
+      success or failure.</p>
+    <p>At the end of all the tests in the suite, the table of tests is printed
+      again with the results for each test.&nbsp; For example, this is a test
+      run that had no errors in any test (that's good, since it is our super
+      simple example test):</p>
+    <div style="border:solid windowtext 1.0pt;padding:1.0pt 4.0pt 1.0pt 4.0pt;
+background:#DDD9C3;margin-left:.1in;margin-right:.1in"><span style="font-family: Courier New,Courier,monospace;">$
+        cd $FEISTY_MEOW_APEX/testkit<br>
+        $ ./test_driver.sh summary<br>
+        ===========================================================<br>
+        Testkit environment loaded.<br>
+        TESTKIT_ROOT=/opt/feistymeow.org/feisty_meow/testkit<br>
+        TESTKIT_CFG_FILE=/opt/feistymeow.org/feisty_meow/testkit/testkit.config<br>
+        TMP=/Users/fred/.tmp<br>
+        TEST_TEMP=/Users/fred/.tmp/testkit_logs_fred<br>
+        ===========================================================<br>
+        +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++<br>
+        TestKit running from: /opt/feistymeow.org/feisty_meow/testkit<br>
+        TestKit config file:
+        /opt/feistymeow.org/feisty_meow/testkit/testkit.config<br>
+        +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++<br>
+        Full set of tests:<br>
+        1: /opt/feistymeow.org/feisty_meow/testkit/examples/blank_test.sh<br>
+        <br>
+        ======================================================================<br>
+        Wed Aug 12 14:11:00 EDT 2020: Now running test 1:
+        /opt/feistymeow.org/feisty_meow/testkit/examples/blank_test.sh<br>
+        &nbsp; Test output file:
+        /Users/fred/.tmp/testkit_logs_fred/run_2020_08_12/test_log.vKf7J3<br>
+        OK: successful test run for test
+        /opt/feistymeow.org/feisty_meow/testkit/examples/blank_test.sh<br>
+        <br>
+        <br>
+        Results table for this test run:<br>
+        <br>
+        01: OKAY --
+        /opt/feistymeow.org/feisty_meow/testkit/examples/blank_test.sh<br>
+        <br>
+        Total testing duration: 00:00 hh:mm (1 seconds total)<br>
+        OK: All 1 Tests Ran Successfully.</span><br>
+    </div>
+    <p class="Textbody">The above shows the "summary" view, which does not allow
+      the individual tests to output to the console.&nbsp; If the "summary" flag
+      is not passed, then the output from all the test runs is also shown.</p>
+    <p class="Textbody">Even when the summary view is used, all output files can
+      be examined after the run.&nbsp; For example, in the above, the mentioned
+      output file "test_log.vKf7J3" can be checked to see exactly what happened
+      during the test.</p>
+    <p class="Textbody">A test with a failure in it will have “FAIL” next to the
+      test that failed, and the final output line will start with
+      “FAILURE”.&nbsp; For example:</p>
+    <div style="border:solid windowtext 1.0pt;padding:1.0pt 4.0pt 1.0pt 4.0pt;
+background:#DDD9C3;margin-left:.1in;margin-right:.1in">
+      <p class="Code-Box" style="margin-top:6.0pt;margin-right:0in;margin-bottom:6.0pt;
+margin-left:0in;background:#DDD9C3"><span style="font-family: Courier New,Courier,monospace;">01:
+          OKAY – AckPfft_Tests/Gorp_Tests/deslagToaster.sh<br>
+          02: FAIL – AckPfft_Tests/Gorp_Tests/spumeMerchantry.sh<br>
+          03: OKAY – AckPfft_Tests/Gorp_Tests/octopusLauncher.sh<br>
+          …<br>
+          22: OKAY -- Snargle_Tests/scramTests/scramForPetunias.sh</span></p>
+      <span style="font-family: Courier New,Courier,monospace;"> </span>
+      <p class="Code-Box" style="margin-top:6.0pt;margin-right:0in;margin-bottom:6.0pt;
+margin-left:0in;background:#DDD9C3"><span style="font-family: Courier New,Courier,monospace;">FAILURE:
+          1 Tests Failed out of 22 Tests.</span></p>
+    </div>
+    <p>A failed test will also return a non-zero value from the test execution,
+      enabling the run of a test suite to be tested for success when launched
+      externally, such as from a continuous integration system.</p>
+    <h2>Loading the TestKit Environment</h2>
+    <p>If one wishes to run individual tests within the test suite, rather than
+      the entire suite, this is done by loading the TestKit variables into the
+      current shell environment, like so:</p>
+    <div style="border:solid windowtext 1.0pt;padding:1.0pt 4.0pt 1.0pt 4.0pt;
+background:#DDD9C3;margin-left:.1in;margin-right:.1in">
+      <p class="Code-Box" style="margin-top:6.0pt;margin-right:0in;margin-bottom:6.0pt;
+margin-left:0in;background:#DDD9C3"><span style="font-family: Courier New,Courier,monospace;">cd
+          <i>{TESTKIT_FOLDER}</i>&nbsp; # replace with actual location of
+          TestKit.<br>
+          source prepare_tools.sh prepare_tools.sh<br>
+          source $TESTKIT_ROOT/library/process_configuration.sh<br>
+          define_and_export_variables</span></p>
+      <span style="font-family: Courier New,Courier,monospace;"> # Show the
+        important variables.<br>
+        var $TESTKIT_ROOT $TESTKIT_CFG_FILE</span></div>
+    <p>After loading the TestKit environment, one can execute a specific test
+      and see its results, for example:</p>
+    <div style="border:solid windowtext 1.0pt;padding:1.0pt 4.0pt 1.0pt 4.0pt;background:#DDD9C3;margin-left:.1in;margin-right:.1in">
+      <p class="Code-Box" style="margin-top:6.0pt;margin-right:0in;margin-bottom:6.0pt;
+margin-left:0in;background:#DDD9C3"><span style="font-family: Courier New,Courier,monospace;">cd
+          examples<br>
+          bash blank_test.sh</span></p>
+    </div>
+    <p>The test will run and output its results to the console (that is, output
+      is sent to standard out and standard error, to be more precise).</p>
+    <p><br>
+    </p>
+    <h3></h3>
+  </body>
+</html>
index d6fbbd104e7fd87cc733ae0bf360232300807f7c..fe752cc4c09c0c6c7239dc83f4924c721a51c156 100644 (file)
@@ -5,12 +5,13 @@
   </head>
   <body vlink="purple" link="blue" lang="EN-US">
     <h1 style=" text-align:center">Feisty Meow® TestKit Reference Manual</h1>
-    <address style=" text-align:center">Version 1.0 ― Updated August 12 2020</address>
+    <h3 style=" text-align:center">Author: Chris Koeritz</h3>
+    <address style=" text-align:center"> Version 1.0 ― Updated August 14 2020</address>
     <h1>The Feisty Meow® TestKit</h1>
     <p>The TestKit is a collection of scripts that leverages the ShUnit unit
-      testing environment.&nbsp; TestKit provides a pattern for creating test
-      suites using a simple configuration file approach.&nbsp; Full reporting on
-      test runs is provided in a convenient tabular format.</p>
+      testing environment.&nbsp; The TestKit provides a pattern for creating
+      test suites using a simple configuration file approach.&nbsp; Full
+      reporting on test runs is provided in a convenient tabular format.</p>
     <p>Generally, writing a test script using the TestKit is a matter of
       minutes.&nbsp; A blank test is provided as a template, and that can be
       expanded with whatever test steps are needed.</p>
       standard POSIX interfaces.<br>
     </p>
     <h2> Getting the TestKit</h2>
-    <p>Follow these steps to download and install the Feisty Meow TestKit:<br>
+    <p>Follow these steps to download and install a new "vanilla" version of the
+      TestKit:<br>
     </p>
     <div style="border:solid windowtext 1.0pt;padding:1.0pt 4.0pt 1.0pt 4.0pt;
 background:#DDD9C3;margin-left:.1in;margin-right:.1in">
       <p class="Code-Box" style="margin-top:6.0pt;margin-right:0in;margin-bottom:6.0pt;
-margin-left:0in;background:#DDD9C3"><span style="font-family: monospace;">sudo
+margin-left:0in;background:#DDD9C3"><span style="font-family: Courier New,Courier,monospace;">sudo
           mkdir /opt/feistymeow.org<br>
           sudo chown -R $USER /opt/feistymeow.org<br>
           cd /opt/feistymeow.org<br>
-          git clone git://feistymeow.org/feisty_meow</span></p>
+          git clone git://feistymeow.org/feisty_meow<br>
+          ls feisty_meow/testkit&nbsp; # the testkit location; can be copied
+          elsewhere for use.</span><span style="font-family: monospace;"><br>
+        </span></p>
     </div>
+    <p>The above steps were used to kick-start the local version of the TestKit.</p>
+    <p>It is possible to check out the TestKit within one's own code base (by
+      adding the Feisty Meow® Codebase that was retrieved above).&nbsp; Then one
+      can retrieve an updated Feisty Meow® TestKit by running "git pull" on the
+      "feisty_meow" folder.&nbsp; This will get the latest version of TestKit
+      without disturbing whatever project's revision control repository contains
+      the TestKit for testing.</p>
     <h3>Preparing the TestKit on Linux</h3>
     <p>Linux is the easiest environment for running the TestKit, given that the
       tests were built using the bash shell within a Linux environment.&nbsp; If
@@ -61,83 +73,81 @@ margin-left:0in;background:#DDD9C3"><span style="font-family: monospace;">sudo
     <div style="border:solid windowtext 1.0pt;padding:1.0pt 4.0pt 1.0pt 4.0pt;
 background:#DDD9C3;margin-left:.1in;margin-right:.1in">
       <p class="Code-Box" style="margin-top:6.0pt;margin-right:0in;margin-bottom:0in;
-margin-left:0in;margin-bottom:.0001pt;background:#DDD9C3">bc <br>
-        crypt <br>
-        cygutils <br>
-        emacs <br>
-        email <br>
-        expect <br>
-        gcc-g++<br>
-        git <br>
-        gitk <br>
-        gvim <br>
-        inetutils <br>
-        less <br>
-        make <br>
-        mutt <br>
-        ncftp <br>
-        openssh <br>
-        perl <br>
-        procps<br>
-        python <br>
-        sharutils <br>
-        shutdown <br>
-        subversion <br>
-        time <br>
-        unzip <br>
-        util-linux <br>
-        vim<br>
-        wget<br>
-        xinit <br>
-        xterm <br>
-        zip </p>
+margin-left:0in;margin-bottom:.0001pt;background:#DDD9C3"><span style="font-family: Courier New,Courier,monospace;">bc
+          <br> crypt <br>
+          cygutils <br>
+          emacs <br>
+          email <br>
+          expect <br>
+          gcc-g++<br>
+          git <br>
+          gitk <br>
+          gvim <br>
+          inetutils <br>
+          less <br>
+          make <br>
+          mutt <br>
+          ncftp <br>
+          openssh <br>
+          perl <br>
+          procps<br>
+          python <br>
+          sharutils <br>
+          shutdown <br>
+          subversion <br>
+          time <br>
+          unzip <br>
+          util-linux <br>
+          vim<br>
+          wget<br>
+          xinit <br>
+          xterm <br>
+          zip </span></p>
     </div>
-    <p>&nbsp;</p>
     <h3>Apt-cyg Installation Process</h3>
     <p>The apt-cyg program brings the convenience of the Debian and Ubuntu
       installer application (apt-get) to Cygwin.&nbsp; This program does require
       a couple of additional setup steps.&nbsp; This material is drawn from the
       apt-cyg home page: <a href="https://github.com/transcode-open/apt-cyg">https://github.com/transcode-open/apt-cyg</a></p>
-    <p class="MsoListParagraphCxSpFirst" style="text-indent:-.25in">1.&nbsp;
-      Install the basic Cygwin packages with setup.exe (rather than the long
-      list above), but add these two packages which are not selected by default:</p>
+    <p>1.&nbsp; Install the basic Cygwin packages with setup.exe (rather than
+      the long list above), but add these two packages which are not selected by
+      default:</p>
     <ul>
       <li>subversion</li>
       <li>wget</li>
     </ul>
-    <p class="MsoListParagraphCxSpLast" style="text-indent:-.25in">2.&nbsp;&nbsp;
-      Download and install the apt-cyg program from within a Cygwin bash prompt:</p>
+    <p>2.&nbsp;&nbsp; Download and install the apt-cyg program from within a
+      Cygwin bash prompt:</p>
     <div style="border:solid windowtext 1.0pt;padding:1.0pt 4.0pt 1.0pt 4.0pt;
 background:#DDD9C3;margin-left:.5in;margin-right:.1in">
       <p class="Code-Box" style="margin-top:6.0pt;margin-right:0in;margin-bottom:6.0pt;
-margin-left:0in;background:#DDD9C3">lynx -source
-        rawgit.com/transcode-open/apt-cyg/master/apt-cyg &gt; apt-cyg<br>
-        install apt-cyg /bin</p>
+margin-left:0in;background:#DDD9C3"><span style="font-family: Courier New,Courier,monospace;">lynx
+          -source rawgit.com/transcode-open/apt-cyg/master/apt-cyg &gt; apt-cyg<br>
+          install apt-cyg /bin</span></p>
     </div>
-    <p class="MsoListParagraph" style="text-indent:-.25in">3.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
-      Install the packages required for the TestKit:</p>
+    <p>3.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Install the packages required for
+      the TestKit:</p>
     <div style="border:solid windowtext 1.0pt;padding:1.0pt 4.0pt 1.0pt 4.0pt;
 background:#DDD9C3;margin-left:.5in;margin-right:.1in">
       <p class="Code-Box" style="margin-top:6.0pt;margin-right:0in;margin-bottom:0in;
-margin-left:0in;margin-bottom:.0001pt;background:#DDD9C3">apt-cyg install bc
-        crypt cygutils emacs email expect gcc-g++ git gitk gvim \<br>
-        &nbsp; inetutils less make mutt ncftp openssh perl procps python
-        sharutils \<br>
-        &nbsp; shutdown time unzip util-linux vim xinit xterm zip</p>
+margin-left:0in;margin-bottom:.0001pt;background:#DDD9C3"><span style="font-family: Courier New,Courier,monospace;">apt-cyg
+          install bc crypt cygutils emacs email expect gcc-g++ git gitk gvim \<br>
+          &nbsp; inetutils less make mutt ncftp openssh perl procps python
+          sharutils \<br>
+          &nbsp; shutdown time unzip util-linux vim xinit xterm zip</span></p>
     </div>
-    <p class="MsoListParagraph" style="text-indent:-.25in">4.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
-      The installation will run for a while but then should conclude with all
-      required packages installed.</p>
+    <p>4.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; The installation will run for a
+      while but then should conclude with all required packages installed.</p>
     <h2> Setting up a Test Suite</h2>
-    <p>Tunning tests in TestKit uses a configuration file called
+    <p>Running tests in TestKit uses a configuration file called
       “testkit.config” to define the environment and, optionally, which test
       scripts to run.&nbsp; This file is the main switchboard that defines where
-      the tests will find users, home directories, queues, containers, and so
-      forth. &nbsp;The configuration file can be specified via the environment
-      variable “TESTKIT_CFG_FILE”.&nbsp; This variable can be set to any
-      location, enabling the configuration file to reside in a directory other
-      than the toolkit folder.&nbsp; If the variable is not defined, then the
-      testing config file defaults to “$TESTKIT_ROOT/testkit.config”.</p>
+      the tests will find the resources they require.</p>
+    <p>The configuration file can be specified via the environment variable
+      “TESTKIT_CFG_FILE”.&nbsp; This variable can be set to any location,
+      enabling the configuration file to reside in a directory other than the
+      toolkit folder.&nbsp; If the variable is not defined, then the testing
+      config file defaults to “$TESTKIT_ROOT/testkit.config”.</p>
     The TESTKIT_ROOT variable is frequently referred to in command
     examples.&nbsp; It is set up automatically by the prepare_tools script (see
     below).
@@ -148,8 +158,9 @@ margin-left:0in;margin-bottom:.0001pt;background:#DDD9C3">apt-cyg install bc
     <div style="border:solid windowtext 1.0pt;padding:1.0pt 4.0pt 1.0pt 4.0pt;
 background:#DDD9C3;margin-left:.1in;margin-right:.1in">
       <p class="Code-Box" style="margin-top:6.0pt;margin-right:0in;margin-bottom:6.0pt;
-margin-left:0in;background:#DDD9C3">&nbsp;bash <i>{TESTKIT_FOLDER}</i>/test_driver.sh
-        </p> </div>
+margin-left:0in;background:#DDD9C3"><span style="font-family: Courier New,Courier,monospace;">&nbsp;bash
+          <i>{TESTKIT_FOLDER}</i>/test_driver.sh </span></p>
+    </div>
     <p>Where the <i>{TESTKIT_FOLDER}</i> should be replaced with whatever path
       the TestKit is stored in.</p>
     <p>Alternatively, if the TESTKIT_ROOT folder is already established, the
@@ -157,7 +168,8 @@ margin-left:0in;background:#DDD9C3">&nbsp;bash <i>{TESTKIT_FOLDER}</i>/test_driv
     <div style="border:solid windowtext 1.0pt;padding:1.0pt 4.0pt 1.0pt 4.0pt;
 background:#DDD9C3;margin-left:.1in;margin-right:.1in">
       <p class="Code-Box" style="margin-top:6.0pt;margin-right:0in;margin-bottom:6.0pt;
-margin-left:0in;background:#DDD9C3">&nbsp;bash "$TESTKIT_ROOT/test_driver.sh"</p>
+margin-left:0in;background:#DDD9C3"><span style="font-family: Courier New,Courier,monospace;">&nbsp;bash
+          "$TESTKIT_ROOT/test_driver.sh"</span></p>
     </div>
     <p></p>
     <h3> What to Expect From the Test Run</h3>
@@ -173,39 +185,40 @@ margin-left:0in;background:#DDD9C3">&nbsp;bash "$TESTKIT_ROOT/test_driver.sh"</p
       run that had no errors in any test (that's good, since it is our super
       simple example test):</p>
     <div style="border:solid windowtext 1.0pt;padding:1.0pt 4.0pt 1.0pt 4.0pt;
-background:#DDD9C3;margin-left:.1in;margin-right:.1in">$ cd
-      $FEISTY_MEOW_APEX/testkit<br>
-      $ ./test_driver.sh summary<br>
-      ===========================================================<br>
-      Testkit environment loaded.<br>
-      TESTKIT_ROOT=/opt/feistymeow.org/feisty_meow/testkit<br>
-      TESTKIT_CFG_FILE=/opt/feistymeow.org/feisty_meow/testkit/testkit.config<br>
-      TMP=/Users/fred/.tmp<br>
-      TEST_TEMP=/Users/fred/.tmp/testkit_logs_fred<br>
-      ===========================================================<br>
-      +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++<br>
-      TestKit running from: /opt/feistymeow.org/feisty_meow/testkit<br>
-      TestKit config file:
-      /opt/feistymeow.org/feisty_meow/testkit/testkit.config<br>
-      +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++<br>
-      Full set of tests:<br>
-      1: /opt/feistymeow.org/feisty_meow/testkit/examples/blank_test.sh<br>
-      <br>
-      ======================================================================<br>
-      Wed Aug 12 14:11:00 EDT 2020: Now running test 1:
-      /opt/feistymeow.org/feisty_meow/testkit/examples/blank_test.sh<br>
-      &nbsp; Test output file:
-      /Users/fred/.tmp/testkit_logs_fred/run_2020_08_12/test_log.vKf7J3<br>
-      OK: successful test run for test
-      /opt/feistymeow.org/feisty_meow/testkit/examples/blank_test.sh<br>
-      <br>
-      <br>
-      Results table for this test run:<br>
-      <br>
-      01: OKAY -- /opt/feistymeow.org/feisty_meow/testkit/examples/blank_test.sh<br>
-      <br>
-      Total testing duration: 00:00 hh:mm (1 seconds total)<br>
-      OK: All 1 Tests Ran Successfully.<br>
+background:#DDD9C3;margin-left:.1in;margin-right:.1in"><span style="font-family: Courier New,Courier,monospace;">$
+        cd $FEISTY_MEOW_APEX/testkit<br>
+        $ ./test_driver.sh summary<br>
+        ===========================================================<br>
+        Testkit environment loaded.<br>
+        TESTKIT_ROOT=/opt/feistymeow.org/feisty_meow/testkit<br>
+        TESTKIT_CFG_FILE=/opt/feistymeow.org/feisty_meow/testkit/testkit.config<br>
+        TMP=/Users/fred/.tmp<br>
+        TEST_TEMP=/Users/fred/.tmp/testkit_logs_fred<br>
+        ===========================================================<br>
+        +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++<br>
+        TestKit running from: /opt/feistymeow.org/feisty_meow/testkit<br>
+        TestKit config file:
+        /opt/feistymeow.org/feisty_meow/testkit/testkit.config<br>
+        +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++<br>
+        Full set of tests:<br>
+        1: /opt/feistymeow.org/feisty_meow/testkit/examples/blank_test.sh<br>
+        <br>
+        ======================================================================<br>
+        Wed Aug 12 14:11:00 EDT 2020: Now running test 1:
+        /opt/feistymeow.org/feisty_meow/testkit/examples/blank_test.sh<br>
+        &nbsp; Test output file:
+        /Users/fred/.tmp/testkit_logs_fred/run_2020_08_12/test_log.vKf7J3<br>
+        OK: successful test run for test
+        /opt/feistymeow.org/feisty_meow/testkit/examples/blank_test.sh<br>
+        <br>
+        <br>
+        Results table for this test run:<br>
+        <br>
+        01: OKAY --
+        /opt/feistymeow.org/feisty_meow/testkit/examples/blank_test.sh<br>
+        <br>
+        Total testing duration: 00:00 hh:mm (1 seconds total)<br>
+        OK: All 1 Tests Ran Successfully.</span><br>
     </div>
     <p class="Textbody">The above shows the "summary" view, which does not allow
       the individual tests to output to the console.&nbsp; If the "summary" flag
@@ -220,14 +233,16 @@ background:#DDD9C3;margin-left:.1in;margin-right:.1in">$ cd
     <div style="border:solid windowtext 1.0pt;padding:1.0pt 4.0pt 1.0pt 4.0pt;
 background:#DDD9C3;margin-left:.1in;margin-right:.1in">
       <p class="Code-Box" style="margin-top:6.0pt;margin-right:0in;margin-bottom:6.0pt;
-margin-left:0in;background:#DDD9C3">01: FAIL –
-        AckPfft_Tests/Gorp_Tests/deslagToaster.sh<br>
-        02: OKAY – AckPfft_Tests/Gorp_Tests/spumeMerchantry.sh<br>
-        03: OKAY – AckPfft_Tests/Gorp_Tests/octopusLauncher.sh<br>
-        …<br>
-        22: OKAY -- Snargle_Tests/scramTests/scramForPetunias.sh</p>
+margin-left:0in;background:#DDD9C3"><span style="font-family: Courier New,Courier,monospace;">01:
+          OKAY – AckPfft_Tests/Gorp_Tests/deslagToaster.sh<br>
+          02: FAIL – AckPfft_Tests/Gorp_Tests/spumeMerchantry.sh<br>
+          03: OKAY – AckPfft_Tests/Gorp_Tests/octopusLauncher.sh<br>
+          …<br>
+          22: OKAY -- Snargle_Tests/scramTests/scramForPetunias.sh</span></p>
+      <span style="font-family: Courier New,Courier,monospace;"> </span>
       <p class="Code-Box" style="margin-top:6.0pt;margin-right:0in;margin-bottom:6.0pt;
-margin-left:0in;background:#DDD9C3">FAILURE: 1 Tests Failed out of 22 Tests.</p>
+margin-left:0in;background:#DDD9C3"><span style="font-family: Courier New,Courier,monospace;">FAILURE:
+          1 Tests Failed out of 22 Tests.</span></p>
     </div>
     <p>A failed test will also return a non-zero value from the test execution,
       enabling the run of a test suite to be tested for success when launched
@@ -239,19 +254,22 @@ margin-left:0in;background:#DDD9C3">FAILURE: 1 Tests Failed out of 22 Tests.</p>
     <div style="border:solid windowtext 1.0pt;padding:1.0pt 4.0pt 1.0pt 4.0pt;
 background:#DDD9C3;margin-left:.1in;margin-right:.1in">
       <p class="Code-Box" style="margin-top:6.0pt;margin-right:0in;margin-bottom:6.0pt;
-margin-left:0in;background:#DDD9C3">cd <i>{TESTKIT_FOLDER}</i>&nbsp; # replace
-        with actual location of TestKit.<br>
-        source prepare_tools.sh prepare_tools.sh<br>
-        source $TESTKIT_ROOT/library/process_configuration.sh<br>
-        define_and_export_variables</p>
-      # Show the important variables.<br>
-      var $TESTKIT_ROOT $TESTKIT_CFG_FILE</div>
+margin-left:0in;background:#DDD9C3"><span style="font-family: Courier New,Courier,monospace;">cd
+          <i>{TESTKIT_FOLDER}</i>&nbsp; # replace with actual location of
+          TestKit.<br>
+          source prepare_tools.sh prepare_tools.sh<br>
+          source $TESTKIT_ROOT/library/process_configuration.sh<br>
+          define_and_export_variables</span></p>
+      <span style="font-family: Courier New,Courier,monospace;"> # Show the
+        important variables.<br>
+        var $TESTKIT_ROOT $TESTKIT_CFG_FILE</span></div>
     <p>After loading the TestKit environment, one can execute a specific test
       and see its results, for example:</p>
     <div style="border:solid windowtext 1.0pt;padding:1.0pt 4.0pt 1.0pt 4.0pt;background:#DDD9C3;margin-left:.1in;margin-right:.1in">
       <p class="Code-Box" style="margin-top:6.0pt;margin-right:0in;margin-bottom:6.0pt;
-margin-left:0in;background:#DDD9C3">cd examples<br>
-        bash blank_test.sh</p>
+margin-left:0in;background:#DDD9C3"><span style="font-family: Courier New,Courier,monospace;">cd
+          examples<br>
+          bash blank_test.sh</span></p>
     </div>
     <p>The test will run and output its results to the console (that is, output
       is sent to standard out and standard error, to be more precise).</p>
index 47dfd3a6f12b4986f3eb040138bd041212f9f75e..239cbe73f205392df6c6f0814e38863a3ba89ed0 100644 (file)
@@ -34,8 +34,8 @@ testSanity()
 
 testCleaningPriorTestRun()
 {
-  echo taking steps to clean last test...
-#if any.
+  # take steps to clean last test, if any are needed.
+  true
 }
 
 testDoAThing()
@@ -55,8 +55,8 @@ testDoAnotherThing()
 }
 
 oneTimeTearDown() {
-  echo cleaning up after test now...
-#if anything to do.
+  # cleaning up after test, if needed.
+  true
 }
 
 # load and run shUnit2
index 0d26181a702343f7a43a14968454dc69d919f80b..f0396bc6b1c26999b56f39632680dc0b9684a847 100644 (file)
@@ -18,6 +18,9 @@ BASE_USER=${USER}
 # Used for windows testing; provides the path to the binaries directory of cygwin.
 #CYGWIN_BIN_PATH=c:/cygwin/bin
 
+# Used to insert branded bits into documentation and other places potentially.
+TESTKIT_BRANDING="Feisty Meow®"
+
 ##############
 
 # define the tests to run.  this is the most convenient place to put this.
index 115c1a2e034673777959a953f192e21c755e068b..87e3549a4b9d1da3d58c77e0f4646d6e256ca305 100644 (file)
@@ -1,9 +1,8 @@
-include variables.def
 
-PROJECT = testkit
-FIRST_TARGETS += run_testkit_check
 
-include rules.def
+all:
+       @bash test_driver.sh
+
+docs:
+       cd doc && $(MAKE)
 
-run_testkit_check:
-       $(HIDESH) -c 'bash test_driver.sh'
index 9186522eed70a00fcc94b18844ed2c3f4ab103a8..97aa6f2448dd22629659ac202403ea816d1a1ac9 100644 (file)
@@ -43,6 +43,16 @@ GRITTY_TESTING_TOP_LEVEL="$(echo "$GRITTY_TESTING_TOP_LEVEL" | sed -e 's/\/cygdr
 # the top-level directory for tests, i.e. the root of testing hierarchy.
 export TESTKIT_ROOT="$GRITTY_TESTING_TOP_LEVEL"
 
+# location needed for shunit temporary files.
+export TMPDIR="$HOME/.shunit-temp"
+if [ ! -d "$TMPDIR" ]; then
+  mkdir -p "$TMPDIR"
+  if [ $? -ne 0 ]; then
+    echo "Failure during creation of TMPDIR for shunit!"
+    exit 1
+  fi
+fi
+
 # a bit of a dance to not pull in code too early...
 export TESTKIT_BOOTSTRAPPING=true
 source "$TESTKIT_ROOT/library/establish_environment.sh"
index 0d26181a702343f7a43a14968454dc69d919f80b..f0396bc6b1c26999b56f39632680dc0b9684a847 100644 (file)
@@ -18,6 +18,9 @@ BASE_USER=${USER}
 # Used for windows testing; provides the path to the binaries directory of cygwin.
 #CYGWIN_BIN_PATH=c:/cygwin/bin
 
+# Used to insert branded bits into documentation and other places potentially.
+TESTKIT_BRANDING="Feisty Meow®"
+
 ##############
 
 # define the tests to run.  this is the most convenient place to put this.