From: Chris Koeritz Date: Thu, 2 Feb 2017 07:25:01 +0000 (-0500) Subject: shuffle-dee-doo X-Git-Tag: 2.140.90~250 X-Git-Url: https://feistymeow.org/gitweb/?a=commitdiff_plain;h=1eb154455735d2faad508170d707e8df1d718717;p=feisty_meow.git shuffle-dee-doo more rearrangement. also some nicer shunit language in output. --- diff --git a/scripts/generator/inc_num.pl b/scripts/generator/inc_num.pl new file mode 100644 index 00000000..acecc29f --- /dev/null +++ b/scripts/generator/inc_num.pl @@ -0,0 +1,62 @@ +#!/usr/bin/perl + +############################################################################### +# # +# Name : inc_num # +# Author : Chris Koeritz # +# Rights : Copyright (C) 1996-$now by Author # +# # +# Purpose: # +# # +# Operates on a number stored in a text file. the number can be retrieved # +# for whatever purpose or it can be incremented. # +# # +############################################################################### +# This program is free software; you can redistribute it and/or modify it # +# under the terms of the GNU General Public License as published by the Free # +# Software Foundation; either version 2 of the License or (at your option) # +# any later version. See: "http://www.gruntose.com/Info/GNU/GPL.html" for a # +# version of the License. Please send any updates to "fred@gruntose.com". # +############################################################################### + +# A number is retrieved from the passed in filename and returned. +sub get_number { + local($number_file) = @_; +#print "num file is $number_file\n"; + open(NUMBERING, "$number_file"); + local($number) = int(); + if ($number <= 0) { $number = 1; } + if ($number < 10) { $number = '0'.$number; } + if ($number < 100) { $number = '0'.$number; } + if ($number < 1000) { $number = '0'.$number; } + # upgraded to 6 digit numbers. whoo hoo. + if ($number < 10000) { $number = '0'.$number; } + if ($number < 100000) { $number = '0'.$number; } + close(NUMBERING); + return $number; +} + +# the number in the passed filename is increased. +sub next_number { + local($number_file) = @_; + local($number) = &get_number($number_file); + if ($number < 0) { $number = '000000'; } + $number++; + if ($number > 999999) { $number = '000000'; } + open(NUMBERING, "> $number_file"); +#print "number is now $number\n"; + print NUMBERING "$number\n"; + close(NUMBERING); +} + +# stores the number specified into the file specified. +sub store_number { + local($number, $number_file) = @_; +#print "storing $number into $number_file\n"; + open(NUMBERING, "> $number_file"); + print NUMBERING "$number\n"; + close(NUMBERING); +} + +1; + diff --git a/scripts/math/inc_num.pl b/scripts/math/inc_num.pl deleted file mode 100644 index acecc29f..00000000 --- a/scripts/math/inc_num.pl +++ /dev/null @@ -1,62 +0,0 @@ -#!/usr/bin/perl - -############################################################################### -# # -# Name : inc_num # -# Author : Chris Koeritz # -# Rights : Copyright (C) 1996-$now by Author # -# # -# Purpose: # -# # -# Operates on a number stored in a text file. the number can be retrieved # -# for whatever purpose or it can be incremented. # -# # -############################################################################### -# This program is free software; you can redistribute it and/or modify it # -# under the terms of the GNU General Public License as published by the Free # -# Software Foundation; either version 2 of the License or (at your option) # -# any later version. See: "http://www.gruntose.com/Info/GNU/GPL.html" for a # -# version of the License. Please send any updates to "fred@gruntose.com". # -############################################################################### - -# A number is retrieved from the passed in filename and returned. -sub get_number { - local($number_file) = @_; -#print "num file is $number_file\n"; - open(NUMBERING, "$number_file"); - local($number) = int(); - if ($number <= 0) { $number = 1; } - if ($number < 10) { $number = '0'.$number; } - if ($number < 100) { $number = '0'.$number; } - if ($number < 1000) { $number = '0'.$number; } - # upgraded to 6 digit numbers. whoo hoo. - if ($number < 10000) { $number = '0'.$number; } - if ($number < 100000) { $number = '0'.$number; } - close(NUMBERING); - return $number; -} - -# the number in the passed filename is increased. -sub next_number { - local($number_file) = @_; - local($number) = &get_number($number_file); - if ($number < 0) { $number = '000000'; } - $number++; - if ($number > 999999) { $number = '000000'; } - open(NUMBERING, "> $number_file"); -#print "number is now $number\n"; - print NUMBERING "$number\n"; - close(NUMBERING); -} - -# stores the number specified into the file specified. -sub store_number { - local($number, $number_file) = @_; -#print "storing $number into $number_file\n"; - open(NUMBERING, "> $number_file"); - print NUMBERING "$number\n"; - close(NUMBERING); -} - -1; - diff --git a/scripts/shunit/shunit2 b/scripts/shunit/shunit2 index e9afb3d5..aa0a4e7d 100644 --- a/scripts/shunit/shunit2 +++ b/scripts/shunit/shunit2 @@ -123,7 +123,7 @@ assertEquals() shunit_return=${SHUNIT_TRUE} if [ "${shunit_expected_}" = "${shunit_actual_}" ]; then if [ ! -z "$DEBUGGING" -a ! -z "$assertion_name" ]; then - echo " OK: $assertion_name" + echo " OKAY: $assertion_name" fi _shunit_assertPass else @@ -166,7 +166,7 @@ assertNotEquals() shunit_return=${SHUNIT_TRUE} if [ "${shunit_expected_}" != "${shunit_actual_}" ]; then if [ ! -z "$DEBUGGING" -a ! -z "$assertion_name" ]; then - echo " OK: $assertion_name" + echo " OKAY: $assertion_name" fi _shunit_assertPass else @@ -357,7 +357,7 @@ assertTrue() # record the test if [ ${shunit_return} -eq ${SHUNIT_TRUE} ]; then if [ ! -z "$DEBUGGING" -a ! -z "$assertion_name" ]; then - echo " OK: $assertion_name" + echo " OKAY: $assertion_name" fi _shunit_assertPass else @@ -427,7 +427,7 @@ assertFalse() # record the test if [ ${shunit_return} -eq ${SHUNIT_TRUE} ]; then if [ ! -z "$DEBUGGING" -a ! -z "$assertion_name" ]; then - echo " OK: $assertion_name" + echo " OKAY: $assertion_name" fi _shunit_assertPass else @@ -822,7 +822,7 @@ _shunit_execSuite() unset _shunit_test_ } -# Generates the user friendly report with appropriate OK/FAILED message. +# Generates the user friendly report with appropriate OKAY/FAILED message. # # Args: # None @@ -852,11 +852,11 @@ _shunit_generateReport() && _shunit_skipped_="skipped=${__shunit_assertsSkipped}" if [ ${_shunit_ok_} -eq ${SHUNIT_TRUE} ]; then - _shunit_msg_='OK' + _shunit_msg_="$(basename $0) PASSED 100% OKAY" [ -n "${_shunit_skipped_}" ] \ && _shunit_msg_="${_shunit_msg_} (${_shunit_skipped_})" else - _shunit_msg_="FAILED (${_shunit_failures_}" + _shunit_msg_="$(basename $0) FAILED (${_shunit_failures_}" [ -n "${_shunit_skipped_}" ] \ && _shunit_msg_="${_shunit_msg_},${_shunit_skipped_}" _shunit_msg_="${_shunit_msg_})"