Index: /trunk/Ohana/src/opihi/cmd.basic/test/sprintf.sh
===================================================================
--- /trunk/Ohana/src/opihi/cmd.basic/test/sprintf.sh	(revision 6231)
+++ /trunk/Ohana/src/opihi/cmd.basic/test/sprintf.sh	(revision 6231)
@@ -0,0 +1,43 @@
+
+list tests
+ test1
+ test2
+ test3
+ test4
+end
+
+macro test1
+ sprintf line "test %03d" 50
+ if ("$line" == "test 050")
+   $PASS = 1
+ else
+   $PASS = 0
+ end
+end
+
+macro test2
+ sprintf line "test %6.3f" 123.45678
+ if ("$line" == "test 123.457")
+   $PASS = 1
+ else
+   $PASS = 0
+ end
+end
+
+macro test3
+ sprintf line "test %x" 32
+ if ("$line" == "test 20")
+   $PASS = 1
+ else
+   $PASS = 0
+ end
+end
+
+macro test4
+ sprintf line "test %10s" foobar
+ if ("$line" == "test     foobar")
+   $PASS = 1
+ else
+   $PASS = 0
+ end
+end
Index: /trunk/Ohana/src/opihi/test/tests.sh
===================================================================
--- /trunk/Ohana/src/opihi/test/tests.sh	(revision 6231)
+++ /trunk/Ohana/src/opihi/test/tests.sh	(revision 6231)
@@ -0,0 +1,39 @@
+
+list testdir
+  cmd.basic/test
+end
+
+macro fulltests
+  $Npass = 0
+  $Nfail = 0
+  $Ntest = 0
+  break -auto off
+
+  for Ti 0 $testdir:n
+    list testscripts -x "ls $testdir:$Ti/*.sh"
+    for Tj 0 $testscripts:n
+      input $testscripts:$Tj
+      for Tk 0 $tests:n
+        # echo running $tests:$Tk
+        $tests:$Tk
+        if ($PASS == 0)
+          echo "failed test $tests:$Tk"
+          $Nfail ++
+        else
+          # echo "passed $tests:$Tk"
+          $Npass ++
+        end
+        $Ntest ++
+        # echo "finished $tests:$Tk"
+      end
+      # echo "finished $testscripts:n test scripts from $testscripts:$Tj"
+    end
+    # echo "finished tests from $testdir:$Ti"
+  end
+
+  echo "completed $Ntest tests"
+  echo "$Npass tests passed"
+  echo "$Nfail tests failed"
+  echo "examined $testdir:n directories"
+end
+
