From 9035ce35b05670e644b63821a926232f405688ee Mon Sep 17 00:00:00 2001 From: William Deegan Date: Sat, 14 Jan 2017 18:04:31 -0800 Subject: fixes for fortran tests an py3 --- test/Fortran/F03COM.py | 18 +++++++++++++----- test/Fortran/F08COM.py | 16 +++++++++++----- test/Fortran/F77COM.py | 17 ++++++++++++----- test/Fortran/F90COM.py | 20 ++++++++++++++------ test/Fortran/F95COM.py | 18 ++++++++++++------ test/Fortran/FORTRANCOM.py | 15 +++++++++++---- test/Fortran/SHF77COM.py | 16 +++++++++++----- test/Fortran/SHF90COM.py | 19 +++++++++++++------ test/Fortran/SHF95COM.py | 18 ++++++++++++------ test/Fortran/SHFORTRANCOM.py | 14 ++++++++++---- test/M4/M4.py | 8 +++++++- 11 files changed, 126 insertions(+), 53 deletions(-) diff --git a/test/Fortran/F03COM.py b/test/Fortran/F03COM.py index 4a42d22..aaa790c 100644 --- a/test/Fortran/F03COM.py +++ b/test/Fortran/F03COM.py @@ -25,6 +25,9 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" import TestSCons +import sys + +is_windows = (sys.platform == 'win32') _python_ = TestSCons._python_ _exe = TestSCons._exe @@ -76,18 +79,23 @@ test.write('test22.F03', "This is a .F03 file.\n#link\n/*f03pp*/\n") test.run(arguments = '.', stderr = None) test.must_match('test01' + _exe, "This is a .f file.\n") -test.must_match('test02' + _exe, "This is a .F file.\n") test.must_match('test03' + _exe, "This is a .for file.\n") -test.must_match('test04' + _exe, "This is a .FOR file.\n") test.must_match('test05' + _exe, "This is a .ftn file.\n") -test.must_match('test06' + _exe, "This is a .FTN file.\n") test.must_match('test07' + _exe, "This is a .fpp file.\n") test.must_match('test08' + _exe, "This is a .FPP file.\n") test.must_match('test13' + _exe, "This is a .f03 file.\n") -test.must_match('test14' + _exe, "This is a .F03 file.\n") test.must_match('test21' + _exe, "This is a .f03 file.\n") -test.must_match('test22' + _exe, "This is a .F03 file.\n") + +if not is_windows: + # Skip checking files we expect to differ in behavior + # based on file extension case + test.must_match('test02' + _exe, "This is a .F file.\n") + test.must_match('test04' + _exe, "This is a .FOR file.\n") + test.must_match('test06' + _exe, "This is a .FTN file.\n") + test.must_match('test14' + _exe, "This is a .F03 file.\n") + test.must_match('test22' + _exe, "This is a .F03 file.\n") + test.pass_test() diff --git a/test/Fortran/F08COM.py b/test/Fortran/F08COM.py index ba7d64e..f159a53 100644 --- a/test/Fortran/F08COM.py +++ b/test/Fortran/F08COM.py @@ -25,6 +25,9 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" import TestSCons +import sys + +is_windows = ( sys.platform =='win32') _python_ = TestSCons._python_ _exe = TestSCons._exe @@ -67,15 +70,18 @@ test.write('test10.F08', "This is a .F08 file.\n#link\n/*f08pp*/\n") test.run(arguments = '.', stderr = None) test.must_match('test01' + _exe, "This is a .f file.\n") -test.must_match('test02' + _exe, "This is a .F file.\n") test.must_match('test03' + _exe, "This is a .for file.\n") -test.must_match('test04' + _exe, "This is a .FOR file.\n") test.must_match('test05' + _exe, "This is a .ftn file.\n") -test.must_match('test06' + _exe, "This is a .FTN file.\n") test.must_match('test07' + _exe, "This is a .fpp file.\n") -test.must_match('test08' + _exe, "This is a .FPP file.\n") test.must_match('test09' + _exe, "This is a .f08 file.\n") -test.must_match('test10' + _exe, "This is a .F08 file.\n") +if not is_windows: + # Skip checking files we expect to differ in behavior + # based on file extension case + test.must_match('test02' + _exe, "This is a .F file.\n") + test.must_match('test04' + _exe, "This is a .FOR file.\n") + test.must_match('test06' + _exe, "This is a .FTN file.\n") + test.must_match('test08' + _exe, "This is a .FPP file.\n") + test.must_match('test10' + _exe, "This is a .F08 file.\n") test.pass_test() diff --git a/test/Fortran/F77COM.py b/test/Fortran/F77COM.py index e7a3cca..6550d92 100644 --- a/test/Fortran/F77COM.py +++ b/test/Fortran/F77COM.py @@ -25,6 +25,9 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" import TestSCons +import sys + +is_windows = ( sys.platform =='win32') _python_ = TestSCons._python_ _exe = TestSCons._exe @@ -67,15 +70,19 @@ test.write('test10.F77', "This is a .F77 file.\n#link\n/*f77pp*/\n") test.run(arguments = '.', stderr = None) test.must_match('test01' + _exe, "This is a .f file.\n") -test.must_match('test02' + _exe, "This is a .F file.\n") test.must_match('test03' + _exe, "This is a .for file.\n") -test.must_match('test04' + _exe, "This is a .FOR file.\n") test.must_match('test05' + _exe, "This is a .ftn file.\n") -test.must_match('test06' + _exe, "This is a .FTN file.\n") test.must_match('test07' + _exe, "This is a .fpp file.\n") -test.must_match('test08' + _exe, "This is a .FPP file.\n") test.must_match('test09' + _exe, "This is a .f77 file.\n") -test.must_match('test10' + _exe, "This is a .F77 file.\n") + +if not is_windows: + # Skip checking files we expect to differ in behavior + # based on file extension case + test.must_match('test02' + _exe, "This is a .F file.\n") + test.must_match('test04' + _exe, "This is a .FOR file.\n") + test.must_match('test06' + _exe, "This is a .FTN file.\n") + test.must_match('test08' + _exe, "This is a .FPP file.\n") + test.must_match('test10' + _exe, "This is a .F77 file.\n") test.pass_test() diff --git a/test/Fortran/F90COM.py b/test/Fortran/F90COM.py index a4f37c2..180e6b7 100644 --- a/test/Fortran/F90COM.py +++ b/test/Fortran/F90COM.py @@ -25,6 +25,9 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" import TestSCons +import sys + +is_windows = ( sys.platform =='win32') _python_ = TestSCons._python_ _exe = TestSCons._exe @@ -76,18 +79,23 @@ test.write('test22.F90', "This is a .F90 file.\n#link\n/*f90pp*/\n") test.run(arguments = '.', stderr = None) test.must_match('test01' + _exe, "This is a .f file.\n") -test.must_match('test02' + _exe, "This is a .F file.\n") test.must_match('test03' + _exe, "This is a .for file.\n") -test.must_match('test04' + _exe, "This is a .FOR file.\n") test.must_match('test05' + _exe, "This is a .ftn file.\n") -test.must_match('test06' + _exe, "This is a .FTN file.\n") test.must_match('test07' + _exe, "This is a .fpp file.\n") -test.must_match('test08' + _exe, "This is a .FPP file.\n") test.must_match('test11' + _exe, "This is a .f90 file.\n") -test.must_match('test12' + _exe, "This is a .F90 file.\n") test.must_match('test21' + _exe, "This is a .f90 file.\n") -test.must_match('test22' + _exe, "This is a .F90 file.\n") + +if not is_windows: + # Skip checking files we expect to differ in behavior + # based on file extension case + test.must_match('test02' + _exe, "This is a .F file.\n") + test.must_match('test04' + _exe, "This is a .FOR file.\n") + test.must_match('test06' + _exe, "This is a .FTN file.\n") + test.must_match('test08' + _exe, "This is a .FPP file.\n") + test.must_match('test12' + _exe, "This is a .F90 file.\n") + test.must_match('test22' + _exe, "This is a .F90 file.\n") + test.pass_test() diff --git a/test/Fortran/F95COM.py b/test/Fortran/F95COM.py index 32ae594..2d48770 100644 --- a/test/Fortran/F95COM.py +++ b/test/Fortran/F95COM.py @@ -25,6 +25,9 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" import TestSCons +import sys + +is_windows = ( sys.platform =='win32') _python_ = TestSCons._python_ _exe = TestSCons._exe @@ -76,18 +79,21 @@ test.write('test22.F95', "This is a .F95 file.\n#link\n/*f95pp*/\n") test.run(arguments = '.', stderr = None) test.must_match('test01' + _exe, "This is a .f file.\n") -test.must_match('test02' + _exe, "This is a .F file.\n") test.must_match('test03' + _exe, "This is a .for file.\n") -test.must_match('test04' + _exe, "This is a .FOR file.\n") test.must_match('test05' + _exe, "This is a .ftn file.\n") -test.must_match('test06' + _exe, "This is a .FTN file.\n") test.must_match('test07' + _exe, "This is a .fpp file.\n") -test.must_match('test08' + _exe, "This is a .FPP file.\n") test.must_match('test13' + _exe, "This is a .f95 file.\n") -test.must_match('test14' + _exe, "This is a .F95 file.\n") test.must_match('test21' + _exe, "This is a .f95 file.\n") -test.must_match('test22' + _exe, "This is a .F95 file.\n") +if not is_windows: + # Skip checking files we expect to differ in behavior + # based on file extension case + test.must_match('test02' + _exe, "This is a .F file.\n") + test.must_match('test04' + _exe, "This is a .FOR file.\n") + test.must_match('test06' + _exe, "This is a .FTN file.\n") + test.must_match('test08' + _exe, "This is a .FPP file.\n") + test.must_match('test14' + _exe, "This is a .F95 file.\n") + test.must_match('test22' + _exe, "This is a .F95 file.\n") test.pass_test() diff --git a/test/Fortran/FORTRANCOM.py b/test/Fortran/FORTRANCOM.py index a07d427..d3d7e7f 100644 --- a/test/Fortran/FORTRANCOM.py +++ b/test/Fortran/FORTRANCOM.py @@ -25,6 +25,10 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" import TestSCons +import sys + +is_windows = ( sys.platform =='win32') + _python_ = TestSCons._python_ _exe = TestSCons._exe @@ -61,13 +65,16 @@ test.write('test08.FPP', "This is a .FPP file.\n#link\n/*fortranpp*/\n") test.run(arguments = '.', stderr = None) test.must_match('test01' + _exe, "This is a .f file.\n") -test.must_match('test02' + _exe, "This is a .F file.\n") test.must_match('test03' + _exe, "This is a .for file.\n") -test.must_match('test04' + _exe, "This is a .FOR file.\n") test.must_match('test05' + _exe, "This is a .ftn file.\n") -test.must_match('test06' + _exe, "This is a .FTN file.\n") test.must_match('test07' + _exe, "This is a .fpp file.\n") -test.must_match('test08' + _exe, "This is a .FPP file.\n") +if not is_windows: + # Skip checking files we expect to differ in behavior + # based on file extension case + test.must_match('test02' + _exe, "This is a .F file.\n") + test.must_match('test04' + _exe, "This is a .FOR file.\n") + test.must_match('test06' + _exe, "This is a .FTN file.\n") + test.must_match('test08' + _exe, "This is a .FPP file.\n") test.pass_test() diff --git a/test/Fortran/SHF77COM.py b/test/Fortran/SHF77COM.py index 9289fa3..bd3d1e2 100644 --- a/test/Fortran/SHF77COM.py +++ b/test/Fortran/SHF77COM.py @@ -25,6 +25,9 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" import TestSCons +import sys + +is_windows = ( sys.platform =='win32') _python_ = TestSCons._python_ _obj = TestSCons._shobj @@ -65,15 +68,18 @@ test.write('test10.F77', "This is a .F77 file.\n/*f77pp*/\n") test.run(arguments = '.', stderr = None) test.must_match(obj_ + 'test01' + _obj, "This is a .f file.\n") -test.must_match(obj_ + 'test02' + _obj, "This is a .F file.\n") test.must_match(obj_ + 'test03' + _obj, "This is a .for file.\n") -test.must_match(obj_ + 'test04' + _obj, "This is a .FOR file.\n") test.must_match(obj_ + 'test05' + _obj, "This is a .ftn file.\n") -test.must_match(obj_ + 'test06' + _obj, "This is a .FTN file.\n") test.must_match(obj_ + 'test07' + _obj, "This is a .fpp file.\n") -test.must_match(obj_ + 'test08' + _obj, "This is a .FPP file.\n") test.must_match(obj_ + 'test09' + _obj, "This is a .f77 file.\n") -test.must_match(obj_ + 'test10' + _obj, "This is a .F77 file.\n") +if not is_windows: + # Skip checking files we expect to differ in behavior + # based on file extension case + test.must_match(obj_ + 'test02' + _obj, "This is a .F file.\n") + test.must_match(obj_ + 'test04' + _obj, "This is a .FOR file.\n") + test.must_match(obj_ + 'test06' + _obj, "This is a .FTN file.\n") + test.must_match(obj_ + 'test08' + _obj, "This is a .FPP file.\n") + test.must_match(obj_ + 'test10' + _obj, "This is a .F77 file.\n") test.pass_test() diff --git a/test/Fortran/SHF90COM.py b/test/Fortran/SHF90COM.py index 9eef8b6..f66c347 100644 --- a/test/Fortran/SHF90COM.py +++ b/test/Fortran/SHF90COM.py @@ -25,6 +25,10 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" import TestSCons +import sys + +is_windows = ( sys.platform =='win32') + _python_ = TestSCons._python_ _obj = TestSCons._shobj @@ -72,18 +76,21 @@ test.write('test22.F90', "This is a .F90 file.\n/*f90pp*/\n") test.run(arguments = '.', stderr = None) test.must_match(obj_ + 'test01' + _obj, "This is a .f file.\n") -test.must_match(obj_ + 'test02' + _obj, "This is a .F file.\n") test.must_match(obj_ + 'test03' + _obj, "This is a .for file.\n") -test.must_match(obj_ + 'test04' + _obj, "This is a .FOR file.\n") test.must_match(obj_ + 'test05' + _obj, "This is a .ftn file.\n") -test.must_match(obj_ + 'test06' + _obj, "This is a .FTN file.\n") test.must_match(obj_ + 'test07' + _obj, "This is a .fpp file.\n") -test.must_match(obj_ + 'test08' + _obj, "This is a .FPP file.\n") test.must_match(obj_ + 'test11' + _obj, "This is a .f90 file.\n") -test.must_match(obj_ + 'test12' + _obj, "This is a .F90 file.\n") test.must_match(obj_ + 'test21' + _obj, "This is a .f90 file.\n") -test.must_match(obj_ + 'test22' + _obj, "This is a .F90 file.\n") +if not is_windows: + # Skip checking files we expect to differ in behavior + # based on file extension case + test.must_match(obj_ + 'test02' + _obj, "This is a .F file.\n") + test.must_match(obj_ + 'test04' + _obj, "This is a .FOR file.\n") + test.must_match(obj_ + 'test06' + _obj, "This is a .FTN file.\n") + test.must_match(obj_ + 'test08' + _obj, "This is a .FPP file.\n") + test.must_match(obj_ + 'test12' + _obj, "This is a .F90 file.\n") + test.must_match(obj_ + 'test22' + _obj, "This is a .F90 file.\n") test.pass_test() diff --git a/test/Fortran/SHF95COM.py b/test/Fortran/SHF95COM.py index e31cf45..85de45e 100644 --- a/test/Fortran/SHF95COM.py +++ b/test/Fortran/SHF95COM.py @@ -25,6 +25,9 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" import TestSCons +import sys + +is_windows = ( sys.platform =='win32') _python_ = TestSCons._python_ _obj = TestSCons._shobj @@ -72,18 +75,21 @@ test.write('test22.F95', "This is a .F95 file.\n/*f95pp*/\n") test.run(arguments = '.', stderr = None) test.must_match(obj_ + 'test01' + _obj, "This is a .f file.\n") -test.must_match(obj_ + 'test02' + _obj, "This is a .F file.\n") test.must_match(obj_ + 'test03' + _obj, "This is a .for file.\n") -test.must_match(obj_ + 'test04' + _obj, "This is a .FOR file.\n") test.must_match(obj_ + 'test05' + _obj, "This is a .ftn file.\n") -test.must_match(obj_ + 'test06' + _obj, "This is a .FTN file.\n") test.must_match(obj_ + 'test07' + _obj, "This is a .fpp file.\n") -test.must_match(obj_ + 'test08' + _obj, "This is a .FPP file.\n") test.must_match(obj_ + 'test13' + _obj, "This is a .f95 file.\n") -test.must_match(obj_ + 'test14' + _obj, "This is a .F95 file.\n") test.must_match(obj_ + 'test21' + _obj, "This is a .f95 file.\n") -test.must_match(obj_ + 'test22' + _obj, "This is a .F95 file.\n") +if not is_windows: + # Skip checking files we expect to differ in behavior + # based on file extension case + test.must_match(obj_ + 'test02' + _obj, "This is a .F file.\n") + test.must_match(obj_ + 'test04' + _obj, "This is a .FOR file.\n") + test.must_match(obj_ + 'test06' + _obj, "This is a .FTN file.\n") + test.must_match(obj_ + 'test08' + _obj, "This is a .FPP file.\n") + test.must_match(obj_ + 'test14' + _obj, "This is a .F95 file.\n") + test.must_match(obj_ + 'test22' + _obj, "This is a .F95 file.\n") test.pass_test() diff --git a/test/Fortran/SHFORTRANCOM.py b/test/Fortran/SHFORTRANCOM.py index 56958b2..5c42864 100644 --- a/test/Fortran/SHFORTRANCOM.py +++ b/test/Fortran/SHFORTRANCOM.py @@ -25,6 +25,9 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" import TestSCons +import sys + +is_windows = ( sys.platform =='win32') _python_ = TestSCons._python_ _obj = TestSCons._shobj @@ -59,13 +62,16 @@ test.write('test08.FPP', "This is a .FPP file.\n/*fortranpp*/\n") test.run(arguments = '.', stderr = None) test.must_match(obj_ + 'test01' + _obj, "This is a .f file.\n") -test.must_match(obj_ + 'test02' + _obj, "This is a .F file.\n") test.must_match(obj_ + 'test03' + _obj, "This is a .for file.\n") -test.must_match(obj_ + 'test04' + _obj, "This is a .FOR file.\n") test.must_match(obj_ + 'test05' + _obj, "This is a .ftn file.\n") -test.must_match(obj_ + 'test06' + _obj, "This is a .FTN file.\n") test.must_match(obj_ + 'test07' + _obj, "This is a .fpp file.\n") -test.must_match(obj_ + 'test08' + _obj, "This is a .FPP file.\n") +if not is_windows: + # Skip checking files we expect to differ in behavior + # based on file extension case + test.must_match(obj_ + 'test02' + _obj, "This is a .F file.\n") + test.must_match(obj_ + 'test04' + _obj, "This is a .FOR file.\n") + test.must_match(obj_ + 'test06' + _obj, "This is a .FTN file.\n") + test.must_match(obj_ + 'test08' + _obj, "This is a .FPP file.\n") test.pass_test() diff --git a/test/M4/M4.py b/test/M4/M4.py index 4306558..76010e6 100644 --- a/test/M4/M4.py +++ b/test/M4/M4.py @@ -59,7 +59,13 @@ line 3 test.run() -test.must_match(test.workpath('aaa.x'), "line 1\nmym4.py\nline 3\n") +import sys + +if sys.platform == 'win32': + # Handle carriage returns. + test.must_match(test.workpath('aaa.x'), "line 1\r\nmym4.py\r\nline 3\r\n") +else: + test.must_match(test.workpath('aaa.x'), "line 1\nmym4.py\nline 3\n") -- cgit v0.12