diff options
author | William Deegan <bill@baddogconsulting.com> | 2018-10-01 00:20:50 (GMT) |
---|---|---|
committer | William Deegan <bill@baddogconsulting.com> | 2018-10-01 00:20:50 (GMT) |
commit | b257b48fe5c7006efca86e323836f6b73cb5c359 (patch) | |
tree | 1916ed6ffbb892f0a4489ff11c43ab62899e2b5d | |
parent | 6c916c5723add8bd00f891d1bad165b79696400a (diff) | |
download | SCons-b257b48fe5c7006efca86e323836f6b73cb5c359.zip SCons-b257b48fe5c7006efca86e323836f6b73cb5c359.tar.gz SCons-b257b48fe5c7006efca86e323836f6b73cb5c359.tar.bz2 |
Add test for 1.8. Modularize java tests and move files to a fixture. Change TestCommon's options_arguments to keep passed lists and not join them into a string.
-rw-r--r-- | test/Java/Java-1.6.py | 4 | ||||
-rw-r--r-- | test/Java/Java-1.8.py | 6 | ||||
-rw-r--r-- | test/Java/java_version_image/SConstruct | 2 | ||||
-rw-r--r-- | testing/framework/TestCommon.py | 11 | ||||
-rw-r--r-- | testing/framework/TestSCons.py | 4 |
5 files changed, 21 insertions, 6 deletions
diff --git a/test/Java/Java-1.6.py b/test/Java/Java-1.6.py index f1ca14c..15534b0 100644 --- a/test/Java/Java-1.6.py +++ b/test/Java/Java-1.6.py @@ -43,6 +43,8 @@ javac_path=os.path.dirname(where_javac) test.verbose_set(1) +if ' ' in javac_path: + javac_path ='"%s"'%javac_path java_arguments=["--javac_path=%s"%javac_path,"--java_version=%s"%version] test.run(arguments = ['.']+java_arguments) @@ -125,7 +127,7 @@ test.up_to_date(options=["--debug=explain"]+java_arguments, arguments = '.') test.run(arguments = ['.']+java_arguments) - +\ classes_must_not_exist('class1', expect_1) classes_must_not_exist('class2', expect_2) classes_must_not_exist('class3', expect_3) diff --git a/test/Java/Java-1.8.py b/test/Java/Java-1.8.py index a56c1b0..4ac85ca 100644 --- a/test/Java/Java-1.8.py +++ b/test/Java/Java-1.8.py @@ -24,7 +24,7 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" """ -Test Java compilation with a live Java 1.6 "javac" compiler. +Test Java compilation with a live Java 1.8 "javac" compiler. """ import os @@ -43,6 +43,8 @@ javac_path=os.path.dirname(where_javac) test.verbose_set(1) +if ' ' in javac_path: + javac_path ='"%s"'%javac_path java_arguments=["--javac_path=%s"%javac_path,"--java_version=%s"%version] test.run(arguments = ['.']+java_arguments) @@ -125,7 +127,7 @@ test.up_to_date(options=["--debug=explain"]+java_arguments, arguments = '.') test.run(arguments = ['.']+java_arguments) - +\ classes_must_not_exist('class1', expect_1) classes_must_not_exist('class2', expect_2) classes_must_not_exist('class3', expect_3) diff --git a/test/Java/java_version_image/SConstruct b/test/Java/java_version_image/SConstruct index 6e3b11b..945c864 100644 --- a/test/Java/java_version_image/SConstruct +++ b/test/Java/java_version_image/SConstruct @@ -12,6 +12,8 @@ AddOption('--java_version', type='string') path=GetOption('javac_path') +if path[0] == "'": + path = path[1:-1] version = GetOption('java_version') diff --git a/testing/framework/TestCommon.py b/testing/framework/TestCommon.py index e55b491..012f134 100644 --- a/testing/framework/TestCommon.py +++ b/testing/framework/TestCommon.py @@ -242,11 +242,16 @@ class TestCommon(TestCmd): if options: if arguments is None: return options + + # If not list, then split into lists + # this way we're not losing arguments specified with + # Spaces in quotes. if isinstance(options, str): - options = [options] + options = options.split() if isinstance(arguments, str): - arguments = [arguments] - arguments = ' '.join(options + arguments) + arguments = arguments.split() + arguments = options + arguments + return arguments def must_be_writable(self, *files): diff --git a/testing/framework/TestSCons.py b/testing/framework/TestSCons.py index bf6aabb..5ae6846 100644 --- a/testing/framework/TestSCons.py +++ b/testing/framework/TestSCons.py @@ -418,6 +418,10 @@ class TestSCons(TestCommon): # TestCommon.run(self, *args, **kw) def up_to_date(self, arguments = '.', read_str = "", **kw): + """Asserts that all of the targets listed in arguments is + up to date, but does not make any assumptions on other targets. + This function is most useful in conjunction with the -n option. + """ s = "" for arg in arguments.split(): s = s + "scons: `%s' is up to date.\n" % arg |