5 # Permission is hereby granted, free of charge, to any person obtaining
6 # a copy of this software and associated documentation files (the
7 # "Software"), to deal in the Software without restriction, including
8 # without limitation the rights to use, copy, modify, merge, publish,
9 # distribute, sublicense, and/or sell copies of the Software, and to
10 # permit persons to whom the Software is furnished to do so, subject to
11 # the following conditions:
13 # The above copyright notice and this permission notice shall be included
14 # in all copies or substantial portions of the Software.
16 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
17 # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
18 # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19 # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20 # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21 # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25 __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
28 Verify correct use of the live 'ml' assembler.
35 _python_ = TestSCons._python_
38 test = TestSCons.TestSCons()
40 if sys.platform != 'win32':
41 test.skip_test("Skipping ml test on non-win32 platform '%s'\n" % sys.platform)
43 ml = test.where_is('ml')
46 test.skip_test("ml not found; skipping test\n")
48 test.write("wrapper.py",
51 open('%s', 'wb').write("wrapper.py\\n")
52 os.system(" ".join(sys.argv[1:]))
53 """ % test.workpath('wrapper.out').replace('\\', '\\\\'))
55 test.write('SConstruct', """
57 ccc = Environment(tools = ['msvc', 'mslink', 'masm'],
58 ASFLAGS = '/nologo /coff')
59 ccc['ENV']['PATH'] = ccc['ENV']['PATH'] + os.pathsep + os.environ['PATH']
60 ddd = ccc.Clone(AS = r'%(_python_)s wrapper.py ' + ccc['AS'])
61 ccc.Program(target = 'ccc', source = ['ccc.asm', 'ccc_main.c'])
62 ddd.Program(target = 'ddd', source = ['ddd.asm', 'ddd_main.c'])
69 _name byte "ccc.asm",0
78 _name byte "ddd.asm",0
83 test.write('ccc_main.c', r"""
87 main(int argc, char *argv[])
90 printf("ccc_main.c %s\n", name);
95 test.write('ddd_main.c', r"""
99 main(int argc, char *argv[])
102 printf("ddd_main.c %s\n", name);
107 test.run(arguments = 'ccc' + _exe, stderr = None)
109 test.run(program = test.workpath('ccc'), stdout = "ccc_main.c ccc.asm\n")
111 test.must_not_exist('wrapper.out')
113 test.run(arguments = 'ddd' + _exe)
115 test.run(program = test.workpath('ddd'), stdout = "ddd_main.c ddd.asm\n")
117 test.must_match('wrapper.out', "wrapper.py\n")
125 # indent-tabs-mode:nil
127 # vim: set expandtab tabstop=4 shiftwidth=4: