summaryrefslogtreecommitdiffstats
path: root/test/Java
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2008-02-04 19:07:24 (GMT)
committerSteven Knight <knight@baldmt.com>2008-02-04 19:07:24 (GMT)
commitbe25024e65a30e65a9e3799ffa5323e23f49003d (patch)
tree439714b7733dd4ffe858b1fc15e15fa3e036048d /test/Java
parent0abfc01296f0184fb6c997400b92cfa7e48d81ef (diff)
downloadSCons-be25024e65a30e65a9e3799ffa5323e23f49003d.zip
SCons-be25024e65a30e65a9e3799ffa5323e23f49003d.tar.gz
SCons-be25024e65a30e65a9e3799ffa5323e23f49003d.tar.bz2
Merged revisions 2527-2645 via svnmerge from
http://scons.tigris.org/svn/scons/branches/core ........ r2528 | stevenknight | 2007-12-13 06:08:21 -0800 (Thu, 13 Dec 2007) | 5 lines Remove the .del_binfo() method, no longer needed since the Big Signature Refactoring causes us to visit every Node in order during the DAG walk, and the BuildInfo object now just holds information for storage in the .sconsign file. ........ r2529 | stevenknight | 2007-12-13 13:17:15 -0800 (Thu, 13 Dec 2007) | 3 lines Fix the --keep-going flag so it builds all possible targets even when a later top-level target depends on a child that failed its build. ........ r2530 | stevenknight | 2007-12-14 04:02:05 -0800 (Fri, 14 Dec 2007) | 4 lines Issue 1715: BuildDir(duplicate=0) support for Tex/LaTeX. Re-run LaTeX in response to package warnings. (Rob Managan) ........ r2531 | stevenknight | 2007-12-14 07:14:31 -0800 (Fri, 14 Dec 2007) | 3 lines Refactor the max_drift logic around fetching stored signatures into its own new method. ........ r2532 | stevenknight | 2007-12-14 07:18:44 -0800 (Fri, 14 Dec 2007) | 3 lines Have get_csig() return the stored content signature if max_drift says it's okay. ........ r2533 | stevenknight | 2007-12-14 18:34:51 -0800 (Fri, 14 Dec 2007) | 2 lines Issue 1859: Support SWIG statements like %module(directors="1"). ........ r2534 | stevenknight | 2007-12-15 03:51:13 -0800 (Sat, 15 Dec 2007) | 3 lines Python 2.1 portability fix w.r.t. "import SCons" and "import SCons.platform.win32" and binding local variables and whatnot. ........ r2535 | stevenknight | 2007-12-15 03:51:56 -0800 (Sat, 15 Dec 2007) | 2 lines Python 1.5 fix: use the -classic flag when invoking SWIG. ........ r2536 | stevenknight | 2007-12-15 06:03:48 -0800 (Sat, 15 Dec 2007) | 4 lines Support subclasses of the new-style str() class as input to Builders and the like. Also speed up all of the Util.is_*() functions when using new-style classes by just using isinstance() internally. ........ r2537 | stevenknight | 2007-12-15 06:35:49 -0800 (Sat, 15 Dec 2007) | 3 lines Issue 1851: Fix being able to use $PDB and $WINDOWS_INSERT_MANIFEST together. (Benoit Belley) ........ r2538 | stevenknight | 2007-12-15 06:59:43 -0800 (Sat, 15 Dec 2007) | 3 lines Handle dangling entries for the Intel C compiler in the Windows registry. (Benoit Belley) ........ r2539 | stevenknight | 2007-12-15 09:51:59 -0800 (Sat, 15 Dec 2007) | 2 lines Reorganize library-related tests into a separate subdirectory. ........ r2540 | stevenknight | 2007-12-15 09:57:29 -0800 (Sat, 15 Dec 2007) | 4 lines Issue 1850: better support for non-standard shared library prefixes and suffixes by stripping all prefixes and suffixes in lists of $SHLIBPREFIXES and $SHLIBSUFFIXES. (Benoit Belley) ........ r2541 | stevenknight | 2007-12-15 18:49:15 -0800 (Sat, 15 Dec 2007) | 2 lines Python 1.5 portability fixes. ........ r2542 | stevenknight | 2007-12-15 19:02:39 -0800 (Sat, 15 Dec 2007) | 3 lines Issue 1768: Have the D language scanner search for .di files as well as .d files. (Jerome Berger) ........ r2543 | stevenknight | 2007-12-16 14:31:40 -0800 (Sun, 16 Dec 2007) | 3 lines Add a find_include_names() method to the Scanner.Classic class to abstract out how included names can be generated by subclasses. (Jerome Berger) ........ r2544 | stevenknight | 2007-12-16 14:31:54 -0800 (Sun, 16 Dec 2007) | 3 lines Add a find_include_names() method to the Scanner.Classic class to abstract out how included names can be generated by subclasses. (Jerome Berger) ........ r2545 | stevenknight | 2007-12-16 15:04:43 -0800 (Sun, 16 Dec 2007) | 3 lines Issue 1860: Support the D scanner returning multiple modules from a single import statement. (Jerome Berger) ........ r2546 | stevenknight | 2007-12-16 17:41:17 -0800 (Sun, 16 Dec 2007) | 3 lines Issue 1861: Fix the ability to #include a file (or search other $*PATH variables) that has an absoluate path. ........ r2547 | stevenknight | 2007-12-18 08:09:59 -0800 (Tue, 18 Dec 2007) | 2 lines Replace uses of "is_List() or is_Tuple()" with is_Sequence(). ........ r2548 | stevenknight | 2007-12-18 08:13:14 -0800 (Tue, 18 Dec 2007) | 2 lines Report the incorrect value in assertions. ........ r2549 | stevenknight | 2007-12-19 07:58:56 -0800 (Wed, 19 Dec 2007) | 3 lines Fix handling #includes of absolute path names when the path doesn't exist (implicitly, because it's #ifdef'ed out). ........ r2550 | stevenknight | 2007-12-19 08:29:24 -0800 (Wed, 19 Dec 2007) | 4 lines Fix test path examination when the temporary directory location is redirected via symlinks (e.g. /usr/tmp -> /var/tmp on Red Hat). (Benoit Belley) ........ r2551 | stevenknight | 2007-12-19 08:30:17 -0800 (Wed, 19 Dec 2007) | 2 lines Fix scons-time path reporting when symlinks are involved. (Benoit Belley) ........ r2552 | stevenknight | 2007-12-19 22:51:18 -0800 (Wed, 19 Dec 2007) | 4 lines Issue 1855: Reduce the worker thread stack size to a default of 256 Kbytes. Add a --stack-size= command-line option, also configurable via SetOption('stack_size'). (Benoit Belley) ........ r2553 | stevenknight | 2007-12-20 18:25:50 -0800 (Thu, 20 Dec 2007) | 2 lines Skip this test if SWIG isn't installed. ........ r2554 | stevenknight | 2007-12-20 18:26:21 -0800 (Thu, 20 Dec 2007) | 2 lines Accomodate slightly different permissions errors on Ubuntu Gutsy. ........ r2555 | stevenknight | 2007-12-21 02:12:09 -0800 (Fri, 21 Dec 2007) | 3 lines Fix a Python 2.2 quirk in the reported file name ("<string>") when encountering a SyntaxError in a SConstruct file. ........ r2556 | stevenknight | 2007-12-21 02:12:35 -0800 (Fri, 21 Dec 2007) | 2 lines Enforce order between the build of f1.out and f2.out. ........ r2557 | stevenknight | 2007-12-21 02:12:55 -0800 (Fri, 21 Dec 2007) | 2 lines Don't die if the Python version doesn't have os.path.realpath(). ........ r2558 | stevenknight | 2007-12-21 02:13:19 -0800 (Fri, 21 Dec 2007) | 2 lines Refactor the test/build-errors.py script into separate scripts for each test. ........ r2559 | stevenknight | 2007-12-21 08:08:12 -0800 (Fri, 21 Dec 2007) | 3 lines Issue 1864: Add a CheckDeclaration() call to configure contexts. (David Cournapeau) ........ r2560 | stevenknight | 2007-12-21 08:18:47 -0800 (Fri, 21 Dec 2007) | 2 lines Issue 1865: Improve the CheckTypeSize() code. (David Cournapeau) ........ r2561 | stevenknight | 2007-12-21 08:21:47 -0800 (Fri, 21 Dec 2007) | 2 lines Fix os.path.realpath() handling (a Python 2.1 portability issue). ........ r2562 | stevenknight | 2007-12-21 14:08:39 -0800 (Fri, 21 Dec 2007) | 2 lines Split CPPDEFINES.py into separate sub-test scripts. ........ r2563 | stevenknight | 2007-12-21 15:56:26 -0800 (Fri, 21 Dec 2007) | 6 lines Support proper expansion of construction variables containing lists within expansions like $CPPPATH. Change env.subst() to return a list, not a joined string, when the input is a list. (Konstantin Bozhikov) ........ r2564 | stevenknight | 2007-12-22 04:15:11 -0800 (Sat, 22 Dec 2007) | 2 lines Normalize the ModDate field when comparing generated PDF files. ........ r2565 | stevenknight | 2007-12-22 22:01:45 -0800 (Sat, 22 Dec 2007) | 5 lines Java test refactoring to commonize construction environment initialization and searching for javac / javah / jar / rmic. Don't look for *_Skel.class files to be created by Java 1.[56]. Minor Java code changes to deal with compiler warnings. ........ r2566 | stevenknight | 2007-12-23 05:20:45 -0800 (Sun, 23 Dec 2007) | 2 lines Don't still look for *_Skel.class files. ........ r2567 | stevenknight | 2007-12-23 07:30:36 -0800 (Sun, 23 Dec 2007) | 5 lines Fix Intel C compiler issues: Issue 1863: Fix failure to match /opt/intel_cc_* directories. (Benoit Belley) Issue 1866: Fix topdir when the version isn't specified. (Jonas Olsson) Issue 1867: Fix use of network licenses. (Jonas Olsson) ........ r2573 | stevenknight | 2008-01-01 09:59:16 -0800 (Tue, 01 Jan 2008) | 3 lines Add asynchronous subprocess communication via new start() and finish() methods. ........ r2574 | stevenknight | 2008-01-01 10:02:26 -0800 (Tue, 01 Jan 2008) | 4 lines Minor code cleanup: attach the version string to the options parser object, instead of passing it in to deal with the lack of nested scopes in Python 1.5.2. ........ r2575 | stevenknight | 2008-01-01 10:08:46 -0800 (Tue, 01 Jan 2008) | 4 lines Rename the CacheDir class and let the name CacheDir be a variable that can be reset at will, depending on whether CacheDir() support is enabled or disabled at any particular time. ........ r2576 | stevenknight | 2008-01-01 10:14:58 -0800 (Tue, 01 Jan 2008) | 2 lines Restore the Node.del_binfo() method and its call in Node.clear(). ........ r2577 | stevenknight | 2008-01-02 07:51:25 -0800 (Wed, 02 Jan 2008) | 6 lines Refactor CacheDir support (again) for --interactive mode. Delay effects of --cache-* settings until they're needed by getting rid of the Null() object pattern and the functional programming idiom of replacing the CacheDebug method. Have the Environment.CacheDir() method just record the path for later instantiation. ........ r2578 | stevenknight | 2008-01-02 18:48:12 -0800 (Wed, 02 Jan 2008) | 3 lines Issue 1657: Add a --interactive option to create a command-line interpreter for re-building targets without re-reading SConscript files. ........ r2579 | stevenknight | 2008-01-02 21:54:38 -0800 (Wed, 02 Jan 2008) | 2 lines Python 1.5.2 portability fix (no use of +=). ........ r2580 | stevenknight | 2008-01-02 21:54:47 -0800 (Wed, 02 Jan 2008) | 3 lines Use a regular expression to avoid having to match a specific MD5 checksum value in the --cache-debug output. ........ r2581 | stevenknight | 2008-01-02 21:54:59 -0800 (Wed, 02 Jan 2008) | 4 lines Don't bother looking for shlex.split(), since our compatibility layer provides it in older Python version. Make the compatibility version of shlex.split() not treat '.' as a token separator. ........ r2582 | stevenknight | 2008-01-02 21:56:15 -0800 (Wed, 02 Jan 2008) | 3 lines Python 1.5.2 portability fixes: no list comprehensions, no nested scopes, no "for x in" a dictionary. ........ r2583 | stevenknight | 2008-01-03 07:39:59 -0800 (Thu, 03 Jan 2008) | 3 lines Fix a left-over use of a string method. Fix printing --interactive help text, which I outright broke last checkin. ........ r2584 | stevenknight | 2008-01-03 07:58:56 -0800 (Thu, 03 Jan 2008) | 4 lines Import the vanilla Python2.5 shlex module, which we'll use as a basis for retrofitting to old Python versions to provide shlex.split() functionality. ........ r2585 | stevenknight | 2008-01-03 08:01:02 -0800 (Thu, 03 Jan 2008) | 3 lines Modifications to the vanilla Python 2.5 shlex module to make it work back to Python 1.5. ........ r2586 | stevenknight | 2008-01-03 08:04:31 -0800 (Thu, 03 Jan 2008) | 3 lines Use the new shlex compatibility module if we're using an old version of Python with a native shlex module that has no shlex.split() function. ........ r2587 | stevenknight | 2008-01-03 09:31:15 -0800 (Thu, 03 Jan 2008) | 3 lines Fix the ParseFlags() unit test now that we have a real shlex.split() function even on earlier Python versions. ........ r2588 | stevenknight | 2008-01-06 04:52:05 -0800 (Sun, 06 Jan 2008) | 3 lines Add compat/_scons_shlex.py to exception lists for __copyright__ and __revision__ strings. ........ r2589 | stevenknight | 2008-01-06 06:32:07 -0800 (Sun, 06 Jan 2008) | 2 lines Remove leftover debug print. ........ r2590 | stevenknight | 2008-01-06 07:35:46 -0800 (Sun, 06 Jan 2008) | 3 lines Change the test to work by wrapping the public .__call__() method of the C scanner, instead of the internal .scan() method. ........ r2591 | stevenknight | 2008-01-06 07:39:12 -0800 (Sun, 06 Jan 2008) | 3 lines Use the public CScan.path() method, not the internal CScan.path_function attribute. ........ r2592 | stevenknight | 2008-01-07 02:55:53 -0800 (Mon, 07 Jan 2008) | 2 lines Use a tuple instead of a list for the cpp module path(s). ........ r2593 | stevenknight | 2008-01-07 03:10:28 -0800 (Mon, 07 Jan 2008) | 2 lines Don't die if a macro function expands to a non-string (an integer). ........ r2594 | stevenknight | 2008-01-07 03:29:12 -0800 (Mon, 07 Jan 2008) | 3 lines Python 1.5 throws TypeError, not AttributeError if you try to string.split() a non-string value. ........ r2595 | stevenknight | 2008-01-07 03:30:18 -0800 (Mon, 07 Jan 2008) | 3 lines Reduce duplicate execution of individual test_*() unit test methods by eliminating duplicates (if the set() type is avaiable). ........ r2596 | stevenknight | 2008-01-07 06:57:30 -0800 (Mon, 07 Jan 2008) | 6 lines Add a basic test of in-line #include handling. Sort the test names. Don't os.path.join() the directory name if we find the file in the current directory. Use os.curdir instead of hard-coding '.' as the current directory. ........ r2597 | stevenknight | 2008-01-07 06:59:29 -0800 (Mon, 07 Jan 2008) | 3 lines Read files with a new .read_file() method, so it can be overridden by subclasses. ........ r2598 | stevenknight | 2008-01-07 17:59:50 -0800 (Mon, 07 Jan 2008) | 6 lines Record the name of the file currently being processed. Make the public API (the .__call__() method) passing in a file name to be opened, and have it call a new, separate .process_contents() method (the old .__call__() method) for handling in-memory strings. ........ r2599 | stevenknight | 2008-01-07 20:03:18 -0800 (Mon, 07 Jan 2008) | 3 lines Make the test failure informative when we don't find the includes we expect by printing the expected string and actual output. ........ r2600 | stevenknight | 2008-01-07 20:24:21 -0800 (Mon, 07 Jan 2008) | 2 lines Handle no white space after #include (e.g. #include<foo.h>). ........ r2601 | stevenknight | 2008-01-07 21:01:27 -0800 (Mon, 07 Jan 2008) | 4 lines Fixes for older Python versions: No tempfile.mktemp(prefix=) argument. No string methods. ........ r2602 | stevenknight | 2008-01-08 20:57:30 -0800 (Tue, 08 Jan 2008) | 3 lines Fix command-line editing of --interactive mode with the readline module by only changing sys.stdout to our Unbuffered class if it isn't a tty. ........ r2603 | stevenknight | 2008-01-08 22:12:20 -0800 (Tue, 08 Jan 2008) | 4 lines Fix the --interactive "build" command with no targets: build the specified Default() targets; issue an error message but don't exit if Default(None) is explicity specified. ........ r2604 | stevenknight | 2008-01-09 05:00:36 -0800 (Wed, 09 Jan 2008) | 9 lines Improve Python functions used as actions by incorporating into their build signatures: - literal values referenced by the byte code. - values of default arguments - code of nested functions - values of variables captured by closures - names of referenced global variables and functions (Benoit Belley) ........ r2605 | stevenknight | 2008-01-09 06:39:03 -0800 (Wed, 09 Jan 2008) | 4 lines Add a Configure.Define() method for adding arbitrary #define lines to generated configure header files. (David Cournapeau) ........ r2606 | stevenknight | 2008-01-09 07:33:21 -0800 (Wed, 09 Jan 2008) | 4 lines Issue 1858: Fix the closing message when --clean and --keep-going are both used so it only reports errors if some actually occurred. (Benoit Belley) ........ r2607 | stevenknight | 2008-01-09 07:51:55 -0800 (Wed, 09 Jan 2008) | 3 lines Issue 1843: Add a gfortran Tool module for the GNU F95/F2003 compiler. (David Cournapeau) ........ r2608 | stevenknight | 2008-01-09 09:31:15 -0800 (Wed, 09 Jan 2008) | 4 lines Issue 1733: If $JARCHDIR isn't set explicitly, use the .java_classdir attribute that was set when the Java() Builder built the .class files. (Jan Nijtmans) ........ r2609 | stevenknight | 2008-01-09 11:27:28 -0800 (Wed, 09 Jan 2008) | 4 lines Allow Scanner.FindPathDirs objects to not take a dir= keyword argument when called. (The code already detects that and uses the current directory if necessary.) ........ r2610 | stevenknight | 2008-01-09 12:23:26 -0800 (Wed, 09 Jan 2008) | 3 lines Allow subclass overrides of results-handling by the addition of new initialize_result() and finalize_result() methods. ........ r2611 | stevenknight | 2008-01-09 14:49:50 -0800 (Wed, 09 Jan 2008) | 6 lines Capture new C Scanner glue code that knows how to use $CPPDEFINES to evaluate CPP #if/#ifdef/#elif/#else lines. Currently disabled (including the test script that validates the behavior) while we look for the right way to let users configure the feature, and work on performance issues with its O(N*M) algorithm. ........ r2612 | stevenknight | 2008-01-24 20:42:57 -0800 (Thu, 24 Jan 2008) | 3 lines Fix regular expression comparisons on Windows by escaping the \ path separators. ........ r2613 | stevenknight | 2008-01-24 20:49:04 -0800 (Thu, 24 Jan 2008) | 3 lines Rename a created stub script from "cmd.py" so it doesn't mistakenly get imported by the "import cmd" statement in Script/Interactive.py. ........ r2614 | stevenknight | 2008-01-24 20:56:05 -0800 (Thu, 24 Jan 2008) | 4 lines Fix a race condition between the actions executed by the worker threads by having the dependent action print its own execution line, and telling SCons to treat it silently (strfunction=None). ........ r2615 | stevenknight | 2008-01-24 20:59:03 -0800 (Thu, 24 Jan 2008) | 2 lines Remove left-over commented-out lines. ........ r2616 | stevenknight | 2008-01-24 21:59:49 -0800 (Thu, 24 Jan 2008) | 7 lines Windows portability in --interactive mode and its tests: Quote target names that may have spaces in them. Use the .exe suffix on a generated executable. Use the subprocess .wait() method to get the subprocess exit status when shelling out on Windows. Use an Unbuffered object for stderr (when it's not a tty). ........ r2617 | stevenknight | 2008-01-24 22:14:49 -0800 (Thu, 24 Jan 2008) | 3 lines Issue 1886: Fix the ability to build Aliases in --interactive mode. (Gary Oberbrunner) ........ r2618 | stevenknight | 2008-01-24 22:33:29 -0800 (Thu, 24 Jan 2008) | 3 lines Issue 1886: Handle Python versions that throw TypeError when they can't pickle a nested function. (Gary Oberbrunner) ........ r2619 | stevenknight | 2008-01-24 22:38:44 -0800 (Thu, 24 Jan 2008) | 3 lines Fix the LoadableModule.py test when run on Intel Macs (look for the string i386 in the file output, in addition to ppc). ........ r2620 | stevenknight | 2008-01-25 06:50:43 -0800 (Fri, 25 Jan 2008) | 4 lines Issue 1892: use "link" instead of "gnulink" for the Mac tool chain, since it doesn't understand the -rpath option and can't use $RPATH. (David Cournapeau) ........ r2621 | stevenknight | 2008-01-25 07:51:56 -0800 (Fri, 25 Jan 2008) | 2 lines Issue 1893: add Intel C compiler support on Mac OS X. (Benoit Belley) ........ r2622 | stevenknight | 2008-01-25 21:48:16 -0800 (Fri, 25 Jan 2008) | 2 lines Fix how we handle falling back to timestamps when no md5.py module exists. ........ r2623 | stevenknight | 2008-01-26 16:55:56 -0800 (Sat, 26 Jan 2008) | 5 lines Work around a metaclass / new.instancemethod() bug in base Python 2.2 by disallowing --debug=memoizer functionality if Python can't handle the Memoizer initialization (much like we do for earlier Python versions that don't have metaclasses at all). ........ r2624 | stevenknight | 2008-01-26 18:22:14 -0800 (Sat, 26 Jan 2008) | 4 lines Fix CacheDir by simplifying how the NullEnvironment hands back something that looks enough like a CacheDir object that the rest of the code doesn't require special handling. ........ r2625 | stevenknight | 2008-01-26 20:56:17 -0800 (Sat, 26 Jan 2008) | 2 lines Have the "scons-time time" subcommand handle empty files gracefully. ........ r2626 | stevenknight | 2008-01-26 20:57:21 -0800 (Sat, 26 Jan 2008) | 3 lines Add a Trace() statement to the Node.changed() method if the dependency lists are different lengths. ........ r2627 | stevenknight | 2008-01-26 21:30:59 -0800 (Sat, 26 Jan 2008) | 3 lines Have the "scons-time time --which" subcommand handle files that don't contain the requested results ........ r2628 | stevenknight | 2008-01-26 21:52:51 -0800 (Sat, 26 Jan 2008) | 2 lines Fix the ability to draw vertical bars with --fmt gnuplot option. ........ r2629 | stevenknight | 2008-01-26 22:23:10 -0800 (Sat, 26 Jan 2008) | 3 lines Allow "scons-time run" to copy non-archive files for timing. Document the archive_list config file variable. ........ r2630 | stevenknight | 2008-01-27 10:38:11 -0800 (Sun, 27 Jan 2008) | 3 lines Use the maximum Y value, not the maximum X value, as the top Y endpoint of a vertical bar drawn with --fmt=gnuplot. ........ r2631 | stevenknight | 2008-01-27 12:05:40 -0800 (Sun, 27 Jan 2008) | 2 lines Make scons-time more robust when handling log files that have no results. ........ r2632 | stevenknight | 2008-01-27 12:49:02 -0800 (Sun, 27 Jan 2008) | 2 lines Rotate label positions so they don't overwrite each other. ........ r2633 | stevenknight | 2008-01-27 16:21:17 -0800 (Sun, 27 Jan 2008) | 2 lines Extend vertical bars to graph top, not maximum X value. ........ r2634 | stevenknight | 2008-01-27 18:08:19 -0800 (Sun, 27 Jan 2008) | 2 lines Capture three configurations for timing various aspects of SCons. ........ r2635 | stevenknight | 2008-01-28 04:55:12 -0800 (Mon, 28 Jan 2008) | 2 lines Fix jar calls to use "tf" instead of "-t -f" for compatibility with Sun. ........ r2636 | stevenknight | 2008-01-28 12:49:58 -0800 (Mon, 28 Jan 2008) | 6 lines Refactor cut-and-paste tempdir_re() function into a common method in QMTest/TestSCons_time.py. In the refactored code, fix typo of os.path.relpath() where we meant os.path.realpath(), so we follow the /tmp -> /private/tmp symlink on Mac OS X. ........ r2637 | stevenknight | 2008-01-28 15:18:14 -0800 (Mon, 28 Jan 2008) | 5 lines Apple portability in the test for explicit "No such file" error messages from trying to fork()/exec() a non-existent file name. Refactor the tests for (non-)expected output in stderr so they're informative if they fail. ........ r2638 | stevenknight | 2008-01-28 17:54:29 -0800 (Mon, 28 Jan 2008) | 3 lines Make the test output deterministic by making the InstallAs() targets (file[23].out) depend on the Install() target (file1.out). ........ r2639 | stevenknight | 2008-01-28 21:37:38 -0800 (Mon, 28 Jan 2008) | 4 lines On Mac OS X, add -w to LINKFLAGS to suppress warnings about the directories we specify as -L arguments which don't actually exist. We just want to make sure that the right directory names show up. ........ r2640 | stevenknight | 2008-01-28 21:38:36 -0800 (Mon, 28 Jan 2008) | 3 lines On Mac OS X, the generated include file for C++ just tacks ".h" on the end of the generated .cpp file name. Define $YACCHXXFILESUFFIX accordingly. ........ r2641 | stevenknight | 2008-01-29 04:56:18 -0800 (Tue, 29 Jan 2008) | 3 lines Add the src/CHANGES.txt for the previous change (Mac OS X bison behavior). Add a "bison" application entity to the DocBook infrastructure. ........ r2642 | stevenknight | 2008-01-30 05:09:02 -0800 (Wed, 30 Jan 2008) | 5 lines Improve QT tests for Mac OS X: More general regular expression match for a "Generated moc file" warning. Copy libmyqt.dylib to the same directory as the "aaa" executable so it's found when we run it. ........ r2643 | stevenknight | 2008-01-30 05:19:23 -0800 (Wed, 30 Jan 2008) | 2 lines Skip the test of Java handling SWIG dependencies if swig isn't installed. ........ r2644 | stevenknight | 2008-01-30 06:44:30 -0800 (Wed, 30 Jan 2008) | 2 lines Remove left-over print statement. ........ r2645 | stevenknight | 2008-01-30 06:52:54 -0800 (Wed, 30 Jan 2008) | 2 lines Mac OS X fix: use .dylib, not .so, in the list of "weird suffixes" we test. ........
Diffstat (limited to 'test/Java')
-rw-r--r--test/Java/JAR.py20
-rw-r--r--test/Java/JARCHDIR.py17
-rw-r--r--test/Java/JARFLAGS.py23
-rw-r--r--test/Java/JAVABOOTCLASSPATH.py17
-rw-r--r--test/Java/JAVACFLAGS.py9
-rw-r--r--test/Java/JAVACLASSPATH.py17
-rw-r--r--test/Java/JAVAH.py25
-rw-r--r--test/Java/JAVASOURCEPATH.py9
-rw-r--r--test/Java/Java-1.4.py33
-rw-r--r--test/Java/Java-1.5.py16
-rw-r--r--test/Java/Java-1.6.py16
-rw-r--r--test/Java/RMIC.py40
-rw-r--r--test/Java/RMICCOM.py6
-rw-r--r--test/Java/RMICCOMSTR.py6
-rw-r--r--test/Java/multi-step.py18
-rw-r--r--test/Java/no-JARCHDIR.py122
-rw-r--r--test/Java/source-files.py9
-rw-r--r--test/Java/swig-dependencies.py29
18 files changed, 205 insertions, 227 deletions
diff --git a/test/Java/JAR.py b/test/Java/JAR.py
index f0951c6..ee552f4 100644
--- a/test/Java/JAR.py
+++ b/test/Java/JAR.py
@@ -120,21 +120,11 @@ test.run(arguments='classes.jar')
test.must_match('classes.jar',
'cvfm classes.jar foo.mf -C testdir bar.class\n')
-ENV = test.java_ENV()
-
-if test.detect_tool('javac', ENV=ENV):
- where_javac = test.detect('JAVAC', 'javac', ENV=ENV)
-else:
- where_javac = test.where_is('javac')
-if not where_javac:
- test.skip_test("Could not find Java javac, skipping test(s).\n")
-
-if test.detect_tool('jar', ENV=ENV):
- where_jar = test.detect('JAR', 'jar', ENV=ENV)
-else:
- where_jar = test.where_is('jar')
-if not where_jar:
- test.skip_test("Could not find Java jar, skipping test(s).\n")
+
+
+where_javac, java_version = test.java_where_javac()
+where_jar = test.java_where_jar()
+
test.write("wrapper.py", """\
diff --git a/test/Java/JARCHDIR.py b/test/Java/JARCHDIR.py
index f7d9fca..a3f2ec4 100644
--- a/test/Java/JARCHDIR.py
+++ b/test/Java/JARCHDIR.py
@@ -40,21 +40,8 @@ import TestSCons
test = TestSCons.TestSCons()
-ENV = test.java_ENV()
-
-if test.detect_tool('javac', ENV=ENV):
- where_javac = test.detect('JAVAC', 'javac', ENV=ENV)
-else:
- where_javac = test.where_is('javac')
-if not where_javac:
- test.skip_test("Could not find Java javac, skipping test(s).\n")
-
-if test.detect_tool('jar', ENV=ENV):
- where_jar = test.detect('JAR', 'jar', ENV=ENV)
-else:
- where_jar = test.where_is('jar')
-if not where_jar:
- test.skip_test("Could not find Java jar, skipping test(s).\n")
+where_javac, java_version = test.java_where_javac()
+where_jar = test.java_where_jar()
diff --git a/test/Java/JARFLAGS.py b/test/Java/JARFLAGS.py
index 3939d98..03a222b 100644
--- a/test/Java/JARFLAGS.py
+++ b/test/Java/JARFLAGS.py
@@ -33,21 +33,10 @@ test = TestSCons.TestSCons()
test.subdir('src')
-ENV = test.java_ENV()
-
-if test.detect_tool('javac', ENV=ENV):
- where_javac = test.detect('JAVAC', 'javac', ENV=ENV)
-else:
- where_javac = test.where_is('javac')
-if not where_javac:
- test.skip_test("Could not find Java javac, skipping test(s).\n")
-
-if test.detect_tool('jar', ENV=ENV):
- where_jar = test.detect('JAR', 'jar', ENV=ENV)
-else:
- where_jar = test.where_is('jar')
-if not where_jar:
- test.skip_test("Could not find Java jar, skipping test(s).\n")
+where_javac, java_version = test.java_where_javac()
+where_jar = test.java_where_jar()
+
+
test.write('SConstruct', """
env = Environment(tools = ['javac', 'jar'],
@@ -75,9 +64,9 @@ public class Example1
expect = test.wrap_stdout("""\
%(where_javac)s -d classes -sourcepath src src/Example1\.java
-%(where_jar)s cvf test.jar classes/src/Example1\.class
+%(where_jar)s cvf test.jar -C classes src/Example1\.class
.*
-adding: classes/src/Example1\.class.*
+adding: src/Example1\.class.*
""" % locals())
expect = string.replace(expect, '/', os.sep)
diff --git a/test/Java/JAVABOOTCLASSPATH.py b/test/Java/JAVABOOTCLASSPATH.py
index 7723224..5962b94 100644
--- a/test/Java/JAVABOOTCLASSPATH.py
+++ b/test/Java/JAVABOOTCLASSPATH.py
@@ -38,21 +38,8 @@ _python_ = TestSCons._python_
test = TestSCons.TestSCons()
-ENV = test.java_ENV()
-
-if test.detect_tool('javac', ENV=ENV):
- where_javac = test.detect('JAVAC', 'javac', ENV=ENV)
-else:
- where_javac = test.where_is('javac')
-if not where_javac:
- test.skip_test("Could not find Java javac, skipping test(s).\n")
-
-if test.detect_tool('javah', ENV=ENV):
- where_javah = test.detect('JAVAH', 'javah', ENV=ENV)
-else:
- where_javah = test.where_is('javah')
-if not where_javah:
- test.skip_test("Could not find Java javah, skipping test(s).\n")
+where_javac, java_version = test.java_where_javac()
+where_javah = test.java_where_javah()
test.write('SConstruct', """
env = Environment(tools = ['javac', 'javah'],
diff --git a/test/Java/JAVACFLAGS.py b/test/Java/JAVACFLAGS.py
index 045fb7b..e287054 100644
--- a/test/Java/JAVACFLAGS.py
+++ b/test/Java/JAVACFLAGS.py
@@ -31,14 +31,7 @@ import TestSCons
test = TestSCons.TestSCons()
-ENV = test.java_ENV()
-
-if test.detect_tool('javac', ENV=ENV):
- where_javac = test.detect('JAVAC', 'javac', ENV=ENV)
-else:
- where_javac = test.where_is('javac')
-if not where_javac:
- test.skip_test("Could not find Java javac, skipping test(s).\n")
+where_javac, java_version = test.java_where_javac()
test.subdir('src')
diff --git a/test/Java/JAVACLASSPATH.py b/test/Java/JAVACLASSPATH.py
index 0ae7dea..11f7c2c 100644
--- a/test/Java/JAVACLASSPATH.py
+++ b/test/Java/JAVACLASSPATH.py
@@ -36,21 +36,8 @@ _python_ = TestSCons._python_
test = TestSCons.TestSCons()
-ENV = test.java_ENV()
-
-if test.detect_tool('javac', ENV=ENV):
- where_javac = test.detect('JAVAC', 'javac', ENV=ENV)
-else:
- where_javac = test.where_is('javac')
-if not where_javac:
- test.skip_test("Could not find Java javac, skipping test(s).\n")
-
-if test.detect_tool('javah', ENV=ENV):
- where_javah = test.detect('JAVAH', 'javah', ENV=ENV)
-else:
- where_javah = test.where_is('javah')
-if not where_javah:
- test.skip_test("Could not find Java javah, skipping test(s).\n")
+where_javac, java_version = test.java_where_javac()
+where_javah = test.java_where_javah()
test.write('SConstruct', """
env = Environment(tools = ['javac', 'javah'],
diff --git a/test/Java/JAVAH.py b/test/Java/JAVAH.py
index ecd3737..95abd33 100644
--- a/test/Java/JAVAH.py
+++ b/test/Java/JAVAH.py
@@ -24,9 +24,9 @@
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
-import os
+import os.path
import string
-import sys
+
import TestSCons
_python_ = TestSCons._python_
@@ -95,21 +95,11 @@ line 3
-ENV = test.java_ENV()
-
-if test.detect_tool('javac', ENV=ENV):
- where_javac = test.detect('JAVAC', 'javac', ENV=ENV)
-else:
- where_javac = test.where_is('javac')
-if not where_javac:
- test.skip_test("Could not find Java javac, skipping test(s).\n")
+where_javac, java_version = test.java_where_javac()
+where_javah = test.java_where_javah()
-if test.detect_tool('javah', ENV=ENV):
- where_javah = test.detect('JAVAH', 'javah', ENV=ENV)
-else:
- where_javah = test.where_is('javah')
-if not where_javah:
- test.skip_test("Could not find Java javah, skipping test(s).\n")
+if java_version:
+ java_version = repr(java_version)
@@ -125,6 +115,9 @@ test.write('SConstruct', """
foo = Environment(tools = ['javac', 'javah', 'install'],
JAVAC = r'%(where_javac)s',
JAVAH = r'%(where_javah)s')
+jv = %(java_version)s
+if jv:
+ foo['JAVAVERSION'] = jv
javah = foo.Dictionary('JAVAH')
bar = foo.Clone(JAVAH = r'%(_python_)s wrapper.py ' + javah)
foo.Java(target = 'class1', source = 'com/sub/foo')
diff --git a/test/Java/JAVASOURCEPATH.py b/test/Java/JAVASOURCEPATH.py
index 069e228..87e90ad 100644
--- a/test/Java/JAVASOURCEPATH.py
+++ b/test/Java/JAVASOURCEPATH.py
@@ -36,14 +36,7 @@ _python_ = TestSCons._python_
test = TestSCons.TestSCons()
-ENV = test.java_ENV()
-
-if test.detect_tool('javac', ENV=ENV):
- where_javac = test.detect('JAVAC', 'javac', ENV=ENV)
-else:
- where_javac = test.where_is('javac')
-if not where_javac:
- test.skip_test("Could not find Java javac, skipping test(s).\n")
+where_javac, java_version = test.java_where_javac()
test.write('SConstruct', """
env = Environment(tools = ['javac', 'javah'],
diff --git a/test/Java/Java-1.4.py b/test/Java/Java-1.4.py
index 3d3d47a..3c0e1ed 100644
--- a/test/Java/Java-1.4.py
+++ b/test/Java/Java-1.4.py
@@ -38,14 +38,7 @@ _python_ = TestSCons._python_
test = TestSCons.TestSCons()
-ENV = test.java_ENV()
-
-if test.detect_tool('javac', ENV=ENV):
- where_javac = test.detect('JAVAC', 'javac', ENV=ENV)
-else:
- where_javac = test.where_is('javac')
-if not where_javac:
- test.skip_test("Could not find Java javac, skipping test(s).\n")
+where_javac, java_version = test.java_where_javac('1.4')
@@ -234,10 +227,10 @@ public class NestedExample
{
public NestedExample()
{
- Thread t = new Thread() {
+ new Thread() {
public void start()
{
- Thread t = new Thread() {
+ new Thread() {
public void start()
{
try {Thread.sleep(200);}
@@ -256,7 +249,7 @@ public class NestedExample
public static void main(String argv[])
{
- NestedExample e = new NestedExample();
+ new NestedExample();
}
}
""")
@@ -268,7 +261,7 @@ public class NestedExample
test.write(['src5', 'TestSCons.java'], """\
class TestSCons {
public static void main(String[] args) {
- Foo[] fooArray = new Foo[] { new Foo() };
+ new Foo();
}
}
@@ -355,12 +348,16 @@ def classes_must_match(dir, expect):
global failed
got = get_class_files(test.workpath(dir))
if expect != got:
- sys.stderr.write("Expected the following class files in '%s':\n" % dir)
- for c in expect:
- sys.stderr.write(' %s\n' % c)
- sys.stderr.write("Got the following class files in '%s':\n" % dir)
- for c in got:
- sys.stderr.write(' %s\n' % c)
+ missing = set(expect) - set(got)
+ if missing:
+ sys.stderr.write("Missing the following class files from '%s':\n" % dir)
+ for c in missing:
+ sys.stderr.write(' %s\n' % c)
+ unexpected = set(got) - set(expect)
+ if unexpected:
+ sys.stderr.write("Found the following unexpected class files in '%s':\n" % dir)
+ for c in unexpected:
+ sys.stderr.write(' %s\n' % c)
failed = 1
def classes_must_not_exist(dir, expect):
diff --git a/test/Java/Java-1.5.py b/test/Java/Java-1.5.py
index 4ac3d96..f6d93c7 100644
--- a/test/Java/Java-1.5.py
+++ b/test/Java/Java-1.5.py
@@ -38,15 +38,7 @@ _python_ = TestSCons._python_
test = TestSCons.TestSCons()
-ENV = test.java_ENV()
-ENV['PATH'] = '/usr/lib/jvm/java-1.5.0-sun-1.5.0.11/bin' + os.pathsep + os.environ['PATH']
-
-if test.detect_tool('javac', ENV=ENV):
- where_javac = test.detect('JAVAC', 'javac', ENV=ENV)
-else:
- where_javac = test.where_is('javac')
-if not where_javac:
- test.skip_test("Could not find Java javac, skipping test(s).\n")
+where_javac, java_version = test.java_where_javac('1.5')
@@ -235,10 +227,10 @@ public class NestedExample
{
public NestedExample()
{
- Thread t = new Thread() {
+ new Thread() {
public void start()
{
- Thread t = new Thread() {
+ new Thread() {
public void start()
{
try {Thread.sleep(200);}
@@ -257,7 +249,7 @@ public class NestedExample
public static void main(String argv[])
{
- NestedExample e = new NestedExample();
+ new NestedExample();
}
}
""")
diff --git a/test/Java/Java-1.6.py b/test/Java/Java-1.6.py
index f2b629a..5bd8e2f 100644
--- a/test/Java/Java-1.6.py
+++ b/test/Java/Java-1.6.py
@@ -38,15 +38,7 @@ _python_ = TestSCons._python_
test = TestSCons.TestSCons()
-ENV = test.java_ENV()
-ENV['PATH'] = '/usr/lib/jvm/java-6-sun-1.6.0.00/bin' + os.pathsep + os.environ['PATH']
-
-if test.detect_tool('javac', ENV=ENV):
- where_javac = test.detect('JAVAC', 'javac', ENV=ENV)
-else:
- where_javac = test.where_is('javac')
-if not where_javac:
- test.skip_test("Could not find Java javac, skipping test(s).\n")
+where_javac, java_version = test.java_where_javac('1.6')
@@ -235,10 +227,10 @@ public class NestedExample
{
public NestedExample()
{
- Thread t = new Thread() {
+ new Thread() {
public void start()
{
- Thread t = new Thread() {
+ new Thread() {
public void start()
{
try {Thread.sleep(200);}
@@ -257,7 +249,7 @@ public class NestedExample
public static void main(String argv[])
{
- NestedExample e = new NestedExample();
+ new NestedExample();
}
}
""")
diff --git a/test/Java/RMIC.py b/test/Java/RMIC.py
index 2ab1804..f9721c2 100644
--- a/test/Java/RMIC.py
+++ b/test/Java/RMIC.py
@@ -92,21 +92,8 @@ line 3
test.fail_test(test.read(['outdir', 'test2.class']) != "test2.JAVA\nline 3\n")
-ENV = test.java_ENV()
-
-if test.detect_tool('javac', ENV=ENV):
- where_javac = test.detect('JAVAC', 'javac', ENV=ENV)
-else:
- where_javac = test.where_is('javac')
-if not where_javac:
- test.skip_test("Could not find Java javac, skipping non-simulated test(s).\n")
-
-if test.detect_tool('rmic', ENV=ENV):
- where_rmic = test.detect('RMIC', 'rmic', ENV=ENV)
-else:
- where_rmic = test.where_is('rmic')
-if not where_rmic:
- test.skip_test("Could not find Java rmic, skipping non-simulated test(s).\n")
+where_javac, java_version = test.java_where_javac()
+where_rmic = test.java_where_rmic()
test.write("wrapper.py", """\
import os
@@ -319,15 +306,20 @@ test.run(arguments = '.')
test.fail_test(test.read('wrapper.out') != "wrapper.py %s -d outdir2 -classpath class2 com.sub.bar.Example3 com.sub.bar.Example4\n" % where_rmic)
-test.fail_test(not os.path.exists(test.workpath('outdir1', 'com', 'sub', 'foo', 'Example1_Skel.class')))
-test.fail_test(not os.path.exists(test.workpath('outdir1', 'com', 'sub', 'foo', 'Example1_Stub.class')))
-test.fail_test(not os.path.exists(test.workpath('outdir1', 'com', 'sub', 'foo', 'Example2_Skel.class')))
-test.fail_test(not os.path.exists(test.workpath('outdir1', 'com', 'sub', 'foo', 'Example2_Stub.class')))
-
-test.fail_test(not os.path.exists(test.workpath('outdir2', 'com', 'sub', 'bar', 'Example3_Skel.class')))
-test.fail_test(not os.path.exists(test.workpath('outdir2', 'com', 'sub', 'bar', 'Example3_Stub.class')))
-test.fail_test(not os.path.exists(test.workpath('outdir2', 'com', 'sub', 'bar', 'Example4_Skel.class')))
-test.fail_test(not os.path.exists(test.workpath('outdir2', 'com', 'sub', 'bar', 'Example4_Stub.class')))
+test.must_exist(test.workpath('outdir1', 'com', 'sub', 'foo', 'Example1_Stub.class'))
+test.must_exist(test.workpath('outdir1', 'com', 'sub', 'foo', 'Example2_Stub.class'))
+test.must_exist(test.workpath('outdir2', 'com', 'sub', 'bar', 'Example3_Stub.class'))
+test.must_exist(test.workpath('outdir2', 'com', 'sub', 'bar', 'Example4_Stub.class'))
+
+# We used to check for _Skel.class files as well, but they're not
+# generated by default starting with Java 1.5, and they apparently
+# haven't been needed for a while. Don't bother looking, even if we're
+# running Java 1.4. If we think they're needed but they don't exist
+# the test.up_to_date() call below will detect it.
+#test.must_exist(test.workpath('outdir1', 'com', 'sub', 'foo', 'Example1_Skel.class'))
+#test.must_exist(test.workpath('outdir1', 'com', 'sub', 'foo', 'Example2_Skel.class'))
+#test.must_exist(test.workpath('outdir2', 'com', 'sub', 'bar', 'Example3_Skel.class'))
+#test.must_exist(test.workpath('outdir2', 'com', 'sub', 'bar', 'Example4_Skel.class'))
test.up_to_date(arguments = '.')
diff --git a/test/Java/RMICCOM.py b/test/Java/RMICCOM.py
index ed5e0d6..e8a5655 100644
--- a/test/Java/RMICCOM.py
+++ b/test/Java/RMICCOM.py
@@ -40,9 +40,9 @@ test.subdir('src')
-out_file1 = os.path.join('out', 'file1', 'class_Skel.class')
-out_file2 = os.path.join('out', 'file2', 'class_Skel.class')
-out_file3 = os.path.join('out', 'file3', 'class_Skel.class')
+out_file1 = os.path.join('out', 'file1', 'class_Stub.class')
+out_file2 = os.path.join('out', 'file2', 'class_Stub.class')
+out_file3 = os.path.join('out', 'file3', 'class_Stub.class')
diff --git a/test/Java/RMICCOMSTR.py b/test/Java/RMICCOMSTR.py
index 5a451eb..a92bac5 100644
--- a/test/Java/RMICCOMSTR.py
+++ b/test/Java/RMICCOMSTR.py
@@ -41,9 +41,9 @@ test.subdir('src')
-out_file1 = os.path.join('out', 'file1', 'class_Skel.class')
-out_file2 = os.path.join('out', 'file2', 'class_Skel.class')
-out_file3 = os.path.join('out', 'file3', 'class_Skel.class')
+out_file1 = os.path.join('out', 'file1', 'class_Stub.class')
+out_file2 = os.path.join('out', 'file2', 'class_Stub.class')
+out_file3 = os.path.join('out', 'file3', 'class_Stub.class')
diff --git a/test/Java/multi-step.py b/test/Java/multi-step.py
index d185b4d..9cac759 100644
--- a/test/Java/multi-step.py
+++ b/test/Java/multi-step.py
@@ -33,22 +33,8 @@ import TestSCons
test = TestSCons.TestSCons()
-# This test requires javac and swig
-ENV = test.java_ENV()
-
-if test.detect_tool('javac', ENV=ENV):
- where_javac = test.detect('JAVAC', 'javac', ENV=ENV)
-else:
- where_javac = test.where_is('javac')
-if not where_javac:
- test.skip_test("Could not find Java javac, skipping test(s).\n")
-
-if test.detect_tool('javah', ENV=ENV):
- where_javah = test.detect('JAVAH', 'javah', ENV=ENV)
-else:
- where_javah = test.where_is('javah')
-if not where_javah:
- test.skip_test("Could not find Java javah, skipping test(s).\n")
+where_javac, java_version = test.java_where_javac()
+where_javah = test.java_where_javah()
swig = test.where_is('swig')
if not swig:
diff --git a/test/Java/no-JARCHDIR.py b/test/Java/no-JARCHDIR.py
new file mode 100644
index 0000000..795689c
--- /dev/null
+++ b/test/Java/no-JARCHDIR.py
@@ -0,0 +1,122 @@
+#!/usr/bin/env python
+#
+# __COPYRIGHT__
+#
+# Permission is hereby granted, free of charge, to any person obtaining
+# a copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the Software, and to
+# permit persons to whom the Software is furnished to do so, subject to
+# the following conditions:
+#
+# The above copyright notice and this permission notice shall be included
+# in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
+# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+
+__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
+
+"""
+Verify the Jar() behavior when we have no JARCHDIR set (it should
+automatically use the classdir that was deduced from the Java() call)
+and when we explicity set it to None (it should not use the Java()
+classdir attribute at all).
+"""
+
+import string
+
+import TestSCons
+
+test = TestSCons.TestSCons()
+
+where_javac, java_version = test.java_where_javac()
+where_jar = test.java_where_jar()
+
+test.subdir('src')
+
+
+
+test.write(['src', 'a.java'], """\
+package foo.bar;
+public class a {}
+""")
+
+test.write(['src', 'b.java'], """\
+package foo.bar;
+public class b {}
+""")
+
+
+
+test.write('SConstruct', """\
+env = Environment(tools = ['javac', 'jar'],
+ JAVAC = r'%(where_javac)s',
+ JAR = r'%(where_jar)s')
+
+jar = env.Jar('x.jar', env.Java(target = 'classes', source = 'src'))
+""" % locals())
+
+test.run(arguments = '.')
+
+
+
+test.run(program = where_jar, arguments = 'tf x.jar')
+
+expect = """\
+foo/bar/a.class
+foo/bar/b.class
+"""
+
+if string.find(test.stdout(), expect) == -1:
+ print "Did not find expected string in standard output."
+ print "Expected =========================================================="
+ print expect
+ print "Output ============================================================"
+ print test.stdout()
+ test.fail_test()
+
+
+
+test.run(arguments = '-c')
+
+
+
+test.write('SConstruct', """\
+env = Environment(tools = ['javac', 'jar'],
+ JAVAC = r'%(where_javac)s',
+ JAR = r'%(where_jar)s',
+ JARCHDIR = None)
+
+jar = env.Jar('x.jar', env.Java(target = 'classes', source = 'src'))
+""" % locals())
+
+test.run(arguments = '.')
+
+
+
+test.run(program = where_jar, arguments = 'tf x.jar')
+
+expect = """\
+classes/foo/bar/a.class
+classes/foo/bar/b.class
+"""
+
+if string.find(test.stdout(), expect) == -1:
+ print "Did not find expected string in standard output."
+ print "Expected =========================================================="
+ print expect
+ print "Output ============================================================"
+ print test.stdout()
+ test.fail_test()
+
+
+
+test.pass_test()
diff --git a/test/Java/source-files.py b/test/Java/source-files.py
index 8d2506f..63d1d92 100644
--- a/test/Java/source-files.py
+++ b/test/Java/source-files.py
@@ -35,14 +35,7 @@ _python_ = TestSCons._python_
test = TestSCons.TestSCons()
-ENV = test.java_ENV()
-
-if test.detect_tool('javac', ENV=ENV):
- where_javac = test.detect('JAVAC', 'javac', ENV=ENV)
-else:
- where_javac = test.where_is('javac')
-if not where_javac:
- test.skip_test("Could not find Java javac, skipping test(s).\n")
+where_javac, java_version = test.java_where_javac()
test.write('SConstruct', """
diff --git a/test/Java/swig-dependencies.py b/test/Java/swig-dependencies.py
index 8df5e09..5477a2d 100644
--- a/test/Java/swig-dependencies.py
+++ b/test/Java/swig-dependencies.py
@@ -34,29 +34,14 @@ import TestSCons
test = TestSCons.TestSCons()
-ENV = test.java_ENV()
-
-if test.detect_tool('javac', ENV=ENV):
- where_javac = test.detect('JAVAC', 'javac', ENV=ENV)
-else:
- where_javac = test.where_is('javac')
-if not where_javac:
- test.skip_test("Could not find Java javac, skipping test(s).\n")
-
-if test.detect_tool('javah', ENV=ENV):
- where_javah = test.detect('JAVAH', 'javah', ENV=ENV)
-else:
- where_javah = test.where_is('javah')
-if not where_javah:
- test.skip_test("Could not find Java javah, skipping test(s).\n")
-
-if test.detect_tool('jar', ENV=ENV):
- where_jar = test.detect('JAR', 'jar', ENV=ENV)
-else:
- where_jar = test.where_is('jar')
-if not where_jar:
- test.skip_test("Could not find Java jar, skipping test(s).\n")
+swig = test.where_is('swig')
+if not swig:
+ test.skip_test('Can not find installed "swig", skipping test.\n')
+
+where_javac, java_version = test.java_where_javac()
+where_javah = test.java_where_javah()
+where_jar = test.java_where_jar()
test.subdir(['foo'],
['java'],