>From e4d8618dfd0c115f8b6076411e74d2df10e383af Mon Sep 17 00:00:00 2001 From: Bruno Haible
Date: Wed, 20 Mar 2019 00:37:52 +0100 Subject: [PATCH 2/2] libtextstyle-optional: Add tests. * tests/test-libtextstyle.c: New file, based on libtextstyle's adhoc-tests/hello.c. * tests/test-libtextstyle-default.css: New file, copied from libtextstyle's adhoc-tests/hello-default.css. * modules/libtextstyle-optional-tests: New file. --- ChangeLog | 7 +++ modules/libtextstyle-optional-tests | 14 +++++ tests/test-libtextstyle-default.css | 7 +++ tests/test-libtextstyle.c | 101 ++++++++++++++++++++++++++++++++++++ 4 files changed, 129 insertions(+) create mode 100644 modules/libtextstyle-optional-tests create mode 100644 tests/test-libtextstyle-default.css create mode 100644 tests/test-libtextstyle.c diff --git a/ChangeLog b/ChangeLog index af9d7f1..7f937aa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,12 @@ 2019-03-19 Bruno Haible + libtextstyle-optional: Add tests. + * tests/test-libtextstyle.c: New file, based on libtextstyle's + adhoc-tests/hello.c. + * tests/test-libtextstyle-default.css: New file, copied from + libtextstyle's adhoc-tests/hello-default.css. + * modules/libtextstyle-optional-tests: New file. + libtextstyle-optional: New module. * lib/textstyle.in.h: New file, based on libtextstyle's textstyle.h. * m4/libtextstyle-optional.m4: New file, based on m4/libtextstyle.m4. diff --git a/modules/libtextstyle-optional-tests b/modules/libtextstyle-optional-tests new file mode 100644 index 0000000..2722a18 --- /dev/null +++ b/modules/libtextstyle-optional-tests @@ -0,0 +1,14 @@ +Files: +tests/test-libtextstyle.c +tests/test-libtextstyle-default.css + +Depends-on: +isatty + +configure.ac: + +Makefile.am: +TESTS += test-libtextstyle +check_PROGRAMS += test-libtextstyle +test_libtextstyle_CPPFLAGS = $(AM_CPPFLAGS) -DSRCDIR=\"$(srcdir)/\" +test_libtextstyle_LDADD = $(LDADD) @LIBTEXTSTYLE@ diff --git a/tests/test-libtextstyle-default.css b/tests/test-libtextstyle-default.css new file mode 100644 index 0000000..7eba906 --- /dev/null +++ b/tests/test-libtextstyle-default.css @@ -0,0 +1,7 @@ +/* This file is in the public domain. + + Styling rules for the color-hello example. */ + +.name { text-decoration : underline; } +.boy-name { background-color : rgb(123,201,249); } +.girl-name { background-color : rgb(250,149,158); } diff --git a/tests/test-libtextstyle.c b/tests/test-libtextstyle.c new file mode 100644 index 0000000..970713f --- /dev/null +++ b/tests/test-libtextstyle.c @@ -0,0 +1,101 @@ +/* Ad-hoc testing program for GNU libtextstyle. + Copyright (C) 2018-2019 Free Software Foundation, Inc. + Written by Bruno Haible , 2018. + + 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 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see