monotone-commits-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Monotone-commits-diffs] net.venge.monotone.source-tree-cleanup: fa0cea


From: code
Subject: [Monotone-commits-diffs] net.venge.monotone.source-tree-cleanup: fa0ceabbb82c1519a5e1d9c5ea4efcc2217c645b
Date: Mon, 27 Dec 2010 01:37:52 GMT

revision:            fa0ceabbb82c1519a5e1d9c5ea4efcc2217c645b
date:                2010-12-27T01:37:29
author:              address@hidden
branch:              net.venge.monotone.source-tree-cleanup
changelog:
* Makefile.am: move tester-related binaries to test/bin
* Makefile.am: remove dropped cygwin/ from EXTRA_DIST
* Makefile.am: move test *.status files to test/ and create
  a new phony "testers" target which creates all the needed
  facilities for manual test execution via the run_*_tests
  scripts
* Makefile.am: expand mostlyclean-local and delete pdf, dvi,
  info, tester scripts and a couple of other created junk
* notes/README.testing: adapt wrt the above changes; add
  some newlines
* .mtn-ignore: adapt accordingly
* test/unit-testsuite.lua: adapt the path to the tests directory
  where we also create the temporary tester files; its a bit
  ugly to query the path of the unit_tester binary with
  getpathof like this, but for some weird reason the PATH setting
  PATH=.:./test/bin:... is not honored (maybe because the tester
  already chdir'd to test/work/, at least this is what an 
  `execute("pwd")` from within unit-testsuite.lua reports).
  The hack right now only works because the implementation of 
  getpathof() internally checks not only $PATH, but also if the
  given partial path concatenated with the initial / source path
  exists. I assume that this was pretty much the same reason why
  it worked before as well, since tester and unit_tester where
  all directly put into the initial / source path before.

manifest:
format_version "1"

new_manifest [168746dabd1e8eba83630ddca0120a14108dbb7e]

old_revision [06129c183d81a8b020694508610a139d95e9e76a]

patch ".mtn-ignore"
 from [6a5d3d2c78088a938d8b5f47ad160f0ec4523299]
   to [f5f091af105525f13f4263a6ac869ef6c20d41af]

patch "Makefile.am"
 from [087aee93aef9a2d13c14fac591fc3b03cb4e573e]
   to [8efe4d95d2a821b4a50ed3b3691f6530b2e26da4]

patch "notes/README.testing"
 from [16a56d98d6ea73e518c16192db1e8d7de4b5f793]
   to [453b1e789e4fec67ee89fd876f15b59e4214b949]

patch "test/unit-testsuite.lua"
 from [a8fd12b4d50135121bf3e9be6247bd0fbf0ade58]
   to [4c871a34d4dea93d81469904db165b2ffd379d88]
============================================================
--- Makefile.am	087aee93aef9a2d13c14fac591fc3b03cb4e573e
+++ Makefile.am	8efe4d95d2a821b4a50ed3b3691f6530b2e26da4
@@ -224,13 +224,13 @@ nodist_mtn_SOURCES = src/std_hooks.cc sr
 mtn_SOURCES = $(MOST_SOURCES) src/monotone.cc
 nodist_mtn_SOURCES = src/std_hooks.cc src/schema.cc
 
-unit_tester_SOURCES = $(UNIT_TESTERS) $(UNIT_TESTERS_PRIV) \
+test_bin_unit_tester_SOURCES = $(UNIT_TESTERS) $(UNIT_TESTERS_PRIV) \
 	$(UNIT_TESTEES) $(UNIT_TEST_SUPPORT)
 
-tester_SOURCES = test/src/tester.cc src/transforms.cc src/gzip.cc \
+test_bin_tester_SOURCES = test/src/tester.cc src/transforms.cc src/gzip.cc \
 	$(SANITY_CORE_SOURCES) $(LUAEXT_SOURCES) src/pcrewrap.cc \
 	src/specialized_lexical_cast.cc
-nodist_tester_SOURCES = test/src/testlib.cc
+nodist_test_bin_tester_SOURCES = test/src/testlib.cc
 
 txt2c_SOURCES = util/txt2c.cc
 
@@ -293,15 +293,15 @@ if WIN32_PLATFORM
 if WIN32_PLATFORM
   libplatform_a_SOURCES += $(WIN32_PLATFORM_SOURCES)
   mtn_SOURCES += src/win32/main.cc
-  tester_SOURCES += test/src/win32/tester-plaf.cc
-  check_net_SOURCES = test/src/win32/tester-check-net.cc
+  test_bin_tester_SOURCES += test/src/win32/tester-plaf.cc
+  test_bin_check_net_SOURCES = test/src/win32/tester-check-net.cc
   AM_CPPFLAGS += -DWIN32
   LDADD += -lshfolder -lws2_32 -liconv -liphlpapi
 else
   libplatform_a_SOURCES += $(UNIX_PLATFORM_SOURCES)
   mtn_SOURCES += src/unix/main.cc
-  tester_SOURCES += test/src/unix/tester-plaf.cc
-  check_net_SOURCES = test/src/unix/tester-check-net.cc
+  test_bin_tester_SOURCES += test/src/unix/tester-plaf.cc
+  test_bin_check_net_SOURCES = test/src/unix/tester-check-net.cc
 endif
 
 if MISSING_INET_PTON
@@ -364,7 +364,7 @@ EXTRA_DIST =								\
 									\
 	src/package_revision.txt src/package_full_revision_dist.txt	\
 									\
-	contrib cygwin examples mac notes visualc
+	contrib examples mac notes visualc
 
 MAKEINFOFLAGS=-I $(top_builddir)
 
@@ -536,7 +536,7 @@ linguas.iss: ${top_srcdir}/Makefile.am
 # shell script embedded in the 'check-local' rule is partially
 # borrowed from automake 1.9's check.am
 
-check-local: tester_tests.status unit_tests.status func_tests.status
+check-local: test/tester.status test/unit.status test/func.status
 	@all=0; failed=0; error=0;					       \
 	for f in $^; do							       \
 	  all=`expr $$all + 1`;						       \
@@ -582,23 +582,28 @@ run_%_tests: Makefile
 	exit $$exit
 
 run_%_tests: Makefile
-	$(AM_V_GEN){ echo '#!/bin/sh';						  \
-	  echo 'export LANG=C';							  \
-	  echo 'PATH=$(top_builddir):$$PATH';					  \
-	  echo '$(top_builddir)/tester $(srcdir)/test/$*-testsuite.lua "$$@"';	  \
-	  echo 'echo $$? > $*_tests.status';				  	  \
+	$(AM_V_GEN){ echo '#!/bin/sh';						  	\
+	  echo 'export LANG=C';							  	\
+	  echo 'PATH=$(top_builddir):$(top_builddir)/test/bin:$$PATH';		  	\
+	  echo '$(top_builddir)/test/bin/tester $(srcdir)/test/$*-testsuite.lua "$$@"';	\
+	  echo 'echo $$? > $(top_builddir)/test/$*.status';		  	  	\
 	  echo 'exit 0'; } > $@ && \
 	chmod 755 $@
 
 # The leading + causes Make to treat this as a recursive invocation,
 # allowing it to participate in the jobserver protocol.
-%_tests.status: run_%_tests test/%-testsuite.lua tester$(EXEEXT) FORCE
+test/%.status: run_%_tests test/%-testsuite.lua test/bin/tester$(EXEEXT) FORCE
 	+$(AM_V_at)./run_$*_tests
+test/unit.status : test/bin/unit_tester$(EXEEXT)
+test/func.status : mtn$(EXEEXT) test/bin/check_net$(EXEEXT)
 
-unit_tests.status : unit_tester$(EXEEXT)
-func_tests.status : mtn$(EXEEXT) check_net$(EXEEXT)
-check_PROGRAMS = unit_tester tester check_net
+# Creates the needed artifacts for manual test execution
+.PHONY: testers
+testers: mtn$(EXEEXT) test/bin/tester$(EXEEXT) test/bin/unit_tester$(EXEEXT) \
+	test/bin/check_net$(EXEEXT) run_tester_tests run_func_tests run_unit_tests
 
+check_PROGRAMS = test/bin/unit_tester test/bin/tester test/bin/check_net
+
 # We want the tests re-run even if the .status files already exist.
 # .PHONY does not work for that (bad interaction with pattern rules),
 # but the FORCE hack does.
@@ -606,16 +611,21 @@ FORCE:
 FORCE:
 .PRECIOUS: run_tester_tests run_unit_tests run_func_tests
 
+# FIXME: if it annoys anybody, we could clean dvi, pdf and info files
+#        only in a separate maintainer-clean target as suggested by
+#	 automake's man page
 mostlyclean-local:
-	rm -rf test/tester_dir html
-	set -ex; for d in test/unit/*/__driver__.lua; do \
+	rm -rf html test/bin test/work
+	rm -f monotone.{dvi,pdf,html} monotone.info{,-*} \
+	  run_*_tests test/*.status test/src/testlib.cc util/txt2c
+	set -ex; for d in test/unit/tests/*/__driver__.lua; do \
 	  rm -f $$d; \
 	  rmdir $${d%/*} || :; \
 	done
 
 DISTCLEANFILES = src/mt-stdint.h src/xgettext.opts src/pch-build.hh.gch.dep	\
 	run_tester_tests run_unit_tests run_func_tests				\
-	tester_tests.status unit_tests.status func_tests.status
+	test/tester.status test/unit.status test/func.status
 
 # we generate some source files to copy data into the executable
 # note that the only things that should go in BUILT_SOURCES are things
@@ -744,8 +754,8 @@ distcheck-hook:
 
 # the distcheck-hook checks for errors in the use of base.hh
 distcheck-hook:
-	cd $(srcdir) && $(SHELL) audit-includes \
-		$(sort $(mtn_SOURCES) $(unit_tester_SOURCES) $(tester_SOURCES) \
+	cd $(srcdir) && $(SHELL) util/audit-includes \
+		$(sort $(mtn_SOURCES) $(test_unit_tester_SOURCES) $(test_bin_tester_SOURCES) \
                        $(UNIX_PLATFORM_SOURCES) $(WIN32_PLATFORM_SOURCES) \
                        src/win32/main.cc src/unix/main.cc)
 
============================================================
--- notes/README.testing	16a56d98d6ea73e518c16192db1e8d7de4b5f793
+++ notes/README.testing	453b1e789e4fec67ee89fd876f15b59e4214b949
@@ -9,34 +9,40 @@ monotone-specific addons.
 respectively describe the basic testing framework's API, and the
 monotone-specific addons.
 
+
 Running tests:
 --------------
+
 -  Starting in the monotone main dir. After having './configure'd monotone you 
-   can do 'make tester' to create 'tester', the program that runs the tests.
--  Running './tester test/<name>-testsuite.lua' will run the specific test suite.
-   Available test suites are 'func' (functional tests), 'unit' (C++ unit tests)
-   and 'tester' (tests for the test framework itself)
--  './tester test/<name>-testsuite.lua -l' lists the names and numbers of all 
-   available tests in the specific suite
--  './tester test/<name>-testsuite.lua <n>' runs only test number n from the
-   specific suite, negative n counts from the end
--  './tester test/<name>-testsuite.lua foobar' runs tests with "foobar" in the name
-   (it's actually a regex)
--  option -d will keep the tester_dir files for post-test debugging
--  option -h is your friend :)
--  summary of test logs in test/work/<name>.log
--  details of test logs in test/work/<name>/<testname>/tester.log
+   can do 'make testers' to create the needed test infrastructure, such as
+   the 'tester' program that runs the tests, the 'unit_tester' binary for the
+   unit tests and some auxiliary scripts.
 
-Creating tests:
----------------
+-  Execute './run_func_tests' to run the functional tests, './run_unit_tests'
+   for the C++ unit tests and './run_tester_tests' for tests of the test framework
+   itself. Each script accepts the following options and arguments:
+
+    '-l'    : lists the names and numbers of all available tests in the suite
+    '<n>'   : runs only test number n from the suite, negative n counts from the end
+    'foobar': runs tests with "foobar" in the name (it's actually a regex)
+    '-d'    : keeps the work files for post-test debugging in test/work;
+              summary of test logs are saved under test/work/{func,unit,tester}.log,
+              detailed test logs are available under
+              test/work/{func,unit,tester}/<testname>/tester.log
+
+
+Creating new functional tests:
+------------------------------
+
 -  Copy and paste is your friend :)
 -  Make a new directory test/func/<testname>
 -  Create a new file __driver__.lua inside this directory
 -  Sometimes you need to canonicalize things
 
-Template for a test (name test/func/<testname>/__driver__.lua:
-------------------------------------------------
 
+Template for a functional test:
+-------------------------------
+
 -- Initialize our workspace
 mtn_setup()
 
@@ -50,6 +56,7 @@ xfail_if(true, mtn("foobar"), 0)
 -- we tell the test program that this is expected to fail
 xfail_if(true, mtn("foobar"), 0)
 
+
 Debugging
 ---------
 
============================================================
--- .mtn-ignore	6a5d3d2c78088a938d8b5f47ad160f0ec4523299
+++ .mtn-ignore	f5f091af105525f13f4263a6ac869ef6c20d41af
@@ -10,7 +10,6 @@
 ^depcomp$
 ^html
 ^install-sh$
-^lua_tests\.status$
 ^m4/codeset\.m4$
 ^m4/gettext\.m4$
 ^m4/glibc21\.m4$
@@ -33,6 +32,7 @@
 ^mkinstalldirs$
 ^monotone\.(cps?|fn|ky|pg|tp|vr|toc|pdf|ps|dvi|log|info(-[0-9]+)?)$
 ^monotone\.html$
+^monotone\.pot$
 ^mtn$
 ^mtn.1$
 ^mtn.dSYM$
@@ -44,24 +44,20 @@
 ^po/address@hidden
 ^po/address@hidden
 ^po/insert-header\.sin$
-^po/monotone\.pot$
 ^po/quot\.sed$
-^run_func_tests$
-^run_tester_tests$
-^run_unit_tests$
+^run_(func|tester|unit)_tests$
 ^src/package_(full_)?revision(\.cc|\.txt|_(dist|raw)\.txt)$
 ^src/schema\.cc$
 ^src/std_hooks\.cc$
 ^stamp-h1$
 ^stamp-vti$
+^test/(func|tester|unit)\.status$
+^test/bin$
 ^test/src/testlib\.cc$
+^test/unit/tests/[^._]*(_+[^._]+)+$
 ^test/work$
 ^test_hooks\.cc$
-^tester$
-^tester_tests\.status$
 ^texinfo\.tex$
-^unit_tester$
-^unit_tests\.status$
 ^util/txt2c$
 ^util/txt2c.dSYM$
 ^version\.texi$
============================================================
--- test/unit-testsuite.lua	a8fd12b4d50135121bf3e9be6247bd0fbf0ade58
+++ test/unit-testsuite.lua	4c871a34d4dea93d81469904db165b2ffd379d88
@@ -8,13 +8,13 @@
 -- PURPOSE.
 
 -- This test suite is special; it synthesizes all its __driver__.lua
--- files on the fly.  Each one runs the 'unit_tests' binary over just
+-- files on the fly.  Each one runs the 'unit_tester' binary over just
 -- one of the test cases it can run.
 
-testdir = initial_dir .. "/unit-tests"
+testdir = srcdir.."/unit/tests"
 
 function prepare_to_enumerate_tests (P)
-   local unit_test_path = getpathof("unit_tester")
+   local unit_test_path = getpathof("test/bin/unit_tester")
    if unit_test_path == nil then return 1 end
 
    writefile_q("in", nil)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]