Author: yamakenz
Date: Mon Mar 31 08:58:27 2008
New Revision: 5374

Added:
  trunk/test2/
  trunk/test2/Makefile.am
  trunk/test2/run-singletest.sh.in
  trunk/test2/test-template.scm
Modified:
  trunk/Makefile.am
  trunk/configure.ac

Log:
* This commit add another directory for Scheme unit test
 directly running on uim-sh with the SRFI-64 subset

* test2
 - New directory
* test2/Makefile.am
* test2/run-singletest.sh.in
* test2/test-template.scm
 - New file
* Makefile.am
 - (SUBDIRS): Add test2
* configure.ac
 - Add test2/Makefile and test2/run-singletest.sh to AC_CONFIG_FILES


Modified: trunk/Makefile.am
==============================================================================
--- trunk/Makefile.am   (original)
+++ trunk/Makefile.am   Mon Mar 31 08:58:27 2008
@@ -1,7 +1,7 @@
AUTOMAKE_OPTIONS = foreign
ACLOCAL_AMFLAGS = -I m4

-SUBDIRS = m4 doc replace sigscheme uim scm test \
+SUBDIRS = m4 doc replace sigscheme uim scm test test2 \
          gtk helper qt notify
if QT4_IMMODULE
SUBDIRS += qt4

Modified: trunk/configure.ac
==============================================================================
--- trunk/configure.ac  (original)
+++ trunk/configure.ac  Mon Mar 31 08:58:27 2008
@@ -1538,6 +1538,8 @@
                 emacs/Makefile
                 emacs/uim-version.el
                 test/Makefile
+                test2/Makefile
+                test2/run-singletest.sh
                 examples/Makefile
                 examples/uim-custom/Makefile
                 pixmaps/Makefile

Added: trunk/test2/Makefile.am
==============================================================================
--- (empty file)
+++ trunk/test2/Makefile.am     Mon Mar 31 08:58:27 2008
@@ -0,0 +1,10 @@
+uim_tests =
+uim_optional_tests = test-template.scm
+uim_xfail_tests =
+
+TESTS_ENVIRONMENT = $(SH) $(top_builddir)/test2/run-singletest.sh
+TESTS = $(uim_tests) $(uim_optional_tests)
+XFAIL_TESTS = $(uim_xfail_tests)
+
+EXTRA_DIST = run-singletest.sh.in $(uim_tests)
+DISTCLEANFILES = run-singletest.sh

Added: trunk/test2/run-singletest.sh.in
==============================================================================
--- (empty file)
+++ trunk/test2/run-singletest.sh.in    Mon Mar 31 08:58:27 2008
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+TESTS_DIR="@abs_top_srcdir@/test2"
+UIM_SH="@abs_top_builddir@/uim/uim-sh"
+LIBUIM_SYSTEM_SCM_FILES="@abs_top_srcdir@/sigscheme/lib"
+LIBUIM_SCM_FILES="@abs_srcdir@"
+LIBUIM_PLUGIN_LIB_DIR="@abs_top_builddir@/uim/.libs"
+
+cd @top_srcdir@ && $UIM_SH $TESTS_DIR/$1

Added: trunk/test2/test-template.scm
==============================================================================
--- (empty file)
+++ trunk/test2/test-template.scm       Mon Mar 31 08:58:27 2008
@@ -0,0 +1,68 @@
+;;  test-template.scm: Template file for unit tests
+;;
+;;; Copyright (c) 2008 uim Project http://code.google.com/p/uim/
+;;
+;;  All rights reserved.
+;;
+;;  Redistribution and use in source and binary forms, with or without
+;;  modification, are permitted provided that the following conditions
+;;  are met:
+;;
+;;  1. Redistributions of source code must retain the above copyright
+;;     notice, this list of conditions and the following disclaimer.
+;;  2. Redistributions in binary form must reproduce the above copyright
+;;     notice, this list of conditions and the following disclaimer in the
+;;     documentation and/or other materials provided with the distribution.
+;;  3. Neither the name of authors nor the names of its contributors
+;;     may be used to endorse or promote products derived from this software
+;;     without specific prior written permission.
+;;
+;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS +;; IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+;;  THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+;;  PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR
+;;  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+;;  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+;;  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+;; PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+;;  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+;;  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+;;  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+;; SigScheme-specific extension name
+(require-extension (unittest))
+
+;; Use these assertions.
+;;
+;; SRFI-64 compatible assertions:
+;;   (test-error expr)
+;;   (test-equal expected expr)
+;;   (test-eqv   expected expr)
+;;   (test-eq    expected expr)
+;;
+;; SigScheme-specific assertions:
+;;   (test-true  expr)
+;;   (test-false expr)
+;;
+;; The SRFI-64 assertion 'test-assert' is not recommended since
+;; writing (test-assert <exp>) and (test-assert (not <exp>)) is
+;; cumbersome. Use 'test-true' and 'test-false' instead.
+;;
+;; And enclose the assertions with SRFI-64 compatible 'test-begin' and
+;; 'test-end' to form a test suite, and call SigScheme-specific
+;; 'test-report-result' at last.
+
+(test-begin "Test1")
+(test-error (car 1))
+(test-equal "string" (string-append "str" "ing"))
+(test-eqv   2 (+ 1 1))
+(test-eq    'symbol (symbol-append 'sym 'bol))
+(test-assert (eqv? 2 (+ 1 1)))
+(test-end)
+
+(test-begin "Test2")
+(test-true  (eqv? 2 (+ 1 1)))
+(test-false (eqv? 2 (+ 1 2)))
+(test-end)
+
+(test-report-result)

Reply via email to