14
14
# launchermodule = __import__( 'nativelauncher' )
15
15
self.assertEqual( 0, nativelauncher.cvar._jst_debug )
17
# FIXME move these to a separate test class.
19
def testModifyingSwigFileToBeMSVCDebugCompliant( self ) :
21
# create a temporary file with the appropriate #include
22
sampleFile = tempfile.TemporaryFile( 'w+' )
24
sampleFile.writelines( [ "\n",
25
"/* Python.h has to appear first */\n",
26
"#include <Python.h>\n",
33
supportModule.surroundPythonHIncludeWithGuards( sampleFile )
35
# check that the said import in said file is now ok
37
lines = sampleFile.readlines()
41
"/* Python.h has to appear first */\n",
42
"#if defined( _DEBUG )\n",
43
"# define _DEBUG_WAS_DEFINED\n",
46
"#include <Python.h>\n",
47
"#if defined( _DEBUG_WAS_DEFINED )\n",
54
self.assertEqual( expectedLines, lines )
56
# call func to modify the file again
57
supportModule.surroundPythonHIncludeWithGuards( sampleFile )
58
# check there are no further modifications
60
linesNow = sampleFile.readlines()
61
self.assertEqual( lines, linesNow )
18
65
# The entry point for SCons to use.