[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Automake-commit] [SCM] GNU Automake branch, testsuite-work, updated. v1
From: |
Stefano Lattarini |
Subject: |
[Automake-commit] [SCM] GNU Automake branch, testsuite-work, updated. v1.11-1404-gd344ff9 |
Date: |
Sun, 18 Sep 2011 17:56:36 +0000 |
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Automake".
http://git.sv.gnu.org/gitweb/?p=automake.git;a=commitdiff;h=d344ff97931dee43c7a1a7f815142042c9813bf8
The branch, testsuite-work has been updated
via d344ff97931dee43c7a1a7f815142042c9813bf8 (commit)
via b2b17e15d99b79401b4dee71e6830eed063fa5c7 (commit)
via 066f495979623f36aafa81a1927130dca7607eaf (commit)
via 8ad2fe638cc2e04447ac5b909335a193deaf23da (commit)
via b52f63c824a044e8adcde2ffe3640e0074c615a1 (commit)
via cd2efb9f05528c9c68e80185b250fe5b0abdec14 (commit)
via dd7e620bf9ef468a762be8594c61c7e5bb0b0d27 (commit)
via 0b7d3cbc93055201bc58497e6519f477d0b72701 (commit)
via c31004a89fe50fedbce1b39cc567f06ab1c3a892 (commit)
via 8d97cb95019b04707fdd60b4d9994d0acc9c6554 (commit)
via 16912bdf1eeeeac517377e15c6c8bfe7743f9419 (commit)
via 54942406955b4368104208eadeb55a13a258fa2e (commit)
via 4f43232f4dc62bd3951cb5fda2bf1933b707902e (commit)
via e9e0b23fc89dbec01138359033b13a8f8be50ee8 (commit)
via 76b756f9a40ca7b086d8239f48b0363e394eda5b (commit)
via 1e90abcc6da204b8ac0c9b53a5acda75c2b07204 (commit)
via c9a6f7e262be9f011862580a07e37091819b6785 (commit)
via 9a937d21bbf695af2749d6ca2cd2def96009ec9a (commit)
via 2990ef353fa395d1b7ded2aa15f5cf574adbb78d (commit)
via df73c36180fe7e822f4dbdfa9de4c460f8c8b795 (commit)
via 20787ab1199329eda967d14a6fd1d7f6a92d149a (commit)
via 829c04e73e888e8d03371f20707a8e993c217d15 (commit)
via 31b07ed6985969d6d9663a0e9ed51217910dd7c0 (commit)
via 60bd0bf85380e6cabb50ff07cec3366c18f170b2 (commit)
via 672fd9352b5b8a07ab0c74cef2357770497fcdaa (commit)
via 036767871101be12266ca04f9efe1957727744de (commit)
via 527d34a6af23afcbede70765e72a255c7affe729 (commit)
via f2f162f5efda16ddb660163f838d27969d1e4025 (commit)
via fc8f9d7f9ec4a17be36595a35ec83d441ac2b8cf (commit)
via 4480d9cf5bae98acd9d08d14d95f0dab149b9e7d (commit)
via 9f10765954f400c047b3d6cd12e31e54efefe0c3 (commit)
via fc27b8fa70ffad842a525e05d5069022b96f6388 (commit)
via afeb921c579c9d1b75a5ce8aad442f359b51e0c5 (commit)
via 3f7d0a5e8a9970e166a228a32a3bc80cd6da7868 (commit)
via f52e9abd0c2a4dfaa35993b448d1db5518687243 (commit)
via a2ebf0e5b1f34d76ce92673cf8575a10d33f9b05 (commit)
via cd16ceb382de8f64d44efd7dd1948c33fc52566e (commit)
via 429b748cecaa046d11f5a93bea0c93c809179ed6 (commit)
via a716df2ed5f62889d3b442d5ecc5e2edd6794ee4 (commit)
via dd8b570a6a55cb20690cdc2c312309338d2495d3 (commit)
via b46debf534a9adab1b7c8e8b96c3c11de5dc9ae4 (commit)
via 30f8ffc019653ba9b0ab47deda155d0efe660c8f (commit)
via bf1d029660136387a9fd4a451b230f954a81db5c (commit)
via 2c2e5b4c334e7af191df3b6dfcc82001030447bc (commit)
via 54932fd5e6957feb7a29f1e7e2ca68aa3b21ea91 (commit)
via afe776121aab4a44fe8dffcb7c8949c015370f90 (commit)
via a3988aeac8df3c9b4c1f2ea705ef96f00ab72ce5 (commit)
via 62cb9a4f4be71d740ff412f0ba7c7ef29feaa8a0 (commit)
via 5a46e0340900136d66dee39450117a70a4190d45 (commit)
via aa3ad84fd24967756cb031c4f3529198afdba900 (commit)
via 59b5f75f6095f40d3316cb2928ba1d1f30ab15ce (commit)
via 33e8c5aedbcb397954455761bee62715737a309a (commit)
via 6a5482fcf190641eb46e00fe877ea1e31f241488 (commit)
via 6b53cb6bfab7d903e5bf72bf2f0697be335707a8 (commit)
via 01dede4422493957c23b3bc7ecfe596f93a58a54 (commit)
via 0bf20ac342d7d4e2eaede58e110faf356e34e167 (commit)
via d76b503883525aaab6048102cbfe96bbdd9a0a85 (commit)
via 141f17ca87d007fdfde0da85475dea7556c636a0 (commit)
from fad31722c6a5161fbbfc1e09361a5324569ad67b (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit d344ff97931dee43c7a1a7f815142042c9813bf8
Author: Stefano Lattarini <address@hidden>
Date: Sun Sep 18 19:53:11 2011 +0200
py-compile tests: more faithful 'installcheck' support
* tests/py-compile-basedir.test: Use the `$am_scriptsdir' variable
instead of `$testsrcdir/../lib', to test more faithfully under
"make installcheck". More uses of the `fatal_' subroutine to
diagnose hard errors.
* tests/py-compile-basic.test: Likewise.
* tests/py-compile-basic2.test: Likewise.
* tests/py-compile-destdir.test: Likewise.
* tests/py-compile-env.test: Likewise.
* tests/py-compile-option-terminate.test: Likewise.
* tests/py-compile-usage.test: Likewise.
commit b2b17e15d99b79401b4dee71e6830eed063fa5c7
Author: Stefano Lattarini <address@hidden>
Date: Sun Sep 18 19:25:38 2011 +0200
tests: remove redundant settings of `errexit' shell flag
* tests/aclocal-acdir.test: Do not set the `errexit' shell
flag, as it is already set by `tests/defs'.
* tests/aclocal-print-acdir.test: Likewise.
* tests/distcheck-missing-m4.test: Likewise.
* tests/distcheck-outdated-m4.test: Likewise.
* tests/java-clean.test: Likewise.
* tests/java-compile-install.test: Likewise.
* tests/java-compile-run-flat.test: Likewise.
* tests/java-compile-run-nested.test: Likewise.
* tests/java-mix.test: Likewise.
* tests/java-no-duplicate.test: Likewise.
* tests/java-nobase.test: Likewise.
* tests/java-rebuild.test: Likewise.
* tests/java-sources.test: Likewise.
* tests/java-uninstall.test: Likewise.
* tests/javaflags.test: Likewise.
* tests/nobase-nodist.test: Likewise.
* tests/py-compile-basedir.test: Likewise.
* tests/py-compile-basic.test: Likewise.
* tests/py-compile-basic2.test: Likewise.
* tests/py-compile-destdir.test: Likewise.
* tests/py-compile-env.test: Likewise.
* tests/py-compile-option-terminate.test: Likewise.
* tests/py-compile-usage.test: Likewise. Since we are at it,
add an extra blank line, for clarity.
commit 066f495979623f36aafa81a1927130dca7607eaf
Merge: 8ad2fe6 b52f63c
Author: Stefano Lattarini <address@hidden>
Date: Sun Sep 18 19:14:55 2011 +0200
Merge branch 'master' into testsuite-work
commit 8ad2fe638cc2e04447ac5b909335a193deaf23da
Merge: fad3172 1e90abc
Author: Stefano Lattarini <address@hidden>
Date: Sun Sep 18 18:30:00 2011 +0200
Merge branch 'test-protocols' into testsuite-work
* test-protocols:
automake: remove code duplication in 'handle_tests'
commit b52f63c824a044e8adcde2ffe3640e0074c615a1
Merge: cd2efb9 76b756f
Author: Stefano Lattarini <address@hidden>
Date: Sun Sep 18 18:21:29 2011 +0200
Merge branch 'remove-deansification'
* remove-deansification:
automake: remove special handling of `ANSI2KNR' make variable
commit cd2efb9f05528c9c68e80185b250fe5b0abdec14
Merge: c31004a dd7e620
Author: Stefano Lattarini <address@hidden>
Date: Sun Sep 18 18:13:59 2011 +0200
Merge branch 'maint'
* maint:
coverage: test interactions of `nobase_' and `nodist_'
cosmetics: fix various typos and grammaros
py-compile: '--' and non-option arguments terminate the option list
py-compile: complain on unrecognized options
py-compile: normalize error and help messages
python tests: add "unit tests" on py-compile
py-compile: the '--destdir' option now accepts a blank argument
python: run the 'py-compile' script with $(SHELL)
commit dd7e620bf9ef468a762be8594c61c7e5bb0b0d27
Merge: 0b7d3cb c9a6f7e
Author: Stefano Lattarini <address@hidden>
Date: Sun Sep 18 18:05:43 2011 +0200
Merge branch 'python-work' into maint
* python-work:
cosmetics: fix various typos and grammaros
py-compile: '--' and non-option arguments terminate the option list
py-compile: complain on unrecognized options
py-compile: normalize error and help messages
python tests: add "unit tests" on py-compile
py-compile: the '--destdir' option now accepts a blank argument
python: run the 'py-compile' script with $(SHELL)
commit 0b7d3cbc93055201bc58497e6519f477d0b72701
Author: Stefano Lattarini <address@hidden>
Date: Sun Sep 18 17:51:31 2011 +0200
coverage: test interactions of `nobase_' and `nodist_'
* tests/nobase-nodist.test: New test.
* tests/Makefile.am (TESTS): Add it.
commit c31004a89fe50fedbce1b39cc567f06ab1c3a892
Merge: 16912bd 8d97cb9
Author: Stefano Lattarini <address@hidden>
Date: Sun Sep 18 17:36:05 2011 +0200
Merge branch 'maint'
* maint:
java: fix various blunders in test 'java-mix.test'
commit 8d97cb95019b04707fdd60b4d9994d0acc9c6554
Author: Stefano Lattarini <address@hidden>
Date: Sun Sep 18 17:32:50 2011 +0200
java: fix various blunders in test 'java-mix.test'
* tests/java-mix.test: Add missing call to `set -e'. Fix inverted
semantics (`.java' files are expected *not* to be distributed by
default, not the other way round). Fix various typos in the name
of the `.java' files. Correct other minor blunders. Improve some
comments.
commit 16912bdf1eeeeac517377e15c6c8bfe7743f9419
Merge: 074b118 5494240
Author: Stefano Lattarini <address@hidden>
Date: Sun Sep 18 16:32:46 2011 +0200
Merge branch 'java-work'
* java-work:
fix: remove duplicated ChangeLog entries
java: allow both JAVA and nobase_JAVA in the same Makefile.am
java: allow both dist_JAVA and nodist_JAVA in the same Makefile.am
fix: regenerate tests/Makefile.in
tests defs: use `skip_' for skipping java-related tests
java tests: use $PATH_SEPARATOR where appropriate
java coverage: test JAVACFLAGS and AM_JAVACFLAGS
java coverage: test rebuild rules for java
java coverage: try to build and run a java program
test defs: new requirement for the default java interpreter
java tests: tweak and make stricter a couple of tests
java coverage: add test on uninstall with JAVA primary
java tests: require java compiler more properly
java: allow both JAVA and nobase_JAVA in the same Makefile.am
java: allow both dist_JAVA and nodist_JAVA in the same Makefile.am
commit 54942406955b4368104208eadeb55a13a258fa2e
Author: Stefano Lattarini <address@hidden>
Date: Sun Sep 18 16:24:04 2011 +0200
fix: remove duplicated ChangeLog entries
commit 4f43232f4dc62bd3951cb5fda2bf1933b707902e
Merge: df73c36 e9e0b23
Author: Stefano Lattarini <address@hidden>
Date: Sun Sep 18 16:21:04 2011 +0200
Merge branch 'maint' into java-work
commit e9e0b23fc89dbec01138359033b13a8f8be50ee8
Merge: 5e46310 9a937d2
Author: Stefano Lattarini <address@hidden>
Date: Sun Sep 18 16:19:25 2011 +0200
Merge branch 'java-fixes-for-maint' into maint
commit 9a937d21bbf695af2749d6ca2cd2def96009ec9a
Author: Stefano Lattarini <address@hidden>
Date: Mon Sep 12 11:03:32 2011 +0200
java: allow both JAVA and nobase_JAVA in the same Makefile.am
* automake.in (handle_java): Also strip `nobase_' from the given
prefix, when needed.
* tests/java-clean.test: Update and extend.
* tests/java-compile-install.test: Likewise.
* tests/java-no-duplicate.test: Likewise.
* tests/java-sources.test: Likewise.
* tests/java-noinst.test: Likewise.
* tests/java-mix-dist-nodist.test: Renamed to ...
* tests/java-mix.test: ... this, and extended.
* tests/java-nobase.test: New test, still xfailing due to
unrelated issues.
* tests/Makefile.am (TESTS, XFAIL_TESTS): Update.
Cherry-picked from v1.11-356-g01dede4
commit 2990ef353fa395d1b7ded2aa15f5cf574adbb78d
Author: Stefano Lattarini <address@hidden>
Date: Mon Sep 12 10:54:49 2011 +0200
java: allow both dist_JAVA and nodist_JAVA in the same Makefile.am
Fixes automake bug#8434.
* automake.in (handle_java): Strip `dist_' and `nodist_' from
the given prefix. Define a new internal Makefile variable
`am__java_sources'. Related adjustments.
* lib/am/java.am (JAVAC, JAVAROOT, CLASSPATH_ENV): Define only the
first time this am file is processed.
(class%DIR%.stamp): Stamp file renamed ...
(class%NDIR%.stamp): ... to this, so that the `dist_' and `nodist_'
prefixes are stripped from the name of the stampfile. Adjust
declaration of dependencies by using the new automake-generated
internal variable `$(am__java_sources)'. In the rule, use `$@'
as the name of the target, rather than hard-coding it.
* tests/java.test: Update and extend.
* tests/java-no-duplicate.test: New test.
* tests/java-mix-dist-nodist.test: Likewise.
* tests/java-compile-and-install.test: Likewise.
* tests/java-clean.test: Likewise.
* tests/java-sources.test: Likewise.
* tests/Makefile.am (TESTS): Update.
Cherry-picked from commit v1.11-337-gd76b503.
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 271 +++++++++++++++++++-
NEWS | 5 +
automake.in | 150 ++++++------
lib/am/java.am | 14 +-
lib/am/python.am | 19 +-
lib/py-compile | 51 +++--
tests/Makefile.am | 1 +
tests/Makefile.in | 22 ++
tests/aclocal-acdir.test | 2 -
tests/aclocal-print-acdir.test | 2 -
tests/defs | 5 +
tests/distcheck-missing-m4.test | 2 -
tests/distcheck-outdated-m4.test | 2 -
tests/java-clean.test | 66 +++++
tests/java-compile-install.test | 97 +++++++
tests/java-compile-run-flat.test | 239 +++++++++++++++++
tests/java-compile-run-nested.test | 252 ++++++++++++++++++
tests/java-mix.test | 67 +++++
...ap-common-setup.test => java-no-duplicate.test} | 30 ++-
tests/java-nobase.test | 65 +++++
tests/java-noinst.test | 38 ++--
tests/java-rebuild.test | 124 +++++++++
.../{tests-environment.test => java-sources.test} | 42 +++-
tests/java-uninstall.test | 99 +++++++
tests/java.test | 6 +-
.../{yflags-force-override.test => javaflags.test} | 52 ++--
tests/javaprim.test | 5 +-
tests/javasubst.test | 5 +-
tests/list-of-tests.mk | 21 ++
tests/nobase-nodist.test | 60 +++++
...est-missing.test => parallel-tests-exeext.test} | 59 ++---
tests/py-compile-basedir.test | 50 ++++
tests/py-compile-basic.test | 63 +++++
tests/py-compile-basic2.test | 70 +++++
tests/py-compile-destdir.test | 43 +++
tests/py-compile-env.test | 59 +++++
...acdir.test => py-compile-option-terminate.test} | 37 ++-
tests/py-compile-usage.test | 75 ++++++
38 files changed, 2022 insertions(+), 248 deletions(-)
create mode 100755 tests/java-clean.test
create mode 100755 tests/java-compile-install.test
create mode 100755 tests/java-compile-run-flat.test
create mode 100755 tests/java-compile-run-nested.test
create mode 100755 tests/java-mix.test
copy tests/{tap-common-setup.test => java-no-duplicate.test} (56%)
create mode 100755 tests/java-nobase.test
create mode 100755 tests/java-rebuild.test
copy tests/{tests-environment.test => java-sources.test} (60%)
create mode 100755 tests/java-uninstall.test
copy tests/{yflags-force-override.test => javaflags.test} (56%)
create mode 100644 tests/nobase-nodist.test
copy tests/{test-missing.test => parallel-tests-exeext.test} (51%)
create mode 100755 tests/py-compile-basedir.test
create mode 100755 tests/py-compile-basic.test
create mode 100755 tests/py-compile-basic2.test
create mode 100755 tests/py-compile-destdir.test
create mode 100755 tests/py-compile-env.test
copy tests/{aclocal-print-acdir.test => py-compile-option-terminate.test} (57%)
create mode 100755 tests/py-compile-usage.test
diff --git a/ChangeLog b/ChangeLog
index 4b86e49..96275da 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,76 @@
+2011-09-18 Stefano Lattarini <address@hidden>
+
+ py-compile tests: more faithful 'installcheck' support
+ * tests/py-compile-basedir.test: Use the `$am_scriptsdir' variable
+ instead of `$testsrcdir/../lib', to test more faithfully under
+ "make installcheck". More uses of the `fatal_' subroutine to
+ diagnose hard errors.
+ * tests/py-compile-basic.test: Likewise.
+ * tests/py-compile-basic2.test: Likewise.
+ * tests/py-compile-destdir.test: Likewise.
+ * tests/py-compile-env.test: Likewise.
+ * tests/py-compile-option-terminate.test: Likewise.
+ * tests/py-compile-usage.test: Likewise.
+
+2011-09-18 Stefano Lattarini <address@hidden>
+
+ tests: remove redundant settings of `errexit' shell flag
+ * tests/aclocal-acdir.test: Do not set the `errexit' shell
+ flag, as it is already set by `tests/defs'.
+ * tests/aclocal-print-acdir.test: Likewise.
+ * tests/distcheck-missing-m4.test: Likewise.
+ * tests/distcheck-outdated-m4.test: Likewise.
+ * tests/java-clean.test: Likewise.
+ * tests/java-compile-install.test: Likewise.
+ * tests/java-compile-run-flat.test: Likewise.
+ * tests/java-compile-run-nested.test: Likewise.
+ * tests/java-mix.test: Likewise.
+ * tests/java-no-duplicate.test: Likewise.
+ * tests/java-nobase.test: Likewise.
+ * tests/java-rebuild.test: Likewise.
+ * tests/java-sources.test: Likewise.
+ * tests/java-uninstall.test: Likewise.
+ * tests/javaflags.test: Likewise.
+ * tests/nobase-nodist.test: Likewise.
+ * tests/py-compile-basedir.test: Likewise.
+ * tests/py-compile-basic.test: Likewise.
+ * tests/py-compile-basic2.test: Likewise.
+ * tests/py-compile-destdir.test: Likewise.
+ * tests/py-compile-env.test: Likewise.
+ * tests/py-compile-option-terminate.test: Likewise.
+ * tests/py-compile-usage.test: Likewise. Since we are at it,
+ add an extra blank line, for clarity.
+
+2011-09-16 Stefano Lattarini <address@hidden>
+
+ automake: remove special handling of `ANSI2KNR' make variable
+ * automake.in (define_configure_variable): Remove special-cased
+ handling of `ANSI2KNR' variable. Related minor simplifications.
+
+2011-09-18 Stefano Lattarini <address@hidden>
+
+ coverage: test interactions of `nobase_' and `nodist_'
+ * tests/nobase-nodist.test: New test.
+ * tests/Makefile.am (TESTS): Add it.
+
+2011-09-18 Stefano Lattarini <address@hidden>
+
+ java: fix various blunders in test 'java-mix.test'
+ * tests/java-mix.test: Add missing call to `set -e'. Fix inverted
+ semantics (`.java' files are expected *not* to be distributed by
+ default, not the other way round). Fix various typos in the name
+ of the `.java' files. Correct other minor blunders. Improve some
+ comments.
+
+2011-09-15 Stefano Lattarini <address@hidden>
+
+ automake: remove code duplication in 'handle_tests'
+ * automake.in (handle_tests): Factor out some code dealing with
+ test extensions and rules for generation of `.log' files into ...
+ (handle_per_suffix_test): ... this new subroutine.
+ * tests/parallel-tests-exeext.test: New test.
+ * tests/Makefile.am (TESTS): Update.
+
2011-09-13 Peter Rosin <address@hidden>
* tests/defs [$sh_errexit_works = yes]: Output 'SIGINT' for signal 2.
@@ -42,6 +115,16 @@
2011-09-12 Stefano Lattarini <address@hidden>
+ cosmetics: fix various typos and grammaros
+ * NEWS: Fix typos.
+ * tests/py-compile-basic.test: Likewise.
+ * tests/py-compile-basedir.test: Fix botched wording in comments.
+ * tests/py-compile-option-terminate.test: Fix typo and incomplete
+ comment.
+ Suggestions by Peter Rosin.
+
+2011-09-12 Stefano Lattarini <address@hidden>
+
tests: remove redundant line from a test script
* tests/test-log.test (fail.test): Remove extra `echo' command,
probably due to a past copy&paste blunder.
@@ -3949,6 +4032,68 @@
generic hard errors. The latter should be reserved for "real"
set-up failures.
+2011-06-08 Stefano Lattarini <address@hidden>
+
+ py-compile: '--' and non-option arguments terminate the option list
+ * lib/py-compile: Any non-option argument, or the special `--'
+ argument, now explicitly terminates the list of options.
+ * tests/py-compile-option-terminate.test: New test.
+ * tests/Makefile.am (TESTS): Update.
+ * NEWS: Update.
+
+2011-06-08 Stefano Lattarini <address@hidden>
+
+ py-compile: complain on unrecognized options
+ * lib/py-compile: Complain on unrecognized options. Don't be too
+ lax in matching `--help' and `--version' options.
+ * tests/py-compile-usage.test: Extend accordingly.
+ * NEWS: Update.
+
+2011-06-08 Stefano Lattarini <address@hidden>
+
+ py-compile: normalize error and help messages
+ * lib/py-compile: Now error messages do not begin with a capital
+ letter, nor end with a period, as per GNU standards. Prepend the
+ error messages with the name of the script, not with its path.
+ When an invalid usage is recognized, always display the customary
+ message "Try `py-compile --help' ..." on a line of its own.
+ ($me): New variable, containing the name of the
+ program, i.e., `py-compile'. Use it throughout.
+ (usage_error): New function, used to display error messages about
+ invalid usage.
+ * tests/py-compile-usage.test: Extend and tighten accordingly.
+
+2011-06-08 Stefano Lattarini <address@hidden>
+
+ python tests: add "unit tests" on py-compile
+ * tests/py-compile-basic.test: New test.
+ * tests/py-compile-basic2.test: New test.
+ * tests/py-compile-basedir.test: Likewise.
+ * tests/py-compile-destdir.test: Likewise.
+ * tests/py-compile-env.test: Likewise.
+ * tests/py-compile-usage.test: Likewise.
+ * tests/Makefile.am (TESTS): Update.
+ Tested with python 2.0.1, 2.4.6, 2.6.6, 2.7.1, and 3.1.3.
+
+2011-06-08 Stefano Lattarini <address@hidden>
+
+ py-compile: the '--destdir' option now accepts a blank argument
+ * lib/py-compile (Option parsing): Do not count an empty argument
+ to `--destdir' or `--basedir' as a missing argument.
+ * lib/python.am: Simplify accordingly, passing the `--destdir'
+ option to py-compile unconditionally, even if `$(DESTDIR)' is
+ empty.
+ * NEWS: Update.
+
+2011-06-08 Stefano Lattarini <address@hidden>
+
+ python: run the 'py-compile' script with $(SHELL)
+ * lib/python.am (install-%DIR%PYTHON): Run each instance of
+ py-compile using $(SHELL). Since we are at it, break overly
+ long lines.
+ (am__py_compile): New variable, to reduce code duplication.
+
+
2011-06-07 Stefano Lattarini <address@hidden>
tests: `lib/' shell scripts transparently tested also with $SHELL
@@ -4871,6 +5016,11 @@
driver.
* tests/pr401b.test: Likewise.
* tests/pr401c.test: Likewise.
+ * tests/java-flat.test: Likewise, and properly update heading
+ comments.
+ * tests/java-nested.test: Likewise, but defining `parallel_tests'
+ to "yes" instead, for improved coverage in conjunction with the
+ sister test `java-flat.test'.
2011-05-20 Stefano Lattarini <address@hidden>
@@ -5029,6 +5179,12 @@
2011-05-04 Stefano Lattarini <address@hidden>
+ tests defs: use `skip_' for skipping java-related tests
+ * tests/defs.in (java, javac): Use `skip_' to signal test
+ skipping.
+
+2011-05-04 Stefano Lattarini <address@hidden>
+
tests: add excerpts from few original bug reports, for clarity.
* tests/comment6.test: Add excerpts and/or details from the
original bug report that prompted this tests to be added and/or
@@ -5474,6 +5630,80 @@
superseded by the much more complete `maintclean.test'.
* tests/Makefile.am (TESTS): Update.
+2011-05-03 Stefano Lattarini <address@hidden>
+
+ java tests: use $PATH_SEPARATOR where appropriate
+ * tests/java-compile-run-nested.test: Use `$PATH_SEPARATOR', not
+ `:', to separate entries of extended PATH and CLASSPATH variables.
+ * tests/java-compile-run-flat.test: Likewise.
+
+2011-04-26 Stefano Lattarini <address@hidden>
+
+ java coverage: test JAVACFLAGS and AM_JAVACFLAGS
+ * tests/javaflags.test: New test.
+ * tests/Makefile.am (TESTS): Update.
+
+2011-04-26 Stefano Lattarini <address@hidden>
+
+ java coverage: test rebuild rules for java
+ * tests/java-rebuild.test: New test.
+ * tests/Makefile.am (TESTS): Update.
+
+2011-04-26 Stefano Lattarini <address@hidden>
+
+ java coverage: try to build and run a java program
+ * tests/java-compile-run-flat.test: New test, try to build and run
+ a "UNIX-style" java program (complete with wrapper shell script
+ and the like) with a "flat" source-tree setup (i.e., everything in
+ the top-level directory).
+ * tests/java-compile-nested.test: Likewise, but using a more
+ typical "nested" source-tree setup.
+ * tests/Makefile.am (TESTS): Update.
+
+2011-04-23 Stefano Lattarini <address@hidden>
+
+ test defs: new requirement for the default java interpreter
+ * tests/defs.in (for tool in $required): New requirement 'java'.
+
+2011-04-23 Stefano Lattarini <address@hidden>
+
+ java tests: tweak and make stricter a couple of tests
+ * tests/javasubst.test: Use proper m4 quoting. Add trailing `:'
+ command. Enable `errexit' shell flag, and related changes.
+ Prefer cat + here-doc over echo to append to configure.in.
+ Make grepping of Makefile.in stricter. Add debugging output.
+ Improve heading comments.
+ * tests/javaprim.test: Likewise.
+
+2011-04-23 Stefano Lattarini <address@hidden>
+
+ java coverage: add test on uninstall with JAVA primary
+ * tests/java-uninstall.test: New test.
+ * tests/Makefile.am (TESTS): Update.
+
+2011-04-23 Stefano Lattarini <address@hidden>
+
+ java tests: require java compiler more properly
+ * tests/java-extra.test: Use "required=javac" instead of ad-hoc
+ configure check.
+ * tests/java-noinst.test: Likewise.
+
+2011-04-23 Stefano Lattarini <address@hidden>
+
+ java: allow both JAVA and nobase_JAVA in the same Makefile.am
+ * automake.in (handle_java): Also strip `nobase_' from the given
+ prefix, when needed.
+ * tests/java-clean.test: Update and extend.
+ * tests/java-compile-install.test: Likewise.
+ * tests/java-no-duplicate.test: Likewise.
+ * tests/java-sources.test: Likewise.
+ * tests/java-noinst.test: Likewise.
+ * tests/java-mix-dist-nodist.test: Renamed to ...
+ * tests/java-mix.test: ... this, and extended.
+ * tests/java-nobase.test: New test, still xfailing due to
+ unrelated issues.
+ * tests/Makefile.am (TESTS, XFAIL_TESTS): Update.
+
2011-04-22 Stefano Lattarini <address@hidden>
testsuite: more environment sanitization
@@ -5684,6 +5914,38 @@
* NEWS: Update.
Report by Bruno Haible.
+2011-04-18 Stefano Lattarini <address@hidden>
+
+ java: allow both dist_JAVA and nodist_JAVA in the same Makefile.am
+ Fixes automake bug#8434.
+ * automake.in (handle_java): Strip `dist_' and `nodist_' from
+ the given prefix. Define a new internal Makefile variable
+ `am__java_sources'. Related adjustments.
+ * lib/am/java.am (JAVAC, JAVAROOT, CLASSPATH_ENV): Define only the
+ first time this am file is processed.
+ (class%DIR%.stamp): Stamp file renamed ...
+ (class%NDIR%.stamp): ... to this, so that the `dist_' and `nodist_'
+ prefixes are stripped from the name of the stampfile. Adjust
+ declaration of dependencies by using the new automake-generated
+ internal variable `$(am__java_sources)'. In the rule, use `$@'
+ as the name of the target, rather than hard-coding it.
+ * tests/java.test: Update and extend.
+ * tests/java-no-duplicate.test: New test.
+ * tests/java-mix-dist-nodist.test: Likewise.
+ * tests/java-compile-and-install.test: Likewise.
+ * tests/java-clean.test: Likewise.
+ * tests/java-sources.test: Likewise.
+ * tests/Makefile.am (TESTS): Update.
+
+2011-04-06 Stefano Lattarini <address@hidden>
+
+ coverage: more on java support EXTRA_ and noinst_ prefixes
+ * tests/java-extra.test: New test, checking support for the
+ prefix `EXTRA_' with the JAVA primary.
+ * tests/java-noinst.test: New test, checking support for the
+ prefix `noinst_' with the JAVA primary.
+ * tests/Makefile.am (TESTS): Update.
+
2011-04-10 Stefano Lattarini <address@hidden>
test defs: fix 'javac' requirement for older JDK versions
@@ -5747,15 +6009,6 @@
* tests/defs: Fix typo (`itslef' instead of `itself') in
comments.
-2011-04-06 Stefano Lattarini <address@hidden>
-
- coverage: more on java support EXTRA_ and noinst_ prefixes
- * tests/java-extra.test: New test, checking support for the
- prefix `EXTRA_' with the JAVA primary.
- * tests/java-noinst.test: New test, checking support for the
- prefix `noinst_' with the JAVA primary.
- * tests/Makefile.am (TESTS): Update.
-
2011-04-09 Ralf Wildenhues <address@hidden>
Clarify regex code in depcomp.
diff --git a/NEWS b/NEWS
index fa0a358..7d554fd 100644
--- a/NEWS
+++ b/NEWS
@@ -121,6 +121,11 @@ New in 1.11a:
- C source and header files derived from non-distributed Yacc sources are
now removed by "make clean", not only by "make maintainer-clean".
+ - The py-compile script now accepts empty arguments passed to the options
+ `--destdir' and `--basedir', and complains about unrecognized options.
+ Moreover, a non-option argument or a special `--' argument terminates
+ the list of options.
+
- A developer that needs to pass specific flags to configure at "make
distcheck" time can now, and indeed he's advised to, do so by defining
the developer-reserved makefile variable AM_DISTCHECK_CONFIGURE_FLAGS,
diff --git a/automake.in b/automake.in
index cbf82e1..7297a85 100644
--- a/automake.in
+++ b/automake.in
@@ -4793,6 +4793,57 @@ sub handle_tests_dejagnu
$output_rules .= file_contents ('dejagnu', new Automake::Location);
}
+sub handle_per_suffix_test
+{
+ my ($test_suffix, %transform) = @_;
+ my ($pfx, $generic, $parallel_tests_option, $am_exeext);
+ prog_error ("called with 'parallel-tests' option not set")
+ unless $parallel_tests_option = option 'parallel-tests';
+ if ($test_suffix eq '')
+ {
+ $pfx = '';
+ $generic = 0;
+ $am_exeext = 'FALSE';
+ }
+ else
+ {
+ prog_error ("test suffix `$test_suffix' lacks leading dot")
+ unless $test_suffix =~ m/^\.(.*)/;
+ $pfx = uc ($1) . '_';
+ $generic = 1;
+ $am_exeext = exists $configure_vars{'EXEEXT'} ? 'am__EXEEXT'
+ : 'FALSE';
+ }
+ # The "test driver" program, deputed to handle tests protocol used by
+ # test scripts. By default, it's assumed that no protocol is used,
+ # so we fall back to the old "parallel-tests" behaviour, implemented
+ # by the `test-driver' auxiliary script.
+ if (! var "${pfx}LOG_DRIVER")
+ {
+ require_conf_file ($parallel_tests_option->{position}, FOREIGN,
+ 'test-driver');
+ define_variable ("${pfx}LOG_DRIVER",
+ "\$(SHELL) $am_config_aux_dir/test-driver",
+ INTERNAL);
+ }
+ my $driver = '$(' . $pfx . 'LOG_DRIVER)';
+ my $driver_flags = '$(AM_' . $pfx . 'LOG_DRIVER_FLAGS)'
+ . ' $(' . $pfx . 'LOG_DRIVER_FLAGS)';
+ my $compile = "${pfx}LOG_COMPILE";
+ define_variable ($compile,
+ '$(' . $pfx . 'LOG_COMPILER)'
+ . ' $(AM_' . $pfx . 'LOG_FLAGS)'
+ . ' $(' . $pfx . 'LOG_FLAGS)',
+ INTERNAL);
+ $output_rules .= file_contents ('check2', new Automake::Location,
+ GENERIC => $generic,
+ DRIVER => $driver,
+ DRIVER_FLAGS => $driver_flags,
+ COMPILE => '$(' . $compile . ')',
+ EXT => $test_suffix,
+ am__EXEEXT => $am_exeext,
+ %transform);
+}
# Handle TESTS variable and other checks.
sub handle_tests
@@ -4869,33 +4920,10 @@ sub handle_tests
}
my $base = $obj;
$obj .= '.log';
- # The "test driver" program, deputed to handle tests protocol
used by
- # test scripts. By default, it's assumed that no protocol is
used,
- # so we fall back to the old "parallel-tests" behaviour,
implemented
- # by the `test-driver' auxiliary script.
- if (! var 'LOG_DRIVER')
- {
- require_conf_file ($parallel_tests->{position}, FOREIGN,
- 'test-driver');
- define_variable ('LOG_DRIVER',
- "\$(SHELL)
$am_config_aux_dir/test-driver",
- INTERNAL);
- }
- my $driver = '$(LOG_DRIVER)';
- my $driver_flags = '$(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS)';
- my $compile = 'LOG_COMPILE';
- define_variable ($compile,
- '$(LOG_COMPILER) $(AM_LOG_FLAGS)
$(LOG_FLAGS)', INTERNAL);
- $output_rules .= file_contents ('check2', new
Automake::Location,
- GENERIC => 0,
- OBJ => $obj,
- BASE => $base,
- SOURCE => $val,
- DRIVER => $driver,
- DRIVER_FLAGS => $driver_flags,
- COMPILE =>'$(' . $compile . ')',
- EXT => '',
- am__EXEEXT => 'FALSE');
+ handle_per_suffix_test ('',
+ OBJ => $obj,
+ BASE => $base,
+ SOURCE => $val);
return $obj;
});
@@ -4921,35 +4949,10 @@ sub handle_tests
$nhelper++;
if ($test_suffix ne $at_exeext && $test_suffix ne '')
{
- (my $ext = $test_suffix) =~ s/^\.//;
- $ext = uc $ext;
- # See comments about definition of LOG_DRIVER, above.
- if (! var "${ext}_LOG_DRIVER")
- {
- require_conf_file ($parallel_tests->{position}, FOREIGN,
- 'test-driver');
- define_variable ("${ext}_LOG_DRIVER",
- "\$(SHELL)
$am_config_aux_dir/test-driver",
- INTERNAL);
- }
- my $driver = '$(' . $ext . '_LOG_DRIVER)';
- my $driver_flags = '$(AM_' . $ext . '_LOG_DRIVER_FLAGS) ' .
- '$(' . $ext . '_LOG_DRIVER_FLAGS)';
- my $compile = $ext . '_LOG_COMPILE';
- define_variable ($compile,
- '$(' . $ext . '_LOG_COMPILER) $(AM_' . $ext
. '_LOG_FLAGS)'
- . ' $(' . $ext . '_LOG_FLAGS)', INTERNAL);
- my $am_exeext = $handle_exeext ? 'am__EXEEXT' : 'FALSE';
- $output_rules .= file_contents ('check2', new
Automake::Location,
- GENERIC => 1,
- OBJ => '',
- BASE => '$*',
- SOURCE => '$<',
- DRIVER => $driver,
- DRIVER_FLAGS => $driver_flags,
- COMPILE => '$(' . $compile .
')',
- EXT => $test_suffix,
- am__EXEEXT => $am_exeext);
+ handle_per_suffix_test ($test_suffix,
+ OBJ => '',
+ BASE => '$*',
+ SOURCE => '$<');
}
}
$clean_files{'$(TEST_LOGS)'} = MOSTLY_CLEAN;
@@ -5003,20 +5006,32 @@ sub handle_java
'java', 'noinst', 'check');
return if ! @sourcelist;
- my @prefix = am_primary_prefixes ('JAVA', 1,
+ my @prefixes = am_primary_prefixes ('JAVA', 1,
'java', 'noinst', 'check');
my $dir;
- foreach my $curs (@prefix)
+ my @java_sources = ();
+ foreach my $prefix (@prefixes)
{
+ (my $curs = $prefix) =~ s/^(?:nobase_)?(?:dist_|nodist_)?//;
+
next
if $curs eq 'EXTRA';
- err_var "${curs}_JAVA", "multiple _JAVA primaries in use"
- if defined $dir;
+ push @java_sources, '$(' . $prefix . '_JAVA' . ')';
+
+ if (defined $dir)
+ {
+ err_var "${curs}_JAVA", "multiple _JAVA primaries in use"
+ unless $curs eq $dir;
+ }
+
$dir = $curs;
}
+ define_pretty_variable ('am__java_sources', TRUE, INTERNAL,
+ "@java_sources");
+
if ($dir eq 'check')
{
push (@check, "class$dir.stamp");
@@ -6360,22 +6375,11 @@ sub define_files_variable (address@hidden)
sub define_configure_variable ($)
{
my ($var) = @_;
-
- my $pretty = VAR_ASIS;
- my $owner = VAR_CONFIGURE;
-
# Some variables we do not want to output. For instance it
# would be a bad idea to output `U = @address@hidden when address@hidden@`
can be
# substituted as `\`.
- $pretty = VAR_SILENT if exists $ignored_configure_vars{$var};
-
- # ANSI2KNR is a variable that Automake wants to redefine, so
- # it must be owned by Automake. (It is also used as a proof
- # that AM_C_PROTOTYPES has been run, that's why we do not simply
- # omit the AC_SUBST.)
- $owner = VAR_AUTOMAKE if $var eq 'ANSI2KNR';
-
- Automake::Variable::define ($var, $owner, '', TRUE, subst $var,
+ my $pretty = exists $ignored_configure_vars{$var} ? VAR_SILENT : VAR_ASIS;
+ Automake::Variable::define ($var, VAR_CONFIGURE, '', TRUE, subst $var,
'', $configure_vars{$var}, $pretty);
}
diff --git a/lib/am/java.am b/lib/am/java.am
index 604df22..464b706 100644
--- a/lib/am/java.am
+++ b/lib/am/java.am
@@ -20,11 +20,13 @@
## Building. ##
## ---------- ##
+if %?FIRST%
JAVAC = javac
CLASSPATH_ENV =
CLASSPATH=$(JAVAROOT):$(srcdir)/$(JAVAROOT)$${CLASSPATH:+":$$CLASSPATH"}
JAVAROOT = $(top_builddir)
+endif %?FIRST%
-class%DIR%.stamp: $(%DIR%_JAVA)
+class%NDIR%.stamp: $(am__java_sources)
@list1='$?'; list2=; if test -n "$$list1"; then \
for p in $$list1; do \
if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
@@ -33,7 +35,7 @@ class%DIR%.stamp: $(%DIR%_JAVA)
echo '$(CLASSPATH_ENV) $(JAVAC) -d $(JAVAROOT) $(AM_JAVACFLAGS)
$(JAVACFLAGS) '"$$list2"; \
$(CLASSPATH_ENV) $(JAVAC) -d $(JAVAROOT) $(AM_JAVACFLAGS)
$(JAVACFLAGS) $$list2; \
else :; fi
- echo timestamp > class%DIR%.stamp
+ echo timestamp > $@
## ------------ ##
@@ -44,7 +46,7 @@ if %?INSTALL%
am__installdirs += "$(DESTDIR)$(%NDIR%dir)"
?EXEC?.PHONY install-exec-am: install-%DIR%JAVA
?!EXEC?.PHONY install-data-am: install-%DIR%JAVA
-install-%DIR%JAVA: class%DIR%.stamp
+install-%DIR%JAVA: class%NDIR%.stamp
@$(NORMAL_INSTALL)
test -z "$(%NDIR%dir)" || $(MKDIR_P) "$(DESTDIR)$(%NDIR%dir)"
## A single .java file can be compiled into multiple .class files. So
@@ -76,9 +78,9 @@ endif %?INSTALL%
## Cleaning. ##
## ---------- ##
-.PHONY clean-am: clean-%DIR%JAVA
-clean-%DIR%JAVA:
- -rm -f *.class class%DIR%.stamp
+.PHONY clean-am: clean-%NDIR%JAVA
+clean-%NDIR%JAVA:
+ -rm -f *.class class%NDIR%.stamp
## -------------- ##
diff --git a/lib/am/python.am b/lib/am/python.am
index 9424a19..40aaa62 100644
--- a/lib/am/python.am
+++ b/lib/am/python.am
@@ -1,6 +1,6 @@
## automake - create Makefile.in from Makefile.am
-## Copyright (C) 1999, 2001, 2003, 2004, 2006, 2007, 2008, 2009 Free
-## Software Foundation, Inc.
+## Copyright (C) 1999, 2001, 2003, 2004, 2006, 2007, 2008, 2009, 2011
+## Free Software Foundation, Inc.
## 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
@@ -24,6 +24,7 @@ endif %?INSTALL%
## ------------ ##
if %?INSTALL%
+?FIRST?am__py_compile = PYTHON=$(PYTHON) $(SHELL) $(py_compile)
am__installdirs += "$(DESTDIR)$(%NDIR%dir)"
.PHONY install-%EXEC?exec:data%-am: install-%DIR%PYTHON
install-%DIR%PYTHON: $(%DIR%_PYTHON)
@@ -52,11 +53,8 @@ if %?BASE%
## Byte-compile must be done at install time, since file times are
## encoded in the actual files.
if test -n "$$dlist"; then \
- if test -z "$(DESTDIR)"; then \
- PYTHON=$(PYTHON) $(py_compile) --basedir "$(%NDIR%dir)" $$dlist; \
- else \
- PYTHON=$(PYTHON) $(py_compile) --destdir "$(DESTDIR)" --basedir
"$(%NDIR%dir)" $$dlist; \
- fi; \
+ $(am__py_compile) --destdir "$(DESTDIR)" \
+ --basedir "$(%NDIR%dir)" $$dlist; \
else :; fi
else !%?BASE%
@list='$(%DIR%_PYTHON)'; test -n "$(%NDIR%dir)" || list=; \
@@ -76,11 +74,8 @@ else !%?BASE%
## Byte-compile must be done at install time, since file times are
## encoded in the actual files.
if test -n "$$dlist"; then \
- if test -z "$(DESTDIR)"; then \
- PYTHON=$(PYTHON) $(py_compile) --basedir "$(%NDIR%dir)" $$dlist; \
- else \
- PYTHON=$(PYTHON) $(py_compile) --destdir "$(DESTDIR)" --basedir
"$(%NDIR%dir)" $$dlist; \
- fi; \
+ $(am__py_compile) --destdir "$(DESTDIR)" \
+ --basedir "$(%NDIR%dir)" $$dlist; \
else :; fi \
done
endif !%?BASE%
diff --git a/lib/py-compile b/lib/py-compile
index 3f9d05b..15c834c 100755
--- a/lib/py-compile
+++ b/lib/py-compile
@@ -1,10 +1,10 @@
#!/bin/sh
# py-compile - Compile a Python program
-scriptversion=2009-04-28.21; # UTC
+scriptversion=2011-06-08.12; # UTC
-# Copyright (C) 2000, 2001, 2003, 2004, 2005, 2008, 2009 Free Software
-# Foundation, Inc.
+# Copyright (C) 2000, 2001, 2003, 2004, 2005, 2008, 2009, 2011 Free
+# Software Foundation, Inc.
# 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
@@ -32,28 +32,36 @@ if [ -z "$PYTHON" ]; then
PYTHON=python
fi
+me=py-compile
+
+usage_error ()
+{
+ echo "$me: $*" >&2
+ echo "Try \`$me --help' for more information." >&2
+ exit 1
+}
+
basedir=
destdir=
-files=
while test $# -ne 0; do
case "$1" in
--basedir)
- basedir=$2
- if test -z "$basedir"; then
- echo "$0: Missing argument to --basedir." 1>&2
- exit 1
+ if test $# -lt 2; then
+ usage_error "option '--basedir' requires an argument"
+ else
+ basedir=$2
fi
shift
;;
--destdir)
- destdir=$2
- if test -z "$destdir"; then
- echo "$0: Missing argument to --destdir." 1>&2
- exit 1
+ if test $# -lt 2; then
+ usage_error "option '--destdir' requires an argument"
+ else
+ destdir=$2
fi
shift
;;
- -h|--h*)
+ -h|--help)
cat <<\EOF
Usage: py-compile [--help] [--version] [--basedir DIR] [--destdir DIR]
FILES..."
@@ -69,20 +77,27 @@ Report bugs to <address@hidden>.
EOF
exit $?
;;
- -v|--v*)
- echo "py-compile $scriptversion"
+ -v|--version)
+ echo "$me $scriptversion"
exit $?
;;
+ --)
+ shift
+ break
+ ;;
+ -*)
+ usage_error "unrecognized option '$1'"
+ ;;
*)
- files="$files $1"
+ break
;;
esac
shift
done
+files=$*
if test -z "$files"; then
- echo "$0: No files given. Try \`$0 --help' for more information." 1>&2
- exit 1
+ usage_error "no files given"
fi
# if basedir was given, then it should be prepended to filenames before
diff --git a/tests/Makefile.am b/tests/Makefile.am
index f502f8d..1e4b6d5 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -45,6 +45,7 @@ all.test \
cond17.test \
gcj6.test \
override-conditional-2.test \
+java-nobase.test \
pr8365-remake-timing.test \
yacc-dist-nobuild-subdir.test \
vala-vpath.test \
diff --git a/tests/Makefile.in b/tests/Makefile.in
index 101a193..6de6c10 100644
--- a/tests/Makefile.in
+++ b/tests/Makefile.in
@@ -312,6 +312,7 @@ all.test \
cond17.test \
gcj6.test \
override-conditional-2.test \
+java-nobase.test \
pr8365-remake-timing.test \
yacc-dist-nobuild-subdir.test \
vala-vpath.test \
@@ -762,12 +763,23 @@ interp2.test \
java.test \
java2.test \
java3.test \
+javaflags.test \
java-check.test \
+java-clean.test \
+java-compile-install.test \
+java-compile-run-flat.test \
+java-compile-run-nested.test \
java-empty-classpath.test \
javaprim.test \
javasubst.test \
java-extra.test \
+java-mix.test \
+java-no-duplicate.test \
+java-nobase.test \
java-noinst.test \
+java-rebuild.test \
+java-sources.test \
+java-uninstall.test \
ldadd.test \
ldflags.test \
lex.test \
@@ -895,6 +907,7 @@ no-outdir-option.test \
nobase.test \
nobase-libtool.test \
nobase-python.test \
+nobase-nodist.test \
nodef.test \
nodef2.test \
nodep.test \
@@ -945,6 +958,7 @@ parallel-tests6.test \
parallel-tests8.test \
parallel-tests9.test \
parallel-tests10.test \
+parallel-tests-exeext.test \
parallel-tests-suffix.test \
parallel-tests-suffix-prog.test \
parallel-tests-log-compiler-1.test \
@@ -1058,6 +1072,14 @@ primary-prefix-couples-force-valid.test \
primary-prefix-couples-documented-valid.test \
proginst.test \
programs-primary-rewritten.test \
+py-compile-basedir.test \
+py-compile-basic.test \
+py-compile-basic2.test \
+py-compile-destdir.test \
+py-compile-env.test \
+py-compile-option-terminate.test \
+py-compile-usage.test \
+python-dist.test \
python.test \
python2.test \
python3.test \
diff --git a/tests/aclocal-acdir.test b/tests/aclocal-acdir.test
index e02db30..42f8b45 100755
--- a/tests/aclocal-acdir.test
+++ b/tests/aclocal-acdir.test
@@ -20,8 +20,6 @@
. ./defs || Exit 1
-set -e
-
mkdir am sys
cat >> configure.in <<'END'
diff --git a/tests/aclocal-print-acdir.test b/tests/aclocal-print-acdir.test
index c55ae2b..4094b35 100755
--- a/tests/aclocal-print-acdir.test
+++ b/tests/aclocal-print-acdir.test
@@ -19,8 +19,6 @@
am_create_testdir=empty
. ./defs || Exit 1
-set -e
-
$ACLOCAL --print-ac-dir
test "`$ACLOCAL --print-ac-dir`" = "$am_system_acdir"
diff --git a/tests/defs b/tests/defs
index 297e5c0..e5f66a5 100644
--- a/tests/defs
+++ b/tests/defs
@@ -703,6 +703,11 @@ do
echo "$me: running javac -version -help"
javac -version -help || skip_all_ "Sun Java compiler not available"
;;
+ java)
+ # See the comments above about `javac' for why we use also `-help'.
+ echo "$me: running java -version -help"
+ java -version -help || skip_all_ "Sun Java interpreter not found"
+ ;;
makedepend)
echo "$me: running makedepend -f-"
makedepend -f- \
diff --git a/tests/distcheck-missing-m4.test b/tests/distcheck-missing-m4.test
index f4e0eda..1e12143 100755
--- a/tests/distcheck-missing-m4.test
+++ b/tests/distcheck-missing-m4.test
@@ -20,8 +20,6 @@
. ./defs || Exit 1
-set -e
-
cwd=`pwd` || fatal_ "cannot get current working directory"
cp "$testsrcdir"/distcheck-hook-m4.am . \
diff --git a/tests/distcheck-outdated-m4.test b/tests/distcheck-outdated-m4.test
index 74f2922..8a0e512 100755
--- a/tests/distcheck-outdated-m4.test
+++ b/tests/distcheck-outdated-m4.test
@@ -20,8 +20,6 @@
. ./defs || Exit 1
-set -e
-
cwd=`pwd` || fatal_ "cannot get current working directory"
cp "$testsrcdir"/distcheck-hook-m4.am . \
diff --git a/tests/java-clean.test b/tests/java-clean.test
new file mode 100755
index 0000000..c837ff7
--- /dev/null
+++ b/tests/java-clean.test
@@ -0,0 +1,66 @@
+#! /bin/sh
+# Copyright (C) 1998, 2001, 2002, 2004, 2007 Free Software Foundation, Inc.
+#
+# 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 2, 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 <http://www.gnu.org/licenses/>.
+
+# Test cleaning of Java class files and timestamps.
+
+required=javac
+. ./defs || Exit 1
+
+cat >> configure.in <<'END'
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+javadir = $(datadir)/java
+
+java_JAVA = Class.java
+dist_java_JAVA = ClassDist.java
+nodist_java_JAVA = ClassNodist.java
+
+nobase_java_JAVA = ClassNobase.java
+nobase_dist_java_JAVA = ClassNobaseDist.java
+nobase_nodist_java_JAVA = ClassNobaseNodist.java
+END
+
+for base in '' Nobase; do
+ for dist in '' Dist Nodist; do
+ echo "class Class$base$dist {}" > Class$base$dist.java
+ done
+done
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+
+./configure
+$MAKE
+ls -l
+test -f classjava.stamp
+for base in '' Nobase; do
+ for dist in '' Dist Nodist; do
+ test -f Class$base$dist.class
+ done
+done
+$MAKE clean
+find . -name '*.class' -o -name '*.stamp' | grep . && Exit 1
+# We should not remove unrelated stamp files.
+echo timestamp > classjava2.stamp
+echo timestamp > classdist_java.stamp
+$MAKE clean
+test -f classjava2.stamp
+test -f classdist_java.stamp
+
+:
diff --git a/tests/java-compile-install.test b/tests/java-compile-install.test
new file mode 100755
index 0000000..d947da3
--- /dev/null
+++ b/tests/java-compile-install.test
@@ -0,0 +1,97 @@
+#! /bin/sh
+# Copyright (C) 2011 Free Software Foundation, Inc.
+#
+# 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 2, 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 <http://www.gnu.org/licenses/>.
+
+# Test on compilation and installation of Java class files.
+
+required=javac
+. ./defs || Exit 1
+
+cat >>configure.in <<'EOF'
+AC_OUTPUT
+EOF
+
+cat > Makefile.am << 'END'
+javadir = $(datadir)/java
+java_JAVA = Foo.java
+nobase_java_JAVA = Foo2.java
+nobase_dist_java_JAVA = Bar.java
+nodist_java_JAVA = Baz.java
+
+# Java files are not distributed by default, so we distribute
+# one "by hand" ...
+EXTRA_DIST = Foo.java
+# ... and make the other one generated.
+Foo2.java:
+ rm -f $@ address@hidden
+ echo 'class bClass {}' > address@hidden
+ chmod a-w address@hidden && mv -f address@hidden $@
+
+# Explicitly declared as `nodist_', so generate it.
+Baz.java:
+ rm -f $@ address@hidden
+ echo 'class Baz {}' > address@hidden
+ echo 'class Baz2 {}' >> address@hidden
+ chmod a-w address@hidden && mv -f address@hidden $@
+
+test:
+ ls -l $(srcdir) . ;: For debugging.
+ test -f $(srcdir)/Foo.java
+ test -f $(srcdir)/Bar.java
+ test -f Foo2.java
+ test -f Baz.java
+ test -f aClass.class
+ test -f bClass.class
+ test -f Zardoz.class
+ test -f Baz.class
+ test -f Baz2.class
+ test ! -r Foo.class
+ test ! -r Bar.class
+ test -f classjava.stamp
+
+test-install:
+ ls -l $(javadir) ;: For debugging.
+ test -f '$(javadir)/bClass.class'
+ test -f '$(javadir)/aClass.class'
+ test -f '$(javadir)/Zardoz.class'
+ test -f '$(javadir)/Baz.class'
+ test -f '$(javadir)/Baz2.class'
+ test ! -r '$(javadir)/Foo.class'
+ test ! -r '$(javadir)/Bar.class'
+ if find $(prefix) | grep '\.stamp$$'; then exit 1; else :; fi
+
+check-local: test
+installcheck-local: test-install
+
+.PHONY: test test-install
+
+DISTCLEANFILES = Baz.java Foo2.java
+END
+
+echo 'class aClass {}' > Foo.java
+echo 'class Zardoz {}' > Bar.java
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+
+./configure --prefix="`pwd`"/_inst
+$MAKE
+$MAKE test
+$MAKE install
+$MAKE test-install
+$MAKE distcheck
+
+:
diff --git a/tests/java-compile-run-flat.test b/tests/java-compile-run-flat.test
new file mode 100755
index 0000000..3e2bcfd
--- /dev/null
+++ b/tests/java-compile-run-flat.test
@@ -0,0 +1,239 @@
+#! /bin/sh
+# Copyright (C) 2011 Free Software Foundation, Inc.
+#
+# 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 2, 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 <http://www.gnu.org/licenses/>.
+
+# Test on compilation and execution of Java class files.
+# Also meddle with wrapper scripts, as would be probably seen in a real
+# "UNIX-style" use case.
+# This test uses a "flat" setup for the source tree (i.e., everything in
+# the top-level directory), and forces the use of the old, non-parallel
+# testsuite driver. The sister test `java-compile-run-nested.test' do
+# similar checks with a more usual, "nested" setup, and using the newer
+# 'parallel-tests' driver.
+
+required='java javac'
+am_parallel_tests=no
+. ./defs || Exit 1
+
+echo "AC_SUBST([PATH_SEPARATOR], ['$PATH_SEPARATOR'])" >> configure.in
+
+cat >> configure.in <<'END'
+AC_SUBST([JAVA], [java])
+AC_CONFIG_SRCDIR([PkgLocation.jin])
+AC_CONFIG_FILES([PkgLocation.java:PkgLocation.jin])
+AC_OUTPUT
+END
+
+## TOP-LEVEL SETUP AND TARGETS ##
+
+cat > Makefile.am <<'END'
+EXTRA_DIST = # Will be updated later.
+
+test-built:
+ ls -l $(srcdir) ;: For debugging.
+ test $(srcdir) = . || ls -l . ;: Likewise.
+ test -f $(srcdir)/Main.java
+ test -f $(srcdir)/HelloStream.java
+ test -f $(srcdir)/PkgLocation.jin
+ test -f PkgLocation.java
+ test -f HelloStream.class
+ test -f PkgLocation.class
+ test -f Main.class
+ test -f classjava.stamp
+
+test-installed:
+ ls -l $(javadir) ;: For debugging.
+ test -f $(javadir)/HelloStream.class
+ test -f $(javadir)/PkgLocation.class
+ test -f $(javadir)/Main.class
+ if find $(prefix) | grep '\.stamp$$'; then exit 1; else :; fi
+
+run-installed:
+ jprog_doing_installcheck=yes $(MAKE) $(AM_MAKEFLAGS) check
+
+check-local: test-built
+installcheck-local: test-installed run-installed
+
+.PHONY: test-built test-installed run-installed
+END
+
+## WRAPPER SCRIPT ##
+
+cat >> Makefile.am <<'END'
+bin_SCRIPTS = jprog
+
+edit_script = sed -e 's|address@hidden@|$(JAVA)|g' \
+ -e 's|address@hidden@|$(javadir)|g' \
+ -e 's|address@hidden@|$(SHELL)|g' \
+ -e 's|address@hidden@|$(PATH_SEPARATOR)|g'
+
+jprog: jprog.sh
+ rm -f $@ address@hidden
+ $(edit_script) `test -f 'address@hidden' || echo
$(srcdir)/address@hidden >address@hidden
+ chmod a-w address@hidden && chmod a+x address@hidden && mv -f
address@hidden $@
+ sed 's/^/ | /' $@ ;: for debugging.
+
+EXTRA_DIST += jprog.sh
+CLEANFILES = jprog
+END
+
+cat > jprog.sh <<'END'
address@hidden@
+CLASSPATH=${jprog_classpath-'@javadir@'}${CLASSPATH+"@address@hidden"}
+export CLASSPATH
+case $# in
+ 0) exec @JAVA@ Main;;
+ *) exec @JAVA@ Main "$@";;
+esac
+END
+
+## JAVA SOURCES ##
+
+cat >> Makefile.am <<'END'
+javadir = $(pkgdatadir)/java
+
+dist_java_JAVA = Main.java HelloStream.java
+nodist_java_JAVA = PkgLocation.java
+END
+
+cat > PkgLocation.jin <<'END'
+public class PkgLocation {
+ public static String prefix() {
+ return new String("@prefix@");
+ }
+}
+END
+
+cat > Main.java <<'END'
+public class Main {
+ public static void main(String[] args) {
+ for (int i = 0; i < args.length; i++) {
+ if (args[i].equals("--print-prefix")) {
+ System.out.println(PkgLocation.prefix());
+ } else if (args[i].equals("--hello-stdout")) {
+ HelloStream.to(System.out);
+ } else if (args[i].equals("--hello-stderr")) {
+ HelloStream.to(System.err);
+ } else {
+ System.err.println("jprog: invalid option '" + args[i] +
+ "'");
+ System.exit(2);
+ }
+ }
+ System.exit(0);
+ }
+}
+END
+
+cat > HelloStream.java <<'END'
+import java.io.PrintStream;
+class HelloStream {
+ public static void to(PrintStream stream) {
+ stream.println("Hello, Stream!");
+ }
+}
+END
+
+## TESTS ##
+
+cat >> Makefile.am <<'END'
+## FIXME: Use AM_TESTS_ENVIRONMENT here when it becomes available.
+TESTS_ENVIRONMENT = \
+ if test x"$$jprog_doing_installcheck" != x"yes"; then \
+ jprog_classpath='$(abs_top_builddir):$(abs_top_srcdir)'; \
+ export jprog_classpath; \
+ PATH='$(abs_top_builddir)$(PATH_SEPARATOR)'$$PATH; \
+ export PATH; \
+ else \
+ unset jprog_classpath || :; \
+ PATH='$(prefix)/bin$(PATH_SEPARATOR)'$$PATH; \
+ export PATH; \
+ fi; \
+ config_time_prefix='@prefix@'; export config_time_prefix;
+
+TESTS = \
+ simple.test \
+ prefix.test \
+ stdout.test \
+ stderr.test \
+ badarg.test
+
+XFAIL_TESTS = badarg.test
+
+EXTRA_DIST += $(TESTS)
+END
+
+cat > simple.test <<'END'
+#!/bin/sh
+jprog
+END
+
+cat > prefix.test <<'END'
+#!/bin/sh
+jprefix=`jprog --print-prefix` || exit 1
+echo "$0: exp prefix: $config_time_prefix"
+echo "$0: got prefix: $jprefix"
+test x"$jprefix" = x"$config_time_prefix"
+END
+
+cat > stdout.test <<'END'
+#!/bin/sh
+rc=0
+jprog --hello-stdout >stdout.out 2>stdout.err || { echo \$?=$?; rc=1; }
+sed 's/^/out:/' <stdout.out # For debugging.
+sed 's/^/err:/' <stdout.err >&2 # Likewise.
+test -s stdout.err && rc=1
+test "`cat stdout.out`" = 'Hello, Stream!' || rc=1
+rm -f stdout.out stdout.err || rc=1
+exit $rc
+END
+
+cat > stderr.test <<'END'
+#!/bin/sh
+rc=0
+jprog --hello-stderr >stderr.out 2>stderr.err || { echo \$?=$?; rc=1; }
+sed 's/^/out:/' <stderr.out # For debugging.
+sed 's/^/err:/' <stderr.err >&2 # Likewise.
+test -s stderr.out && rc=1
+test "`cat stderr.err`" = 'Hello, Stream!' || rc=1
+rm -f stderr.out stderr.err || rc=1
+exit $rc
+END
+
+cat > badarg.test <<'END'
+#!/bin/sh
+jprog --bad-argument
+END
+
+chmod a+x *.test
+
+## DO CHECKS ##
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+
+# To have the parallel testsuite more verbose.
+VERBOSE=yes; export VERBOSE
+
+./configure --prefix="`pwd`/_inst"
+cat PkgLocation.java # For debugging.
+$MAKE check
+$MAKE install
+$MAKE test-installed
+$MAKE run-installed
+$MAKE distcheck
+
+:
diff --git a/tests/java-compile-run-nested.test
b/tests/java-compile-run-nested.test
new file mode 100755
index 0000000..fd9ba4a
--- /dev/null
+++ b/tests/java-compile-run-nested.test
@@ -0,0 +1,252 @@
+#! /bin/sh
+# Copyright (C) 2011 Free Software Foundation, Inc.
+#
+# 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 2, 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 <http://www.gnu.org/licenses/>.
+
+# Test on compilation and execution of Java class files.
+# Also meddle with wrapper scripts, as would be probably seen in a real
+# "UNIX-style" use case.
+# This test uses a typical "nested" source tree setup (i.e., different
+# components/aspects are separated into different subdirectories),
+# and uses the 'parallel-tests' testsuite driver. The sister test
+# `java-compile-run-flat.test' do similar checks with a "flat" setup
+# (i.e., everything in the top-level directory), and forcing the use
+# of the older non-parallel 'simple-tests' driver.
+
+required='java javac'
+am_parallel_tests=yes
+. ./defs || Exit 1
+
+echo "AC_SUBST([PATH_SEPARATOR], ['$PATH_SEPARATOR'])" >> configure.in
+
+cat >> configure.in <<'END'
+AC_SUBST([JAVA], [java])
+AC_CONFIG_SRCDIR([jprog/PkgLocation.jin])
+AC_SUBST([jprogdatadir], ['${pkgdatadir}'])
+AC_SUBST([jprogclassdir], ['${jprogdatadir}/jprog'])
+AC_CONFIG_FILES([jprog/PkgLocation.java:jprog/PkgLocation.jin])
+AC_CONFIG_FILES([jprog/Makefile bin/Makefile tests/Makefile])
+AC_OUTPUT
+END
+
+## TOP-LEVEL SETUP AND TARGETS ##
+
+cat > Makefile.am <<'END'
+SUBDIRS = bin jprog tests
+
+test-built:
+ ls -l $(srcdir)/* ;: For debugging.
+ test $(srcdir) = . || ls -l * ;: Likewise.
+ test -f $(srcdir)/jprog/Main.java
+ test -f $(srcdir)/jprog/HelloStream.java
+ test -f $(srcdir)/jprog/PkgLocation.jin
+ test -f jprog/PkgLocation.java
+ test -f jprog/HelloStream.class
+ test -f jprog/Main.class
+ test -f jprog/PkgLocation.class
+ test -f jprog/classjprogclass.stamp
+
+test-installed:
+ ls -l $(jprogclassdir) ;: For debugging.
+ test -f $(jprogclassdir)/HelloStream.class
+ test -f $(jprogclassdir)/Main.class
+ test -f $(jprogclassdir)/PkgLocation.class
+ if find $(prefix) | grep '\.stamp$$'; then exit 1; else :; fi
+
+run-installed:
+ jprog_doing_installcheck=yes $(MAKE) $(AM_MAKEFLAGS) check
+
+check-local: test-built
+installcheck-local: test-installed run-installed
+
+.PHONY: test-built test-installed run-installed
+END
+
+## WRAPPER SCRIPT ##
+
+mkdir bin
+
+cat > bin/Makefile.am <<'END'
+bin_SCRIPTS = jprog
+
+edit_script = sed -e 's|address@hidden@|$(JAVA)|g' \
+ -e 's|address@hidden@|$(jprogdatadir)|g' \
+ -e 's|address@hidden@|$(SHELL)|g' \
+ -e 's|address@hidden@|$(PATH_SEPARATOR)|g'
+
+jprog: jprog.sh
+ rm -f $@ address@hidden
+ $(edit_script) `test -f 'address@hidden' || echo
$(srcdir)/address@hidden >address@hidden
+ chmod a-w address@hidden && chmod a+x address@hidden && mv -f
address@hidden $@
+ sed 's/^/ | /' $@ ;: for debugging.
+
+EXTRA_DIST = jprog.sh
+CLEANFILES = jprog
+END
+
+cat > bin/jprog.sh <<'END'
address@hidden@
+CLASSPATH=${jprog_classpath-'@jprogdatadir@'}${CLASSPATH+"@address@hidden"}
+export CLASSPATH
+case $# in
+ 0) exec @JAVA@ jprog.Main;;
+ *) exec @JAVA@ jprog.Main "$@";;
+esac
+END
+
+## JAVA SOURCES ##
+
+mkdir jprog
+
+cat > jprog/Makefile.am <<'END'
+dist_jprogclass_JAVA = Main.java HelloStream.java
+nodist_jprogclass_JAVA = PkgLocation.java
+END
+
+cat > jprog/PkgLocation.jin <<'END'
+package jprog;
+public class PkgLocation {
+ public static String prefix() {
+ return new String("@prefix@");
+ }
+}
+END
+
+cat > jprog/Main.java <<'END'
+package jprog;
+import jprog.PkgLocation;
+import jprog.HelloStream;
+public class Main {
+ public static void main(String[] args) {
+ for (int i = 0; i < args.length; i++) {
+ if (args[i].equals("--print-prefix")) {
+ System.out.println(PkgLocation.prefix());
+ } else if (args[i].equals("--hello-stdout")) {
+ HelloStream.to(System.out);
+ } else if (args[i].equals("--hello-stderr")) {
+ HelloStream.to(System.err);
+ } else {
+ System.err.println("jprog: invalid option '" + args[i] +
+ "'");
+ System.exit(2);
+ }
+ }
+ System.exit(0);
+ }
+}
+END
+
+cat > jprog/HelloStream.java <<'END'
+package jprog;
+import java.io.PrintStream;
+class HelloStream {
+ public static void to(PrintStream stream) {
+ stream.println("Hello, Stream!");
+ }
+}
+END
+
+## TESTS ##
+
+mkdir tests
+
+cat > tests/Makefile.am <<'END'
+## FIXME: Use AM_TESTS_ENVIRONMENT here when it becomes available.
+TESTS_ENVIRONMENT = \
+ if test x"$$jprog_doing_installcheck" != x"yes"; then \
+ jprog_classpath='$(abs_top_builddir):$(abs_top_srcdir)'; \
+ export jprog_classpath; \
+ PATH='$(abs_top_builddir)/bin$(PATH_SEPARATOR)'$$PATH; \
+ export PATH; \
+ else \
+ unset jprog_classpath || :; \
+ PATH='$(prefix)/bin$(PATH_SEPARATOR)'$$PATH; \
+ export PATH; \
+ fi; \
+ config_time_prefix='@prefix@'; export config_time_prefix;
+
+TESTS = \
+ simple.test \
+ prefix.test \
+ stdout.test \
+ stderr.test \
+ badarg.test
+
+XFAIL_TESTS = badarg.test
+
+EXTRA_DIST = $(TESTS)
+END
+
+cat > tests/simple.test <<'END'
+#!/bin/sh
+jprog
+END
+
+cat > tests/prefix.test <<'END'
+#!/bin/sh
+jprefix=`jprog --print-prefix` || exit 1
+echo "$0: exp prefix: $config_time_prefix"
+echo "$0: got prefix: $jprefix"
+test x"$jprefix" = x"$config_time_prefix"
+END
+
+cat > tests/stdout.test <<'END'
+#!/bin/sh
+rc=0
+jprog --hello-stdout >stdout.out 2>stdout.err || { echo \$?=$?; rc=1; }
+sed 's/^/out:/' <stdout.out # For debugging.
+sed 's/^/err:/' <stdout.err >&2 # Likewise.
+test -s stdout.err && rc=1
+test "`cat stdout.out`" = 'Hello, Stream!' || rc=1
+rm -f stdout.out stdout.err || rc=1
+exit $rc
+END
+
+cat > tests/stderr.test <<'END'
+#!/bin/sh
+rc=0
+jprog --hello-stderr >stderr.out 2>stderr.err || { echo \$?=$?; rc=1; }
+sed 's/^/out:/' <stderr.out # For debugging.
+sed 's/^/err:/' <stderr.err >&2 # Likewise.
+test -s stderr.out && rc=1
+test "`cat stderr.err`" = 'Hello, Stream!' || rc=1
+rm -f stderr.out stderr.err || rc=1
+exit $rc
+END
+
+cat > tests/badarg.test <<'END'
+#!/bin/sh
+jprog --bad-argument
+END
+
+chmod a+x tests/*.test
+
+## DO CHECKS ##
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+
+# To have the parallel testsuite more verbose.
+VERBOSE=yes; export VERBOSE
+
+./configure --prefix="`pwd`/_inst"
+cat jprog/PkgLocation.java # For debugging.
+$MAKE check
+$MAKE install
+$MAKE test-installed
+$MAKE run-installed
+$MAKE distcheck
+
+:
diff --git a/tests/java-mix.test b/tests/java-mix.test
new file mode 100755
index 0000000..2bf4f72
--- /dev/null
+++ b/tests/java-mix.test
@@ -0,0 +1,67 @@
+#! /bin/sh
+# Copyright (C) 2011 Free Software Foundation, Inc.
+#
+# 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 2, 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 <http://www.gnu.org/licenses/>.
+
+# Check that the JAVA primary can be used freely in the same Makefile.am
+# with proper combinations of the `dist_', `nodist_' and `nobase_'
+# modifiers. Also check that `.java' files are not ditributed by default.
+
+. ./defs || Exit 1
+
+cat >> configure.in << 'END'
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+# This test does not require compilation of *.java files.
+JAVAC = false
+javadir = $(prefix)
+
+java_JAVA = Class.java
+dist_java_JAVA = ClassDist.java
+nodist_java_JAVA = ClassNodist.java
+
+nobase_java_JAVA = ClassNobase.java
+nobase_dist_java_JAVA = ClassNobaseDist.java
+nobase_nodist_java_JAVA = ClassNobaseNodist.java
+
+Class.java ClassNodist.java ClassNobase.java ClassNobaseNodist.java:
+ @echo '$@ should not be generated!' >&2; exit 1
+END
+
+: > ClassDist.java
+: > ClassNobaseDist.java
+
+$ACLOCAL
+$AUTOCONF
+# Automake used to display non-fatal warnings with this test, but
+# they were unexpected, so we want to consider them as failures in
+# this test.
+$AUTOMAKE 2>stderr || { cat stderr >&2; Exit 1; }
+cat stderr >&2
+test ! -s stderr
+
+./configure
+
+$MAKE distdir
+ls -l $distdir # For debugging.
+test ! -f $distdir/Class.java
+test -f $distdir/ClassDist.java
+test ! -f $distdir/ClassNobase.java
+test -f $distdir/ClassNobaseDist.java
+test ! -f $distdir/ClassNodist.java
+test ! -f $distdir/ClassNobaseNodist.java
+
+:
diff --git a/tests/tap-common-setup.test b/tests/java-no-duplicate.test
similarity index 56%
copy from tests/tap-common-setup.test
copy to tests/java-no-duplicate.test
index 2bcd9e6..d441c44 100755
--- a/tests/tap-common-setup.test
+++ b/tests/java-no-duplicate.test
@@ -14,30 +14,32 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-# Auxiliary test to set up common data used by many tests on TAP support.
+# Test that some Java-related variables and rules are not repeatedly
+# defined.
-am_parallel_tests=yes
. ./defs || Exit 1
-cat >> configure.in << END
-AC_OUTPUT
-END
-
cat > Makefile.am << 'END'
-TEST_LOG_DRIVER = $(srcdir)/tap-driver
-TEST_LOG_COMPILER = cat
-TESTS = all.test
+javadir = $(datadir)/java
+java_JAVA = a.java
+dist_java_JAVA = b.java
+nodist_java_JAVA = c.java
+nobase_java_JAVA = d.java
+nobase_dist_java_JAVA = e.java
+nobase_nodist_java_JAVA = f.java
END
$ACLOCAL
-$AUTOCONF
$AUTOMAKE
-./configure
+$EGREP -i '\.stamp|\.class|java|classpath' Makefile.in # For debugging.
-rm -rf autom4te*.cache
+for var in JAVAC JAVAROOT CLASSPATH_ENV am__java_sources; do
+ grep "^$var =" Makefile.in
+ test `grep -c "^[$sp$tab]*$var[$sp$tab]*=" Makefile.in` = 1
+done
-# So that the data files we've created won't be removed at exit.
-keep_testdirs=yes
+grep '^classjava\.stamp:' Makefile.in
+test `grep -c "class.*java.*\.stamp.*:" Makefile.in` = 1
:
diff --git a/tests/java-nobase.test b/tests/java-nobase.test
new file mode 100755
index 0000000..b5e86dc
--- /dev/null
+++ b/tests/java-nobase.test
@@ -0,0 +1,65 @@
+#! /bin/sh
+# Copyright (C) 2011 Free Software Foundation, Inc.
+#
+# 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 2, 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 <http://www.gnu.org/licenses/>.
+
+# Test support of `nobase_' with the `JAVA' primary.
+
+required=javac
+. ./defs || Exit 1
+
+cat >>configure.in <<'END'
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+javadir = $(datadir)/java
+nobase_java_JAVA = sub/subsub/Foo.java
+nobase_dist_java_JAVA = sub/Bar.java
+nobase_nodist_java_JAVA = sub2/Baz.java
+
+# Java files are not distributed by default.
+EXTRA_DIST = sub/subsub/Foo.java
+
+sub2/Baz.java:
+ rm -f $@ address@hidden
+ test -d sub2 || mkdir sub2
+ echo 'class Baz {}' > address@hidden
+ chmod a-w address@hidden && mv -f address@hidden $@
+
+.PHONY: test-install
+test-install:
+ find $(prefix) ;: For debugging.
+ test -f $(javadir)/sub/subsub/Foo.class
+ test -f $(javadir)/sub/Bar.class
+ test -f $(javadir)/sub2/Baz.class
+installcheck-local: test-install
+DISTCLEANFILES = sub2/Baz.java
+END
+
+mkdir sub sub/subsub
+echo 'class Foo {}' > sub/subsub/Foo.java
+echo 'class Bar {}' > sub/Bar.java
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+
+./configure --prefix="`pwd`"/_inst
+$MAKE check
+$MAKE install
+$MAKE test-install
+$MAKE distcheck
+
+:
diff --git a/tests/java-noinst.test b/tests/java-noinst.test
index 5fe66d8..eb90aa9 100755
--- a/tests/java-noinst.test
+++ b/tests/java-noinst.test
@@ -14,8 +14,8 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-# Make sure that noinst_JAVA causes generated *.class files not to be
-# installed.
+# Make sure that noinst_JAVA causes generated *.class files not to
+# be installed.
required=javac
. ./defs || Exit 1
@@ -24,28 +24,32 @@ cat >> configure.in << 'END'
AC_OUTPUT
END
-cat > Foo.java <<'END'
-class Foo { }
+cat > Makefile.am <<'END'
+noinst_JAVA = 1.java
+dist_noinst_JAVA = 2.java
+nodist_noinst_JAVA = 3.java
+nobase_noinst_JAVA = 4.java
+nobase_dist_noinst_JAVA = 5.java
+nobase_nodist_noinst_JAVA = 6.java
END
+for i in 1 2 3 4 5 6; do
+ echo "class Class$i {}" > $i.java
+done
+
$ACLOCAL
+$AUTOMAKE
$AUTOCONF
-: > Makefile.in # Will be updated later.
-
./configure --prefix="`pwd`/_inst"
-# We need this hacky loop because multiple uses of the JAVA primary
-# in the same Makefile.am are not allowed.
-
-for prefix in '' nodist_ dist_; do
- echo "${prefix}noinst_JAVA = Foo.java" > Makefile.am
- $AUTOMAKE
- ./config.status Makefile
- $MAKE
- test -f Foo.class
- $MAKE install
- test ! -d _inst
+$MAKE
+ls -l
+for i in 1 2 3 4 5 6; do
+ test -f Class$i.class
done
+$MAKE install
+test -d _inst && { ls -l _inst; Exit 1; }
+
:
diff --git a/tests/java-rebuild.test b/tests/java-rebuild.test
new file mode 100755
index 0000000..0b5ad64
--- /dev/null
+++ b/tests/java-rebuild.test
@@ -0,0 +1,124 @@
+#! /bin/sh
+# Copyright (C) 2011 Free Software Foundation, Inc.
+#
+# 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 2, 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 <http://www.gnu.org/licenses/>.
+
+# Test rebuild rules for Java class files.
+
+required='javac'
+. ./defs || Exit 1
+
+cat >> configure.in <<'END'
+AC_OUTPUT
+END
+
+cat > Makefile.am <<'END'
+AM_JAVACFLAGS = -verbose
+foodir = $(datadir)/java
+foo_JAVA = a.java
+dist_foo_JAVA = d.java
+nodist_foo_JAVA = n.java
+nobase_foo_JAVA = Nobase.java
+nobase_dist_foo_JAVA = NobaseDist.java
+nobase_nodist_foo_JAVA = NobaseNoDist.java
+END
+
+echo 'class _x {}' > a.java
+echo 'class x_ {}' > d.java
+echo 'class a {} class d {}' > n.java
+echo 'class Nobase_Foo {} class Nobase_Bar {}' > Nobase.java
+echo 'class NobaseDist {}' > NobaseDist.java
+echo 'class NobaseNoDist {}' > NobaseNoDist.java
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+
+all_classes='_x x_ a d Nobase_Foo Nobase_Bar NobaseDist NobaseNoDist'
+
+for vpath in : false; do
+
+ if $vpath; then
+ srcdir=..
+ mkdir build
+ cd build
+ else
+ srcdir=.
+ fi
+
+ $srcdir/configure
+ $MAKE
+ ls -l # For debugging.
+
+ # Sanity check.
+ test -f classfoo.stamp
+ for cls in $all_classes; do
+ test -f $cls.class
+ done
+
+ # When the stampfile is removed, all the *.class files should
+ # be considered out-of-date.
+ echo timestamp > older
+ $sleep
+ rm -f classfoo.stamp
+ $MAKE
+ for cls in $all_classes; do
+ is_newest $cls.class older
+ done
+
+ # When only a java file is modified, only the *.class files derived from
+ # it should be updated.
+ # The strings we loop on here have the following format:
+ # ``JAVA-FILES-TO-BE-TOUCHED -- CLASSES-THAT-SHOULD-BE-UPDATED''
+ for args in \
+ 'a -- _x' \
+ 'd -- x_' \
+ 'n -- a d' \
+ 'a d Nobase -- _x x_ Nobase_Foo Nobase_Bar' \
+ 'n NobaseDist -- a d NobaseDist' \
+ 'd NobaseNoDist -- x_ NobaseNoDist' \
+ "a d n Nobase NobaseDist NobaseNoDist -- $all_classes" \
+ ; do
+ set $args
+ touched_javas=
+ while test $# -gt 0; do
+ if test x"$1" = x"--"; then
+ shift
+ break
+ else
+ touched_javas="$touched_javas $1"
+ shift
+ fi
+ done
+ updated_classes=$*
+ echo timestamp > older
+ $sleep
+ for j in $touched_javas; do
+ touch $srcdir/$j.java
+ done
+ $MAKE
+ is_newest classfoo.stamp older
+ for cls in $all_classes; do
+ case " $updated_classes " in
+ *" $cls "*) is_newest $cls.class older;;
+ *) is_newest older $cls.class;;
+ esac
+ done
+ done # $args ...
+
+ cd $srcdir
+
+done # $vpath ...
+
+:
diff --git a/tests/tests-environment.test b/tests/java-sources.test
similarity index 60%
copy from tests/tests-environment.test
copy to tests/java-sources.test
index e3dc76a..9bf8855 100755
--- a/tests/tests-environment.test
+++ b/tests/java-sources.test
@@ -14,7 +14,8 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-# "Simple Tests" testsuite driver: check TESTS_ENVIRONMENT support.
+# Test definition of automake-generated private Makefile variable
+# `$(am__java_sources)'.
. ./defs || Exit 1
@@ -23,23 +24,42 @@ AC_OUTPUT
END
cat > Makefile.am << 'END'
-TESTS = foo.test
-EXTRA_DIST = $(TESTS)
-END
+foodir = $(prefix)
-cat > foo.test << 'END'
-#! /bin/sh
-test x"$FOO" = x"ok"
+foo_JAVA = a.java
+dist_foo_JAVA = b.java
+nodist_foo_JAVA = c.java
+nobase_foo_JAVA = d.java
+nobase_dist_foo_JAVA = e.java
+nobase_nodist_foo_JAVA = f.java
+
+.PHONY: debug
+debug:
+ @echo 'am__java_sources: "$(am__java_sources)"'
+got:
+ @lst='$(am__java_sources)'; \
+ for f in $$lst; do echo $$f; done | sort > $@
END
-chmod a+x foo.test
$ACLOCAL
+$AUTOMAKE
$AUTOCONF
-$AUTOMAKE -a
+
+cat > exp << 'END'
+a.java
+b.java
+c.java
+d.java
+e.java
+f.java
+END
./configure
+$MAKE debug
+$MAKE got
-FOO=bad TESTS_ENVIRONMENT='FOO=ok' $MAKE check
-FOO=ok TESTS_ENVIRONMENT='FOO=bad' $MAKE check && Exit 1
+cat got
+cat exp
+diff exp got
:
diff --git a/tests/java-uninstall.test b/tests/java-uninstall.test
new file mode 100755
index 0000000..c1672e7
--- /dev/null
+++ b/tests/java-uninstall.test
@@ -0,0 +1,99 @@
+#! /bin/sh
+# Copyright (C) 1998, 2001, 2002, 2004, 2007 Free Software Foundation, Inc.
+#
+# 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 2, 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 <http://www.gnu.org/licenses/>.
+
+# Check uninstallation of Java class files.
+
+required=javac
+. ./defs || Exit 1
+
+cat >> configure.in << 'END'
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+javadir = $(prefix)/java
+java_JAVA = Foo.java
+nobase_java_JAVA = Foo2.java
+nobase_dist_java_JAVA = Bar.java
+nodist_java_JAVA = Baz.java
+
+# Java files are not distributed by default, so we distribute
+# one "by hand" ...
+EXTRA_DIST = Foo.java
+# ... and make the other one generated.
+Foo2.java:
+ rm -f $@ address@hidden
+ echo 'class bClass {}' > address@hidden
+ chmod a-w address@hidden && mv -f address@hidden $@
+
+# Explicitly declared as `nodist_', so generate it.
+Baz.java:
+ rm -f $@ address@hidden
+ echo 'class Baz {}' > address@hidden
+ echo 'class Baz2 {}' >> address@hidden
+ chmod a-w address@hidden && mv -f address@hidden $@
+
+DISTCLEANFILES = Baz.java Foo2.java
+END
+
+echo 'class aClass {}' > Foo.java
+echo 'class Zardoz {}' > Bar.java
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+
+./configure --prefix="`pwd`"/_inst
+javadir=_inst/java
+
+check_uninstallation()
+{
+ test ! -r $javadir/aClass.class
+ test ! -r $javadir/bClass.class
+ test ! -r $javadir/Zardoz.class
+ test ! -r $javadir/Baz.class
+ test ! -r $javadir/Baz2.class
+ test -f $javadir/Foo.class
+ test -f $javadir/Bar.class
+ test -f $javadir/xClass.class
+ test -f $javadir/aclass.class
+}
+
+$MAKE
+ls -l
+$MAKE install
+: > $javadir/Foo.class
+: > $javadir/Bar.class
+: > $javadir/xClass.class
+: > $javadir/aclass.class
+ls -l $javadir
+$MAKE uninstall
+ls -l $javadir
+check_uninstallation
+
+# FIXME: "make uninstall" should continue to work also after "make clean",
+# but currently this doesn't happen. See automake bug#8540.
+$MAKE install
+ls -l $javadir
+$MAKE clean
+ls -l
+$MAKE uninstall
+ls -l $javadir
+#check_uninstallation
+
+$MAKE distcheck
+
+:
diff --git a/tests/java.test b/tests/java.test
index 671d2fd..fdf2092 100755
--- a/tests/java.test
+++ b/tests/java.test
@@ -24,7 +24,6 @@ cat >>configure.in <<'EOF'
AC_OUTPUT
EOF
-
cat > Makefile.am << 'END'
javadir = $(datadir)/java
dist_java_JAVA = a.java b.java
@@ -33,7 +32,10 @@ END
$ACLOCAL
$AUTOCONF
$AUTOMAKE
-grep '^all[-a-z]*:.*classdist_java\.stamp' Makefile.in
+
+$EGREP '\.stamp|class' Makefile.in # For debugging.
+grep '^all[-a-z]*:.*classjava\.stamp' Makefile.in
+test `grep -c '^all[-a-z]*:.*classjava\.stamp' Makefile.in` -eq 1
cat >a.java <<EOF
class a
diff --git a/tests/yflags-force-override.test b/tests/javaflags.test
similarity index 56%
copy from tests/yflags-force-override.test
copy to tests/javaflags.test
index 3ed1b38..2b1e471 100755
--- a/tests/yflags-force-override.test
+++ b/tests/javaflags.test
@@ -14,51 +14,47 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-# Check that automake can cope with a definition of the $(YFLAGS) variable
-# in Makefile.am (even if that is extremely bad practice, because that
-# variable is user-reserved).
+# Check support for $(JAVACFLAGS) and $(AM_JAVACFLAGS).
-required='cc yacc'
. ./defs || Exit 1
+cat > fake-javac <<'END'
+#!/bin/sh
+echo "$*" > javaflags.list
+END
+chmod a+x fake-javac
+
+# Remove JAVAC from the environment, so that it won't interfere
+# with `make -e' below.
+unset JAVAC || :
+
cat >> configure.in <<'END'
AC_PROG_CC
-AC_PROG_YACC
+# Simulate presence of the java compiler using our fake-javac script.
+AC_SUBST([JAVAC], ['$(abs_top_srcdir)'/fake-javac])
AC_OUTPUT
END
cat > Makefile.am <<'END'
-bin_PROGRAMS = foo
-foo_SOURCES = foo.y
-# Don't do this in a real-life Makefile.am!
-YFLAGS = -d -v
-END
-
-cat > foo.y << 'END'
-%{
-int yylex () { return 0; }
-void yyerror (char *s) { return; }
-int main () { return 0; }
-%}
-%%
-foobar : 'f' 'o' 'o' 'b' 'a' 'r' {};
+foodir = $(prefix)
+foo_JAVA = bar.java
+AM_JAVACFLAGS = __am_flags__
END
$ACLOCAL
-$AUTOMAKE -a -Wno-gnu
+$AUTOMAKE
+
+grep '\$(JAVACFLAGS).*\$(AM_JAVACFLAGS)' Makefile.in && Exit 1
-$EGREP '(foo|YFLAGS)' Makefile.in # For debugging.
-grep '^foo.h *:' Makefile.in
+: > bar.java
$AUTOCONF
./configure
+env JAVACFLAGS=__user_flags__ $MAKE -e
-$MAKE
-
-test -f foo.c
-test -f foo.h
-test -f foo.output
+ls -l
-$MAKE distcheck
+cat javaflags.list
+grep '__am_flags__.*__user_flags__' javaflags.list
:
diff --git a/tests/javaprim.test b/tests/javaprim.test
index f0b8a1a..f80cec9 100755
--- a/tests/javaprim.test
+++ b/tests/javaprim.test
@@ -15,7 +15,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-# Test to make sure JAVA variable can be defined.
+# Test to make sure JAVA variable can be defined by AC_SUBST.
. ./defs || Exit 1
@@ -31,4 +31,7 @@ END
$ACLOCAL
$AUTOMAKE
+grep -i java Makefile.in # For debugging.
+grep '^JAVA = address@hidden@ *$' Makefile.in
+
:
diff --git a/tests/javasubst.test b/tests/javasubst.test
index 6b867d9..7d6dd9c 100755
--- a/tests/javasubst.test
+++ b/tests/javasubst.test
@@ -15,7 +15,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-# Test to make sure redefining JAVAC works.
+# Test to make sure redefining JAVAC with AC_SUBST works.
. ./defs || Exit 1
@@ -31,6 +31,7 @@ END
$ACLOCAL
$AUTOMAKE
-grep 'address@hidden@' Makefile.in
+grep -i java Makefile.in # For debugging.
+grep '^JAVAC = address@hidden@ *$' Makefile.in
:
diff --git a/tests/list-of-tests.mk b/tests/list-of-tests.mk
index 2a27bd1..2499818 100644
--- a/tests/list-of-tests.mk
+++ b/tests/list-of-tests.mk
@@ -446,12 +446,23 @@ interp2.test \
java.test \
java2.test \
java3.test \
+javaflags.test \
java-check.test \
+java-clean.test \
+java-compile-install.test \
+java-compile-run-flat.test \
+java-compile-run-nested.test \
java-empty-classpath.test \
javaprim.test \
javasubst.test \
java-extra.test \
+java-mix.test \
+java-no-duplicate.test \
+java-nobase.test \
java-noinst.test \
+java-rebuild.test \
+java-sources.test \
+java-uninstall.test \
ldadd.test \
ldflags.test \
lex.test \
@@ -579,6 +590,7 @@ no-outdir-option.test \
nobase.test \
nobase-libtool.test \
nobase-python.test \
+nobase-nodist.test \
nodef.test \
nodef2.test \
nodep.test \
@@ -629,6 +641,7 @@ parallel-tests6.test \
parallel-tests8.test \
parallel-tests9.test \
parallel-tests10.test \
+parallel-tests-exeext.test \
parallel-tests-suffix.test \
parallel-tests-suffix-prog.test \
parallel-tests-log-compiler-1.test \
@@ -742,6 +755,14 @@ primary-prefix-couples-force-valid.test \
primary-prefix-couples-documented-valid.test \
proginst.test \
programs-primary-rewritten.test \
+py-compile-basedir.test \
+py-compile-basic.test \
+py-compile-basic2.test \
+py-compile-destdir.test \
+py-compile-env.test \
+py-compile-option-terminate.test \
+py-compile-usage.test \
+python-dist.test \
python.test \
python2.test \
python3.test \
diff --git a/tests/nobase-nodist.test b/tests/nobase-nodist.test
new file mode 100644
index 0000000..4ea9df4
--- /dev/null
+++ b/tests/nobase-nodist.test
@@ -0,0 +1,60 @@
+#! /bin/sh
+# Copyright (C) 2011 Free Software Foundation, Inc.
+#
+# 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 2, 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 <http://www.gnu.org/licenses/>.
+
+# Interaction of `nobase_' and `nodist_' prefixes.
+
+. ./defs || Exit 1
+
+# Simulate no emacs and no python (it shouldn't be needed in this test).
+EMACS="no" PYTHON=":"; export EMCAS PYTHON
+
+cat >> configure.in << 'END'
+AM_PATH_LISPDIR
+AM_PATH_PYTHON([], [], [:])
+# Simulate no javac (it shouldn't be needed in this test).
+AC_SUBST([JAVAC], [false])
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+nobase_nodist_noinst_PYTHON = baz1.py sub/baz2.py
+# Lisp and Java sources are not distributed by default, so try both
+# with and without the `nodist_' prefix, for more coverage.
+nobase_noinst_LISP = foo1.el sub/foo2.el
+nobase_nodist_noinst_LISP = foo3.el sub/foo4.el
+nobase_noinst_JAVA = bar1.java sub/bar2.java
+nobase_nodist_noinst_JAVA = bar3.java sub/bar4.java
+END
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE -a
+./configure
+$MAKE distdir
+
+ls -l $distdir $distdir/* # For debugging.
+test ! -f $distdir/foo1.el
+test ! -f $distdir/sub/foo2.el
+test ! -f $distdir/foo3.el
+test ! -f $distdir/sub/foo4.el
+test ! -f $distdir/bar1.java
+test ! -f $distdir/sub/bar2.java
+test ! -f $distdir/bar3.java
+test ! -f $distdir/sub/bar4.java
+test ! -f $distdir/baz1.py
+test ! -f $distdir/sub/baz2.py
+
+:
diff --git a/tests/test-missing.test b/tests/parallel-tests-exeext.test
similarity index 51%
copy from tests/test-missing.test
copy to tests/parallel-tests-exeext.test
index 4e9f286..9275a56 100755
--- a/tests/test-missing.test
+++ b/tests/parallel-tests-exeext.test
@@ -15,58 +15,53 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# parallel-tests:
-# - non-existent scripts listed in TESTS get diagnosed
-# See also related test 'test-missing2.test'.
+# - check2.am and interaction with $(EXEEXT)
am_parallel_tests=yes
. ./defs || Exit 1
cat >> configure.in << 'END'
+dnl We need to fool the init.m4 internals a little.
+AC_DEFUN([_AM_FOO],
+ [m4_provide([_AM_COMPILER_EXEEXT])
+ AC_SUBST([CC], [false])
+ AC_SUBST([EXEEXT])])
+_AM_FOO
AC_OUTPUT
END
cat > Makefile.am << 'END'
-TESTS = ok.test zardoz.test
+TESTS = x y a.test b.test
+LOG_COMPILER = true
TEST_LOG_COMPILER = true
+## We also need to fool the automake internals a little.
+EXTRA_PROGRAMS = y
+y_SOURCES =
END
-: > ok.test
-
$ACLOCAL
$AUTOCONF
$AUTOMAKE -a
-./configure
-
-$MAKE check >output 2>&1 && { cat output; Exit 1; }
-cat output
-test -f ok.log
-grep '^PASS: ok\.test' output
-$FGREP 'zardoz.log' output
-test ! -f test-suite.log
+$EGREP 'EXEEXT|\.log|\.test' Makefile.in # For debugging.
-TESTS='zardoz2.test' $MAKE -e check >output 2>&1 \
- && { cat output; Exit 1; }
-cat output
-$FGREP 'zardoz2.log' output
-test ! -f test-suite.log
-
-TEST_LOGS='zardoz3.log' $MAKE -e check >output 2>&1 \
- && { cat output; Exit 1; }
-cat output
-$FGREP 'zardoz3.log' output
-test ! -f test-suite.log
+./configure EXEEXT=
+touch x y a.test b.test
+$MAKE check
-# The errors should persist even after `test-suite.log'
-# has been created.
+$MAKE distclean
+rm -f x y a.test b.test *.log *.trs
-: > zardoz.test
+./configure EXEEXT=.bin
+touch x y.bin a.test b.test.bin
$MAKE check
-rm -f zardoz.test
+ls -l # For debugging.
+test -f y.log
+test ! -r y.bin.log
+test -f b.log
+test ! -r b.test.log
-$MAKE check >output 2>&1 && { cat output; Exit 1; }
-cat output
-$FGREP 'zardoz.log' output
-test ! -f test-suite.log
+$EGREP '^y\.log: y(\$\(EXEEXT\)|\.bin)' Makefile
+$EGREP '^\.test(\$\(EXEEXT\)|\.bin)\.log:' Makefile
:
diff --git a/tests/py-compile-basedir.test b/tests/py-compile-basedir.test
new file mode 100755
index 0000000..1eee980
--- /dev/null
+++ b/tests/py-compile-basedir.test
@@ -0,0 +1,50 @@
+#! /bin/sh
+# Copyright (C) 2011 Free Software Foundation, Inc.
+#
+# 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 2, 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 <http://www.gnu.org/licenses/>.
+
+# Test the `--basedir' option of the `py-compile' script,
+
+required=python
+. ./defs || Exit 1
+
+# We'll need to create files in `..', so we need one more subdirectory
+# level in order not to clutter up the top-level tests directory.
+mkdir sandbox
+cd sandbox
+
+cp "$am_scriptdir/py-compile" . \
+ || fatal_ "failed to fetch auxiliary script py-compile"
+
+f=__init__
+for d in foo foo/bar "`pwd`/foo" . .. ../foo ''; do
+ if test -z "$d"; then
+ d2=.
+ else
+ d2=$d
+ fi
+ ../install-sh -d "$d2" "$d2/sub" || Exit 99
+ : > "$d2/$f.py"
+ : > "$d2/sub/$f.py"
+ ./py-compile --basedir "$d" "$f.py" "sub/$f.py"
+ ls -l "$d2" "$d2/sub" # For debugging.
+ test -f "$d2/$f.pyc"
+ test -f "$d2/$f.pyo"
+ test -f "$d2/sub/$f.pyc"
+ test -f "$d2/sub/$f.pyo"
+ rm -f "$d2/$f.pyc" "$d2/$f.pyo" "$d2/sub/$f.pyc" "$d2/sub/$f.pyo"
+ find . | grep '\.py[co]$' && Exit 1
+done
+
+:
diff --git a/tests/py-compile-basic.test b/tests/py-compile-basic.test
new file mode 100755
index 0000000..f8d083e
--- /dev/null
+++ b/tests/py-compile-basic.test
@@ -0,0 +1,63 @@
+#! /bin/sh
+# Copyright (C) 2011 Free Software Foundation, Inc.
+#
+# 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 2, 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 <http://www.gnu.org/licenses/>.
+
+# Test more basic functionalities of the `py-compile' script,
+# with "believable" python sources. See also related test
+# `py-compile-basic2.test'.
+
+required=python
+. ./defs || Exit 1
+
+cp "$am_scriptdir/py-compile" . \
+ || fatal_ "failed to fetch auxiliary script py-compile"
+
+cat > foo.py <<'END'
+# Try out some non-trivial syntax in here.
+
+'''Module docstring'''
+
+def foo (*args, **kwargs):
+ """Function docstring
+ with embedded newline"""
+ return 1
+
+class Foo:
+ r"""Class docstring"""
+ def __init__(self):
+ r'''Method docstring
+ with
+ embedded
+ newlines'''
+ pass
+
+bar = baz = (1, (2,), [3, 4]); zardoz = 0;
+END
+
+cat > bar.py <<'END'
+# Import of non-existent modules, or assertion of false conditions,
+# shouldn't cause problems, as it should be enough for the code to
+# be syntactically correct.
+import Automake.No.Such.Module
+assert False
+END
+
+./py-compile foo.py bar.py
+test -f foo.pyc
+test -f foo.pyo
+test -f bar.pyc
+test -f bar.pyo
+
+:
diff --git a/tests/py-compile-basic2.test b/tests/py-compile-basic2.test
new file mode 100755
index 0000000..cbb5890
--- /dev/null
+++ b/tests/py-compile-basic2.test
@@ -0,0 +1,70 @@
+#! /bin/sh
+# Copyright (C) 2011 Free Software Foundation, Inc.
+#
+# 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 2, 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 <http://www.gnu.org/licenses/>.
+
+# Test more basic functionalities of the `py-compile' script, with
+# dummy python sources, but more complex directory layouts. See also
+# related test `py-compile-basic.test'.
+
+required=python
+. ./defs || Exit 1
+
+ocwd=`pwd` || Exit 99
+
+pyfiles="
+ foo.py
+ ./foo1.py
+ ../foo2.py
+ ../dir/foo3.py
+ $ocwd/foo4.py
+ sub/bar.py
+ sub/subsub/barbar.py
+ __init__.py
+ sub/__init__.py
+ 1.py
+ .././_.py
+"
+
+lst='
+ dir/foo
+ dir/foo1
+ foo2
+ dir/foo3
+ foo4
+ dir/sub/bar
+ dir/sub/subsub/barbar
+ dir/__init__
+ dir/sub/__init__
+ dir/1
+ _
+'
+
+mkdir dir
+cd dir
+cp "$am_scriptdir/py-compile" . \
+ || fatal_ "failed to fetch auxiliary script py-compile"
+mkdir sub sub/subsub
+touch $pyfiles
+./py-compile $pyfiles
+cd "$ocwd"
+
+for x in $lst; do echo $x.pyc; echo $x.pyo; done | sort > exp
+find . -name '*.py[co]' | sed 's|^\./||' | sort > got
+
+cat exp
+cat got
+diff exp got
+
+:
diff --git a/tests/py-compile-destdir.test b/tests/py-compile-destdir.test
new file mode 100755
index 0000000..1bcd17b
--- /dev/null
+++ b/tests/py-compile-destdir.test
@@ -0,0 +1,43 @@
+#! /bin/sh
+# Copyright (C) 2011 Free Software Foundation, Inc.
+#
+# 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 2, 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 <http://www.gnu.org/licenses/>.
+
+# Test the `--destdir' option of the `py-compile' script,
+
+required=python
+. ./defs || Exit 1
+
+cp "$am_scriptdir/py-compile" . \
+ || fatal_ "failed to fetch auxiliary script py-compile"
+
+# Should not give false positives when grepping for it, so use
+# an "uncommon" string (with ugly CamelCase).
+destdir=TheDestDir
+
+mkdir sub $destdir $destdir/sub
+echo 'def foo (): return "foo"' > $destdir/foo.py
+echo 'def bar (): return "bar"' > $destdir/sub/bar.py
+
+./py-compile --destdir $destdir foo.py sub/bar.py
+ls -l $destdir $destdir/sub # For debugging.
+ls . sub | grep '\.py[co]$' && Exit 1
+test -f $destdir/foo.pyc
+test -f $destdir/foo.pyo
+test -f $destdir/sub/bar.pyc
+test -f $destdir/sub/bar.pyo
+strings $destdir/*.py[co] $destdir/sub/*.py[co] || : # For debugging.
+$FGREP $destdir $destdir/*.py[co] $destdir/sub/*.py[co] && Exit 1
+
+:
diff --git a/tests/py-compile-env.test b/tests/py-compile-env.test
new file mode 100755
index 0000000..df6b737
--- /dev/null
+++ b/tests/py-compile-env.test
@@ -0,0 +1,59 @@
+#! /bin/sh
+# Copyright (C) 2011 Free Software Foundation, Inc.
+#
+# 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 2, 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 <http://www.gnu.org/licenses/>.
+
+# Make sure `py-compile' honours the PYTHON environment variable.
+
+. ./defs || Exit 1
+
+cp "$am_scriptdir/py-compile" . \
+ || fatal_ "failed to fetch auxiliary script py-compile"
+
+cat > my-py <<'END'
+#!/bin/sh
+: > my-py.run
+END
+chmod a+x my-py
+
+mkdir sub1
+cd sub1
+
+PYTHON=: ../py-compile foo.py
+ls | grep . && Exit 1
+
+PYTHON=false ../py-compile foo.py && Exit 1
+ls | grep . && Exit 1
+
+PYTHON='echo GrEpMe AndMeToo' ../py-compile foo.py
+PYTHON='echo GrEpMe AndMeToo' ../py-compile foo.py | grep 'GrEpMe AndMeToo'
+ls | grep . && Exit 1
+
+cd ..
+mkdir sub2
+cd sub2
+
+PYTHON=../my-py ../py-compile foo.py
+test -f my-py.run
+ls | grep -v '^my-py\.run$' | grep . && Exit 1
+
+cd ..
+mkdir sub3
+cd sub3
+PATH=..$PATH_SEPARATOR$PATH; export PATH
+PYTHON=my-py py-compile foo.py
+test -f my-py.run
+ls | grep -v '^my-py\.run$' | grep . && Exit 1
+
+:
diff --git a/tests/aclocal-print-acdir.test
b/tests/py-compile-option-terminate.test
similarity index 57%
copy from tests/aclocal-print-acdir.test
copy to tests/py-compile-option-terminate.test
index c55ae2b..74bf638 100755
--- a/tests/aclocal-print-acdir.test
+++ b/tests/py-compile-option-terminate.test
@@ -14,23 +14,30 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-# Test on aclocal's `--print-ac-dir' option.
+# Check that a non-option argument and the `--' special argument
+# explicitly terminate the option list for `py-compile'.
-am_create_testdir=empty
+required=python
. ./defs || Exit 1
-set -e
-
-$ACLOCAL --print-ac-dir
-test "`$ACLOCAL --print-ac-dir`" = "$am_system_acdir"
-
-$ACLOCAL -Wno-obsolete --acdir foo --print-ac-dir
-test "`$ACLOCAL -Wno-obsolete --acdir foo --print-ac-dir`" = foo
-
-$ACLOCAL --system-acdir /bar --print-ac-dir
-test "`$ACLOCAL --system-acdir /bar --print-ac-dir`" = /bar
-
-$ACLOCAL --automake-acdir /bar --print-ac-dir
-test "`$ACLOCAL --automake-acdir /bar --print-ac-dir`" = "$am_system_acdir"
+cp "$am_scriptdir/py-compile" . \
+ || fatal_ "failed to fetch auxiliary script py-compile"
+
+: > ./-o.py
+: > ./--foo.py
+./py-compile -- -o.py --foo.py
+test -f ./-o.pyc
+test -f ./-o.pyo
+test -f ./--foo.pyc
+test -f ./--foo.pyo
+rm -f ./-*.py[co]
+: > x.py
+./py-compile x.py -o.py --foo.py
+test -f ./x.pyc
+test -f ./x.pyo
+test -f ./-o.pyc
+test -f ./-o.pyo
+test -f ./--foo.pyc
+test -f ./--foo.pyo
:
diff --git a/tests/py-compile-usage.test b/tests/py-compile-usage.test
new file mode 100755
index 0000000..0e2088d
--- /dev/null
+++ b/tests/py-compile-usage.test
@@ -0,0 +1,75 @@
+#! /bin/sh
+# Copyright (C) 2011 Free Software Foundation, Inc.
+#
+# 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 2, 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 <http://www.gnu.org/licenses/>.
+
+# Test `py-compile --help', `py-compile --version', and that `py-compile'
+# correctly complains on wrong usage.
+
+. ./defs || Exit 1
+
+cp "$am_scriptdir/py-compile" . \
+ || fatal_ "failed to fetch auxiliary script py-compile"
+
+# --help
+
+./py-compile --help >stdout 2>stderr \
+ || { cat stdout; cat stderr >&2; Exit 1; }
+cat stdout
+test -s stderr && { cat stderr >&2; Exit 1; }
+grep '^Usage: py-compile .' stdout
+$FGREP ' [--basedir DIR]' stdout
+$FGREP ' [--destdir DIR]' stdout
+
+# --version
+
+./py-compile --version >stdout 2>stderr \
+ || { cat stdout; cat stderr >&2; Exit 1; }
+cat stdout
+test -s stderr && { cat stderr >&2; Exit 1; }
+year='20[0-9][0-9]' # Hopefully automake will be obsolete in 80 years ;-)
+month='(0[0-9]|1[012])'
+day='([012][0-9]|3[01])'
+hour='([01][0-9]|2[0123])'
+LC_ALL=C $EGREP "^py-compile $year-$month-$day\.$hour" stdout
+test `wc -l <stdout` -eq 1
+
+# Unknown option.
+
+for opt in -b -d --foo; do
+ ./py-compile $opt 2>stderr && { cat stderr >&2; Exit 1; }
+ cat stderr >&2
+ grep "^py-compile: unrecognized option ['\`]$opt'" stderr
+ grep "^Try [\`']py-compile --help' for more information" stderr
+done
+
+# Missing option argument.
+
+for opt in --basedir --destdir; do
+ ./py-compile $opt 2>stderr && { cat stderr >&2; Exit 1; }
+ cat stderr >&2
+ grep "^py-compile: option ['\`]$opt' requires an argument" stderr
+ grep "^Try [\`']py-compile --help' for more information" stderr
+done
+
+# Missing files.
+
+for args in '' '--basedir dir' '--destdir dir'; do
+ ./py-compile $args 2>stderr && { cat stderr >&2; Exit 1; }
+ cat stderr >&2
+ grep '^py-compile: no files given' stderr
+ grep "^Try [\`']py-compile --help' for more information" stderr
+done
+
+:
hooks/post-receive
--
GNU Automake
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Automake-commit] [SCM] GNU Automake branch, testsuite-work, updated. v1.11-1404-gd344ff9,
Stefano Lattarini <=