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: 534f5807048537b37bb40b2db3


From: code
Subject: [Monotone-commits-diffs] net.venge.monotone: 534f5807048537b37bb40b2db3d7e1fc01581cbb
Date: Fri, 4 Feb 2011 21:33:35 GMT

revision:            534f5807048537b37bb40b2db3d7e1fc01581cbb
date:                2011-02-04T21:32:03
author:              Richard Levitte <address@hidden>
branch:              net.venge.monotone
changelog:
Start adding the infrastructure for testing scripts that come with
monotone.  For now, we test selected things in contrib/, but we expect to
move the selected things to another directory (probably extra/, hence the
name of this test suite).

* Makefile.am (EXTRA_DIST): Add test/extra and test/extra-testsuite.lua .
  (check-local): Add dependency for test/extra.status .
  (testers, .PRECIOUS): Add dependency for run_extra_tests .
  (DISTCLEANFILES): Add run_extra_tests and test/extra.status .
* test/extra: Added directory, every test shall have a subdirectory here,
  containing at least __driver__.lua .
* test/extra-testsuite.lua: Common functions for all the extra tests.

manifest:
format_version "1"

new_manifest [78dbdd8b90d6ff79156d5901d64238783ff50ec9]

old_revision [42ee914eba9a428ce9ee3b8a0d790fa9e6c6b3f2]

add_dir "test/extra"

add_file "test/extra-testsuite.lua"
 content [8e3cc21779f01684ef426308d81d600a531f905b]

patch "Makefile.am"
 from [a10b8f6ab95ffc39636b1a293eaf453fde2006bb]
   to [414b97f32109bb3e1aaaaf57d10fcab973b83698]
============================================================
--- Makefile.am	a10b8f6ab95ffc39636b1a293eaf453fde2006bb
+++ Makefile.am	414b97f32109bb3e1aaaaf57d10fcab973b83698
@@ -346,6 +346,7 @@ EXTRA_DIST =								\
 	$(wildcard $(srcdir)/test/unit/*.hh)				\
 	$(wildcard $(srcdir)/test/unit/tests/*.cc)			\
 	test/unit-testsuite.lua						\
+	test/extra test/extra-testsuite.lua				\
 	test/src/testlib.lua						\
 									\
 	src/package_revision.txt src/package_full_revision_dist.txt	\
@@ -499,7 +500,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: test/tester.status test/unit.status test/func.status
+check-local: test/tester.status test/unit.status test/func.status test/extra.status
 	@all=0; failed=0; error=0;					       \
 	for f in $^; do							       \
 	  all=`expr $$all + 1`;						       \
@@ -563,7 +564,8 @@ testers: mtn$(EXEEXT) test/bin/tester$(E
 # 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
+	test/bin/check_net$(EXEEXT) \
+	run_tester_tests run_func_tests run_unit_tests run_extra_tests
 
 check_PROGRAMS = test/bin/unit_tester test/bin/tester test/bin/check_net
 
@@ -572,7 +574,7 @@ FORCE:
 # but the FORCE hack does.
 .PHONY: check-local FORCE
 FORCE:
-.PRECIOUS: run_tester_tests run_unit_tests run_func_tests
+.PRECIOUS: run_tester_tests run_unit_tests run_func_tests run_extra_tests
 
 # FIXME: if it annoys anybody, we could clean dvi, pdf and info files
 #        only in a separate maintainer-clean target as suggested by
@@ -586,8 +588,8 @@ DISTCLEANFILES = src/mt-stdint.h src/xge
 	done
 
 DISTCLEANFILES = src/mt-stdint.h src/xgettext.opts src/pch-build.hh.gch.dep	\
-	run_tester_tests run_unit_tests run_func_tests				\
-	test/tester.status test/unit.status test/func.status
+	run_tester_tests run_unit_tests run_func_tests run_extra_tests		\
+	test/tester.status test/unit.status test/func.status test/extra.status
 
 # we generate some source files to copy data into the executable
 # note that the only things that should go in BUILT_SRCS are things
============================================================
--- /dev/null	
+++ test/extra-testsuite.lua	8e3cc21779f01684ef426308d81d600a531f905b
@@ -0,0 +1,39 @@
+-- Copyright (C) 2011 Richard Levitte <address@hidden>
+--
+-- This program is made available under the GNU GPL version 2.0 or
+-- greater. See the accompanying file COPYING for details.
+--
+-- This program is distributed WITHOUT ANY WARRANTY; without even the
+-- implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+-- PURPOSE.
+
+testdir = srcdir.."/extra-tests"
+
+function prepare_to_run_tests (P)
+   monotone_path = getpathof("mtn")
+   if monotone_path == nil then monotone_path = "mtn" end
+   set_env("mtn", monotone_path)
+
+   writefile_q("in", nil)
+   prepare_redirect("in", "out", "err")
+
+   local status = execute(monotone_path, "version", "--full")
+   local out = readfile_q("out")
+   local err = readfile_q("err")
+
+   if status == 0 and err == "" and out ~= "" then
+      logfile:write(out)
+   else
+      P(string.format("mtn version --full: exit %d\nstdout:\n", status))
+      P(out)
+      P("stderr:\n")
+      P(err)
+
+      if status == 0 then status = 1 end
+   end
+
+   unlogged_remove("in")
+   unlogged_remove("out")
+   unlogged_remove("err")
+   return status
+end

reply via email to

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