]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
test: Rearrange files into test and unittest directories
authorJoel Rosdahl <joel@rosdahl.net>
Mon, 29 Jan 2018 19:57:18 +0000 (20:57 +0100)
committerJoel Rosdahl <joel@rosdahl.net>
Mon, 29 Jan 2018 20:21:20 +0000 (21:21 +0100)
* The unit tests formerly located in the test directory have been moved
  to the unittest directory.
* The integration test suite test.sh has been made a bash script and
  renamed to test/run. Its test suites are located in test/suites.

40 files changed:
.gitignore
Makefile.in
configure.ac
dev.mk.in
test/run [moved from test.sh with 99% similarity]
test/suites/base.bash [moved from test_suites/base.sh with 100% similarity]
test/suites/basedir.bash [moved from test_suites/basedir.sh with 100% similarity]
test/suites/cleanup.bash [moved from test_suites/cleanup.sh with 100% similarity]
test/suites/compression.bash [moved from test_suites/compression.sh with 100% similarity]
test/suites/debug_prefix_map.bash [moved from test_suites/debug_prefix_map.sh with 100% similarity]
test/suites/direct.bash [moved from test_suites/direct.sh with 100% similarity]
test/suites/hardlink.bash [moved from test_suites/hardlink.sh with 100% similarity]
test/suites/input_charset.bash [moved from test_suites/input_charset.sh with 100% similarity]
test/suites/masquerading.bash [moved from test_suites/masquerading.sh with 100% similarity]
test/suites/multi_arch.bash [moved from test_suites/multi_arch.sh with 100% similarity]
test/suites/nocpp2.bash [moved from test_suites/nocpp2.sh with 100% similarity]
test/suites/nvcc.bash [moved from test_suites/nvcc.sh with 100% similarity]
test/suites/nvcc_direct.bash [moved from test_suites/nvcc_direct.sh with 100% similarity]
test/suites/nvcc_ldir.bash [moved from test_suites/nvcc_ldir.sh with 100% similarity]
test/suites/nvcc_nocpp2.bash [moved from test_suites/nvcc_nocpp2.sh with 100% similarity]
test/suites/pch.bash [moved from test_suites/pch.sh with 100% similarity]
test/suites/readonly.bash [moved from test_suites/readonly.sh with 100% similarity]
test/suites/readonly_direct.bash [moved from test_suites/readonly_direct.sh with 100% similarity]
test/suites/serialize_diagnostics.bash [moved from test_suites/serialize_diagnostics.sh with 100% similarity]
test/suites/upgrade.bash [moved from test_suites/upgrade.sh with 100% similarity]
unittest/framework.c [moved from test/framework.c with 100% similarity]
unittest/framework.h [moved from test/framework.h with 100% similarity]
unittest/main.c [moved from test/main.c with 100% similarity]
unittest/test_args.c [moved from test/test_args.c with 100% similarity]
unittest/test_argument_processing.c [moved from test/test_argument_processing.c with 100% similarity]
unittest/test_compopt.c [moved from test/test_compopt.c with 100% similarity]
unittest/test_conf.c [moved from test/test_conf.c with 100% similarity]
unittest/test_counters.c [moved from test/test_counters.c with 100% similarity]
unittest/test_hash.c [moved from test/test_hash.c with 100% similarity]
unittest/test_hashutil.c [moved from test/test_hashutil.c with 100% similarity]
unittest/test_lockfile.c [moved from test/test_lockfile.c with 100% similarity]
unittest/test_stats.c [moved from test/test_stats.c with 100% similarity]
unittest/test_util.c [moved from test/test_util.c with 100% similarity]
unittest/util.c [moved from test/util.c with 100% similarity]
unittest/util.h [moved from test/util.h with 100% similarity]

index 7896ad11617ad2af2617c9bb49873a2033df7a85..a9b9524627bcbfc8014b03b6c55e45d49316391d 100644 (file)
@@ -8,9 +8,9 @@
 Makefile
 autom4te.cache
 ccache
-ccache.exe
 ccache-*.tar.*
 ccache.1
+ccache.exe
 ccache.html
 ccache.xml
 config.cache
@@ -19,10 +19,10 @@ config.h.in
 config.log
 config.status
 configure
-dev_mode_disabled
 dev.mk
+dev_mode_disabled
 perfdir.*
-test/main
-test/suites.h
 testdir.*
+unittest/run
+unittest/suites.h
 version.c
index 3ddabaa06ef9fa408318f92dc2f13722628f0047..7b218c35e067e0d1b97604b02e5fe14580a316b4 100644 (file)
@@ -10,7 +10,7 @@ sysconfdir = @sysconfdir@
 installcmd = @INSTALL@
 
 AR = @AR@
-SH = @SH@
+BASH = @BASH@
 CC = @CC@
 CFLAGS = @CFLAGS@
 CPPFLAGS = @CPPFLAGS@
@@ -61,13 +61,14 @@ zlib_sources = \
 zlib_objs = $(zlib_sources:.c=.o)
 
 test_suites = @test_suites@
-test_sources = test/main.c test/framework.c test/util.c $(test_suites)
+test_sources = unittest/main.c unittest/framework.c unittest/util.c
+test_sources += $(test_suites)
 test_objs = $(test_sources:.c=.o)
 
 all_sources = $(ccache_sources) $(test_sources)
 all_objs = $(ccache_objs) $(test_objs) $(zlib_objs)
 
-files_to_clean = $(all_objs) ccache$(EXEEXT) test/main$(EXEEXT) *~ testdir.*
+files_to_clean = $(all_objs) ccache$(EXEEXT) unittest/run$(EXEEXT) *~ testdir.*
 files_to_distclean = Makefile config.h config.log config.status
 
 .PHONY: all
@@ -100,20 +101,20 @@ perf: ccache$(EXEEXT)
        $(srcdir)/perf.py --ccache ccache$(EXEEXT) $(CC) $(all_cppflags) $(all_cflags) $(srcdir)/ccache.c
 
 .PHONY: test
-test: ccache$(EXEEXT) test/main$(EXEEXT)
-       test/main$(EXEEXT)
-       CC='$(CC)' $(SH) $(srcdir)/test.sh
+test: ccache$(EXEEXT) unittest/run$(EXEEXT)
+       unittest/run$(EXEEXT)
+       CC='$(CC)' $(BASH) $(srcdir)/test/run
 
-.PHONY: quicktest
-quicktest: test/main$(EXEEXT)
-       test/main$(EXEEXT)
+.PHONY: unittest
+unittest: unittest/run$(EXEEXT)
+       unittest/run$(EXEEXT)
 
-test/main$(EXEEXT): $(base_objs) $(test_objs) $(extra_libs)
+unittest/run$(EXEEXT): $(base_objs) $(test_objs) $(extra_libs)
        $(CC) $(all_cflags) -o $@ $(base_objs) $(test_objs) $(LDFLAGS) $(extra_libs) $(LIBS)
 
-test/main.o: test/suites.h
+unittest/main.o: unittest/suites.h
 
-test/suites.h: $(test_suites) Makefile
+unittest/suites.h: $(test_suites) Makefile
        sed -n 's/TEST_SUITE(\(.*\))/SUITE(\1)/p' $(test_suites) >$@
 
 .PHONY: check
@@ -124,9 +125,9 @@ distclean: clean
        rm -rf $(files_to_distclean)
 
 .PHONY: installcheck
-installcheck: ccache$(EXEEXT) test/main$(EXEEXT)
-       test/main$(EXEEXT)
-       CCACHE=$(bindir)/ccache CC='$(CC)' $(SH) $(srcdir)/test.sh
+installcheck: ccache$(EXEEXT) unittest/run$(EXEEXT)
+       unittest/run$(EXEEXT)
+       CCACHE=$(bindir)/ccache CC='$(CC)' $(BASH) $(srcdir)/test/run
 
 .c.o:
        $(CC) $(all_cppflags) $(all_cflags) -c -o $@ $<
index f84d1e0f041cdbce497f9f638ae97e4276c4229c..f24e1d6633cb809f11e736fd45478893788a7387 100644 (file)
@@ -37,7 +37,7 @@ if test -z "$AR"; then
 fi
 
 # Prefer bash, needed for test.sh
-AC_PATH_TOOL(SH, bash, "/bin/sh")
+AC_PATH_TOOL(BASH, bash, "/bin/bash")
 
 # If GCC, turn on warnings.
 if test "x$GCC" = "xyes"; then
@@ -172,7 +172,7 @@ if test ! -f $srcdir/version.c; then
 fi
 
 dnl Find test suite files.
-test_suites=`ls $srcdir/test/test_*.c | egrep -v 'BASE|BACKUP|LOCAL|REMOTE' | xargs echo`
+test_suites=`ls $srcdir/unittest/test_*.c | egrep -v 'BASE|BACKUP|LOCAL|REMOTE' | xargs echo`
 
 AC_CONFIG_FILES([Makefile])
 AC_OUTPUT
@@ -185,7 +185,7 @@ cat config.h >>config.h.tmp
 echo '#endif' >>config.h.tmp
 mv config.h.tmp config.h
 
-mkdir -p .deps test
+mkdir -p .deps unittest
 
 
 AC_MSG_NOTICE(now build ccache by running make)
index 9b681beac2ab860ee970416c58c9f41b67203954..3254bd5a7415cb3a5a9a0b896aa7ad4051d041e4 100644 (file)
--- a/dev.mk.in
+++ b/dev.mk.in
@@ -46,12 +46,12 @@ headers = \
     mdfour.h \
     murmurhashneutral2.h \
     system.h \
-    test/framework.h \
-    test/suites.h \
-    test/util.h
+    unittest/framework.h \
+    unittest/suites.h \
+    unittest/util.h
 
 files_to_clean += *.tar.bz2 *.tar.gz *.tar.xz *.xml .deps/* perfdir.*
-files_to_distclean += $(built_dist_files) version.c test/suites.h
+files_to_distclean += $(built_dist_files) version.c unittest/suites.h
 files_to_distclean += .deps version.c dev.mk
 
 source_dist_files = \
@@ -59,8 +59,8 @@ source_dist_files = \
     $(headers) \
     $(test_sources) \
     AUTHORS.txt \
+    CONTRIBUTING.md \
     GPL-3.0.txt \
-    HACKING.txt \
     LICENSE.txt \
     MANUAL.txt \
     Makefile.in \
@@ -80,7 +80,8 @@ source_dist_files = \
     install-sh \
     m4 \
     main.c \
-    test.sh \
+    test/run \
+    test/suites/* \
     zlib/*.c \
     zlib/*.h
 
similarity index 99%
rename from test.sh
rename to test/run
index 62940f738d99d5c209483c04eaa234dc0692f20a..10214b73d3db52c63be2e2c3b90f1bcc8d60d916 100755 (executable)
--- a/test.sh
+++ b/test/run
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 #
 # A simple test suite for ccache.
 #
@@ -364,7 +364,7 @@ nvcc_nocpp2
 "
 
 for suite in $all_suites; do
-    . test_suites/$suite.sh
+    . $(dirname $0)/suites/$suite.bash
 done
 
 # ---------------------------------------
similarity index 100%
rename from test_suites/base.sh
rename to test/suites/base.bash
similarity index 100%
rename from test_suites/nvcc.sh
rename to test/suites/nvcc.bash
similarity index 100%
rename from test_suites/pch.sh
rename to test/suites/pch.bash
similarity index 100%
rename from test/framework.c
rename to unittest/framework.c
similarity index 100%
rename from test/framework.h
rename to unittest/framework.h
similarity index 100%
rename from test/main.c
rename to unittest/main.c
similarity index 100%
rename from test/test_args.c
rename to unittest/test_args.c
similarity index 100%
rename from test/test_compopt.c
rename to unittest/test_compopt.c
similarity index 100%
rename from test/test_conf.c
rename to unittest/test_conf.c
similarity index 100%
rename from test/test_hash.c
rename to unittest/test_hash.c
similarity index 100%
rename from test/test_stats.c
rename to unittest/test_stats.c
similarity index 100%
rename from test/test_util.c
rename to unittest/test_util.c
similarity index 100%
rename from test/util.c
rename to unittest/util.c
similarity index 100%
rename from test/util.h
rename to unittest/util.h