summaryrefslogtreecommitdiffstats
path: root/test/AS
diff options
context:
space:
mode:
Diffstat (limited to 'test/AS')
-rw-r--r--test/AS/AS.py34
-rw-r--r--test/AS/ASCOM.py19
-rw-r--r--test/AS/ASCOMSTR.py4
-rw-r--r--test/AS/ASFLAGS.py10
-rw-r--r--test/AS/ASPP.py10
-rw-r--r--test/AS/ASPPCOM.py13
-rw-r--r--test/AS/ASPPCOMSTR.py4
-rw-r--r--test/AS/ASPPFLAGS.py8
8 files changed, 65 insertions, 37 deletions
diff --git a/test/AS/AS.py b/test/AS/AS.py
index 0543a0c..2c9e624 100644
--- a/test/AS/AS.py
+++ b/test/AS/AS.py
@@ -29,7 +29,7 @@ import string
import sys
import TestSCons
-python = TestSCons.python
+_python_ = TestSCons._python_
_exe = TestSCons._exe
test = TestSCons.TestSCons()
@@ -110,17 +110,16 @@ sys.exit(0)
""")
test.write('SConstruct', """
-env = Environment(LINK = r'%s mylink.py',
- LINKFLAGS = [],
- AS = r'%s myas.py',
- CC = r'%s myas.py')
+env = Environment(LINK = r'%(_python_)s mylink.py',
+ AS = r'%(_python_)s myas.py',
+ CC = r'%(_python_)s myas.py')
env.Program(target = 'test1', source = 'test1.s')
env.Program(target = 'test2', source = 'test2.S')
env.Program(target = 'test3', source = 'test3.asm')
env.Program(target = 'test4', source = 'test4.ASM')
env.Program(target = 'test5', source = 'test5.spp')
env.Program(target = 'test6', source = 'test6.SPP')
-""" % (python, python, python))
+""" % locals())
test.write('test1.s', r"""This is a .s file.
#as
@@ -183,12 +182,12 @@ os.system(cmd)
test.write('SConstruct', """\
aaa = Environment()
-bbb = aaa.Copy(AS = r'%s wrapper.py ' + WhereIs('as'))
+bbb = aaa.Copy(AS = r'%(_python_)s wrapper.py ' + WhereIs('as'))
ccc = aaa.Copy(CPPPATH=['.'])
aaa.Program(target = 'aaa', source = ['aaa.s', 'aaa_main.c'])
bbb.Program(target = 'bbb', source = ['bbb.s', 'bbb_main.c'])
ccc.Program(target = 'ccc', source = ['ccc.S', 'ccc_main.c'])
-""" % python)
+""" % locals())
test.write('aaa.s',
""" .file "aaa.s"
@@ -226,6 +225,9 @@ name:
""")
test.write('aaa_main.c', r"""
+#include <stdlib.h>
+#include <stdio.h>
+
extern char name[];
int
@@ -238,6 +240,9 @@ main(int argc, char *argv[])
""")
test.write('bbb_main.c', r"""
+#include <stdlib.h>
+#include <stdio.h>
+
extern char name[];
int
@@ -250,6 +255,9 @@ main(int argc, char *argv[])
""")
test.write('ccc_main.c', r"""
+#include <stdlib.h>
+#include <stdio.h>
+
extern char name[];
int
@@ -309,10 +317,10 @@ import os
ccc = Environment(tools = ['msvc', 'mslink', 'masm'],
ASFLAGS = '/nologo /coff')
ccc['ENV']['PATH'] = ccc['ENV']['PATH'] + os.pathsep + os.environ['PATH']
-ddd = ccc.Copy(AS = r'%s wrapper.py ' + ccc['AS'])
+ddd = ccc.Copy(AS = r'%(_python_)s wrapper.py ' + ccc['AS'])
ccc.Program(target = 'ccc', source = ['ccc.asm', 'ccc_main.c'])
ddd.Program(target = 'ddd', source = ['ddd.asm', 'ddd_main.c'])
-""" % python)
+""" % locals())
test.write('ccc.asm',
"""
@@ -398,11 +406,11 @@ os.system(string.join(sys.argv[1:], " "))
test.write('SConstruct', """
eee = Environment(tools = ['gcc', 'gnulink', 'nasm'],
- ASFLAGS = '-f %s')
-fff = eee.Copy(AS = r'%s wrapper.py ' + WhereIs('nasm'))
+ ASFLAGS = '-f %(nasm_format)s')
+fff = eee.Copy(AS = r'%(_python_)s wrapper.py ' + WhereIs('nasm'))
eee.Program(target = 'eee', source = ['eee.asm', 'eee_main.c'])
fff.Program(target = 'fff', source = ['fff.asm', 'fff_main.c'])
-""" % (nasm_format, python))
+""" % locals())
test.write('eee.asm',
"""
diff --git a/test/AS/ASCOM.py b/test/AS/ASCOM.py
index da66bca..4292581 100644
--- a/test/AS/ASCOM.py
+++ b/test/AS/ASCOM.py
@@ -33,7 +33,7 @@ import string
import sys
import TestSCons
-python = TestSCons.python
+_python_ = TestSCons._python_
test = TestSCons.TestSCons()
@@ -56,18 +56,27 @@ else:
alt_asm_suffix = '.asm'
test.write('SConstruct', """
-env = Environment(ASCOM = r'%(python)s myas.py $TARGET $SOURCE',
- OBJSUFFIX = '.obj')
+env = Environment(ASCOM = r'%(_python_)s myas.py $TARGET $SOURCE',
+ OBJSUFFIX = '.obj',
+ SHOBJSUFFIX = '.shobj')
env.Object(target = 'test1', source = 'test1.s')
env.Object(target = 'test2', source = 'test2%(alt_s_suffix)s')
env.Object(target = 'test3', source = 'test3.asm')
env.Object(target = 'test4', source = 'test4%(alt_asm_suffix)s')
+env.SharedObject(target = 'test5', source = 'test5.s')
+env.SharedObject(target = 'test6', source = 'test6%(alt_s_suffix)s')
+env.SharedObject(target = 'test7', source = 'test7.asm')
+env.SharedObject(target = 'test8', source = 'test8%(alt_asm_suffix)s')
""" % locals())
test.write('test1.s', "test1.s\n#as\n")
test.write('test2'+alt_s_suffix, "test2.S\n#as\n")
test.write('test3.asm', "test3.asm\n#as\n")
test.write('test4'+alt_asm_suffix, "test4.ASM\n#as\n")
+test.write('test5.s', "test5.s\n#as\n")
+test.write('test6'+alt_s_suffix, "test6.S\n#as\n")
+test.write('test7.asm', "test7.asm\n#as\n")
+test.write('test8'+alt_asm_suffix, "test8.ASM\n#as\n")
test.run(arguments = '.')
@@ -75,6 +84,10 @@ test.fail_test(test.read('test1.obj') != "test1.s\n")
test.fail_test(test.read('test2.obj') != "test2.S\n")
test.fail_test(test.read('test3.obj') != "test3.asm\n")
test.fail_test(test.read('test4.obj') != "test4.ASM\n")
+test.fail_test(test.read('test5.shobj') != "test5.s\n")
+test.fail_test(test.read('test6.shobj') != "test6.S\n")
+test.fail_test(test.read('test7.shobj') != "test7.asm\n")
+test.fail_test(test.read('test8.shobj') != "test8.ASM\n")
diff --git a/test/AS/ASCOMSTR.py b/test/AS/ASCOMSTR.py
index c8eed62..287da16 100644
--- a/test/AS/ASCOMSTR.py
+++ b/test/AS/ASCOMSTR.py
@@ -34,7 +34,7 @@ import string
import sys
import TestSCons
-python = TestSCons.python
+_python_ = TestSCons._python_
test = TestSCons.TestSCons()
@@ -57,7 +57,7 @@ else:
alt_asm_suffix = '.asm'
test.write('SConstruct', """
-env = Environment(ASCOM = r'%(python)s myas.py $TARGET $SOURCE',
+env = Environment(ASCOM = r'%(_python_)s myas.py $TARGET $SOURCE',
ASCOMSTR = 'Assembling $TARGET from $SOURCE',
OBJSUFFIX = '.obj')
env.Object(target = 'test1', source = 'test1.s')
diff --git a/test/AS/ASFLAGS.py b/test/AS/ASFLAGS.py
index 6396c45..a0da9ff 100644
--- a/test/AS/ASFLAGS.py
+++ b/test/AS/ASFLAGS.py
@@ -29,7 +29,7 @@ import string
import sys
import TestSCons
-python = TestSCons.python
+_python_ = TestSCons._python_
test = TestSCons.TestSCons()
_exe = TestSCons._exe
@@ -126,17 +126,17 @@ sys.exit(0)
test.write('SConstruct', """
-env = Environment(LINK = r'%s mylink.py',
+env = Environment(LINK = r'%(_python_)s mylink.py',
LINKFLAGS = [],
- AS = r'%s myas.py', ASFLAGS = '-x',
- CC = r'%s myas.py')
+ AS = r'%(_python_)s myas.py', ASFLAGS = '-x',
+ CC = r'%(_python_)s myas.py')
env.Program(target = 'test1', source = 'test1.s')
env.Program(target = 'test2', source = 'test2.S')
env.Program(target = 'test3', source = 'test3.asm')
env.Program(target = 'test4', source = 'test4.ASM')
env.Program(target = 'test5', source = 'test5.spp')
env.Program(target = 'test6', source = 'test6.SPP')
-""" % (python, python, python))
+""" % locals())
test.write('test1.s', r"""This is a .s file.
#as
diff --git a/test/AS/ASPP.py b/test/AS/ASPP.py
index da47618..2045a3d 100644
--- a/test/AS/ASPP.py
+++ b/test/AS/ASPP.py
@@ -29,7 +29,7 @@ import string
import sys
import TestSCons
-python = TestSCons.python
+_python_ = TestSCons._python_
_exe = TestSCons._exe
test = TestSCons.TestSCons()
@@ -110,13 +110,13 @@ sys.exit(0)
""")
test.write('SConstruct', """
-env = Environment(LINK = r'%s mylink.py',
+env = Environment(LINK = r'%(_python_)s mylink.py',
LINKFLAGS = [],
- ASPP = r'%s myas.py',
- CC = r'%s myas.py')
+ ASPP = r'%(_python_)s myas.py',
+ CC = r'%(_python_)s myas.py')
env.Program(target = 'test1', source = 'test1.spp')
env.Program(target = 'test2', source = 'test2.SPP')
-""" % (python, python, python))
+""" % locals())
test.write('test1.spp', r"""This is a .spp file.
#as
diff --git a/test/AS/ASPPCOM.py b/test/AS/ASPPCOM.py
index e877354..bb330dc 100644
--- a/test/AS/ASPPCOM.py
+++ b/test/AS/ASPPCOM.py
@@ -33,7 +33,7 @@ import string
import sys
import TestSCons
-python = TestSCons.python
+_python_ = TestSCons._python_
test = TestSCons.TestSCons()
@@ -49,19 +49,26 @@ sys.exit(0)
""")
test.write('SConstruct', """
-env = Environment(ASPPCOM = r'%(python)s myas.py $TARGET $SOURCE',
- OBJSUFFIX = '.obj')
+env = Environment(ASPPCOM = r'%(_python_)s myas.py $TARGET $SOURCE',
+ OBJSUFFIX = '.obj',
+ SHOBJSUFFIX = '.shobj')
env.Object(target = 'test1', source = 'test1.spp')
env.Object(target = 'test2', source = 'test2.SPP')
+env.SharedObject(target = 'test3', source = 'test3.spp')
+env.SharedObject(target = 'test4', source = 'test4.SPP')
""" % locals())
test.write('test1.spp', "test1.spp\n#as\n")
test.write('test2.SPP', "test2.SPP\n#as\n")
+test.write('test3.spp', "test3.spp\n#as\n")
+test.write('test4.SPP', "test4.SPP\n#as\n")
test.run(arguments = '.')
test.fail_test(test.read('test1.obj') != "test1.spp\n")
test.fail_test(test.read('test2.obj') != "test2.SPP\n")
+test.fail_test(test.read('test3.shobj') != "test3.spp\n")
+test.fail_test(test.read('test4.shobj') != "test4.SPP\n")
diff --git a/test/AS/ASPPCOMSTR.py b/test/AS/ASPPCOMSTR.py
index 21e8033..1956154 100644
--- a/test/AS/ASPPCOMSTR.py
+++ b/test/AS/ASPPCOMSTR.py
@@ -34,7 +34,7 @@ import string
import sys
import TestSCons
-python = TestSCons.python
+_python_ = TestSCons._python_
test = TestSCons.TestSCons()
@@ -50,7 +50,7 @@ sys.exit(0)
""")
test.write('SConstruct', """
-env = Environment(ASPPCOM = r'%(python)s myas.py $TARGET $SOURCE',
+env = Environment(ASPPCOM = r'%(_python_)s myas.py $TARGET $SOURCE',
ASPPCOMSTR = 'Assembling $TARGET from $SOURCE',
OBJSUFFIX = '.obj')
env.Object(target = 'test1', source = 'test1.spp')
diff --git a/test/AS/ASPPFLAGS.py b/test/AS/ASPPFLAGS.py
index cbd4339..27858bd 100644
--- a/test/AS/ASPPFLAGS.py
+++ b/test/AS/ASPPFLAGS.py
@@ -29,7 +29,7 @@ import string
import sys
import TestSCons
-python = TestSCons.python
+_python_ = TestSCons._python_
test = TestSCons.TestSCons()
_exe = TestSCons._exe
@@ -126,10 +126,10 @@ sys.exit(0)
test.write('SConstruct', """
-env = Environment(LINK = r'%(python)s mylink.py',
+env = Environment(LINK = r'%(_python_)s mylink.py',
LINKFLAGS = [],
- ASPP = r'%(python)s myas.py', ASPPFLAGS = '-x',
- CC = r'%(python)s myas.py')
+ ASPP = r'%(_python_)s myas.py', ASPPFLAGS = '-x',
+ CC = r'%(_python_)s myas.py')
env.Program(target = 'test1', source = 'test1.spp')
env.Program(target = 'test2', source = 'test2.SPP')
""" % locals())