summaryrefslogtreecommitdiffstats
path: root/test/Fortran/fixture
diff options
context:
space:
mode:
authorWilliam Blevins <wblevins001@gmail.com>2016-11-28 02:27:10 (GMT)
committerWilliam Blevins <wblevins001@gmail.com>2016-11-28 02:27:10 (GMT)
commit51abbd22089b2274161ee95d48d00525d7905b01 (patch)
tree52c998b0a8faf434f306c5498199e6ba468ff261 /test/Fortran/fixture
parente3d5fdee7267b8e07873f77afe4f2ecc46f82f16 (diff)
downloadSCons-51abbd22089b2274161ee95d48d00525d7905b01.zip
SCons-51abbd22089b2274161ee95d48d00525d7905b01.tar.gz
SCons-51abbd22089b2274161ee95d48d00525d7905b01.tar.bz2
Python3 test fixes for Fortran/Side-effect.
Diffstat (limited to 'test/Fortran/fixture')
-rw-r--r--test/Fortran/fixture/myfortran.py14
-rw-r--r--test/Fortran/fixture/myfortran_flags.py16
-rw-r--r--test/Fortran/fixture/sconstest.skip0
3 files changed, 30 insertions, 0 deletions
diff --git a/test/Fortran/fixture/myfortran.py b/test/Fortran/fixture/myfortran.py
new file mode 100644
index 0000000..08d1489
--- /dev/null
+++ b/test/Fortran/fixture/myfortran.py
@@ -0,0 +1,14 @@
+import getopt
+import sys
+print(sys.argv)
+comment = ('#' + sys.argv[1]).encode()
+length = len(comment)
+opts, args = getopt.getopt(sys.argv[2:], 'cf:o:K:')
+for opt, arg in opts:
+ if opt == '-o': out = arg
+infile = open(args[0], 'rb')
+outfile = open(out, 'wb')
+for l in infile.readlines():
+ if l[:length] != comment:
+ outfile.write(l)
+sys.exit(0)
diff --git a/test/Fortran/fixture/myfortran_flags.py b/test/Fortran/fixture/myfortran_flags.py
new file mode 100644
index 0000000..b972e35
--- /dev/null
+++ b/test/Fortran/fixture/myfortran_flags.py
@@ -0,0 +1,16 @@
+import getopt
+import sys
+comment = ('#' + sys.argv[1]).encode()
+opts, args = getopt.getopt(sys.argv[2:], 'cf:o:xy')
+optstring = ''
+length = len(comment)
+for opt, arg in opts:
+ if opt == '-o': out = arg
+ elif opt not in ('-f', '-K'): optstring = optstring + ' ' + opt
+infile = open(args[0], 'rb')
+outfile = open(out, 'wb')
+outfile.write((optstring + "\n").encode())
+for l in infile.readlines():
+ if l[:length] != comment:
+ outfile.write(l)
+sys.exit(0)
diff --git a/test/Fortran/fixture/sconstest.skip b/test/Fortran/fixture/sconstest.skip
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/test/Fortran/fixture/sconstest.skip