From 1e89ba68afbf8310b0fa34226a5e730e4118a465 Mon Sep 17 00:00:00 2001 From: Eric Haszlakiewicz Date: Sun, 22 Apr 2012 10:27:50 -0500 Subject: [PATCH] Create a tests subdirectory and move one of the test to there. --- Makefile.am | 10 ++++------ Makefile.am.inc | 2 ++ configure.in | 8 +++++++- tests/Makefile.am | 22 ++++++++++++++++++++++ test1.c => tests/test1.c | 0 test1.expected => tests/test1.expected | 0 test1.test => tests/test1.test | 0 7 files changed, 35 insertions(+), 7 deletions(-) create mode 100644 Makefile.am.inc create mode 100644 tests/Makefile.am rename test1.c => tests/test1.c (100%) rename test1.expected => tests/test1.expected (100%) rename test1.test => tests/test1.test (100%) diff --git a/Makefile.am b/Makefile.am index 7f1abb1..cec14fd 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,6 +1,7 @@ -AM_CFLAGS = -Wall -Wwrite-strings -Werror -std=gnu99 -D_GNU_SOURCE -D_REENTRANT +include Makefile.am.inc EXTRA_DIST = README.html README-WIN32.html config.h.win32 doc json-c.vcproj +SUBDIRS = . tests lib_LTLIBRARIES = libjson.la @@ -38,10 +39,7 @@ libjson_la_SOURCES = \ linkhash.c \ printbuf.c -check_PROGRAMS = test1 test2 test4 test_parse_int64 test_null test_cast test_parse - -test1_SOURCES = test1.c -test1_LDADD = $(lib_LTLIBRARIES) +check_PROGRAMS = test2 test4 test_parse_int64 test_null test_cast test_parse test2_SOURCES = test2.c test2_LDADD = $(lib_LTLIBRARIES) @@ -61,7 +59,7 @@ test_cast_LDADD = $(lib_LTLIBRARIES) test_parse_SOURCES = test_parse.c test_parse_LDADD = $(lib_LTLIBRARIES) -TESTS = test1.test test2.test test4.test parse_int64.test test_null.test test_cast.test test_parse.test +TESTS = test2.test test4.test parse_int64.test test_null.test test_cast.test test_parse.test EXTRA_DIST += $(TESTS) testsubdir=testSubDir TESTS_ENVIRONMENT = top_builddir=$(top_builddir) diff --git a/Makefile.am.inc b/Makefile.am.inc new file mode 100644 index 0000000..b1ebce8 --- /dev/null +++ b/Makefile.am.inc @@ -0,0 +1,2 @@ +AM_CFLAGS = -Wall -Wwrite-strings -Werror -std=gnu99 -D_GNU_SOURCE -D_REENTRANT + diff --git a/configure.in b/configure.in index 49b3195..b2c3cbe 100644 --- a/configure.in +++ b/configure.in @@ -5,6 +5,8 @@ AC_INIT([json-c], 0.10, [json-c@googlegroups.com]) AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION) +AC_PROG_MAKE_SET + # Checks for programs. # Checks for libraries. @@ -29,7 +31,11 @@ AC_CHECK_FUNCS(strndup strerror vsnprintf vasprintf open vsyslog strncasecmp) AM_PROG_LIBTOOL -AC_OUTPUT([ +AC_CONFIG_FILES([ Makefile json.pc +tests/Makefile ]) + +AC_OUTPUT + diff --git a/tests/Makefile.am b/tests/Makefile.am new file mode 100644 index 0000000..ed5d2a5 --- /dev/null +++ b/tests/Makefile.am @@ -0,0 +1,22 @@ + +include ../Makefile.am.inc + +#lib_LTLIBRARIES = ../libjson.la + +#check_PROGRAMS = test1 test2 test4 test_parse_int64 test_null test_cast test_parse +check_PROGRAMS = test1 + +#test1_SOURCES = test1.c +#test1_LDADD = $(lib_LTLIBRARIES) +test1_LDADD = $(top_builddir)/libjson.la + +#TESTS = test1.test test2.test test4.test parse_int64.test test_null.test test_cast.test test_parse.test +TESTS = test1.test +EXTRA_DIST= +EXTRA_DIST += $(TESTS) + +testsubdir=testSubDir +TESTS_ENVIRONMENT = top_builddir=$(top_builddir) + +distclean-local: + -rm -rf $(testsubdir) diff --git a/test1.c b/tests/test1.c similarity index 100% rename from test1.c rename to tests/test1.c diff --git a/test1.expected b/tests/test1.expected similarity index 100% rename from test1.expected rename to tests/test1.expected diff --git a/test1.test b/tests/test1.test similarity index 100% rename from test1.test rename to tests/test1.test -- 2.7.4