summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2002-10-21 23:40:24 (GMT)
committerSteven Knight <knight@baldmt.com>2002-10-21 23:40:24 (GMT)
commitf279a9601953dc193f028ab33a8b58ccc9baf937 (patch)
tree55fd298c300bc29b0337b10eeeb30f3f03b3f767 /test
parent276f24218f1e730fed31fa9f9072cdd464adb7b3 (diff)
downloadSCons-f279a9601953dc193f028ab33a8b58ccc9baf937.zip
SCons-f279a9601953dc193f028ab33a8b58ccc9baf937.tar.gz
SCons-f279a9601953dc193f028ab33a8b58ccc9baf937.tar.bz2
Add MSVC .res builder. (Anthony Roach)
Diffstat (limited to 'test')
-rw-r--r--test/msvc.py46
1 files changed, 44 insertions, 2 deletions
diff --git a/test/msvc.py b/test/msvc.py
index ed43421..7d771d3 100644
--- a/test/msvc.py
+++ b/test/msvc.py
@@ -44,7 +44,7 @@ env=Environment()
env['PCH'] = env.PCH('StdAfx.cpp')[0]
env['PDB'] = File('test.pdb')
env['PCHSTOP'] = 'StdAfx.h'
-env.Program('test', 'test.cpp')
+env.Program('test', ['test.cpp', env.RES('test.rc')], LIBS=['user32'])
env.Object('fast', 'foo.cpp')
env.Object('slow', 'foo.cpp', PCH=0)
@@ -52,19 +52,38 @@ env.Object('slow', 'foo.cpp', PCH=0)
test.write('test.cpp', '''
#include "StdAfx.h"
+#include "resource.h"
int main(void)
{
- return 1;
+ char test[1024];
+ LoadString(GetModuleHandle(NULL), IDS_TEST, test, sizeof(test));
+ printf("%d %s\\n", IDS_TEST, test);
+ return 0;
}
''')
+test.write('test.rc', '''
+#include "resource.h"
+
+STRINGTABLE DISCARDABLE
+BEGIN
+ IDS_TEST "test 1"
+END
+''')
+
+test.write('resource.h', '''
+#define IDS_TEST 2001
+''')
+
+
test.write('foo.cpp', '''
#include "StdAfx.h"
''')
test.write('StdAfx.h', '''
#include <windows.h>
+#include <stdio.h>
''')
test.write('StdAfx.cpp', '''
@@ -73,13 +92,36 @@ test.write('StdAfx.cpp', '''
test.run(arguments='test.exe')
+test.fail_test(not os.path.exists(test.workpath('test.exe')))
+test.fail_test(not os.path.exists(test.workpath('test.res')))
test.fail_test(not os.path.exists(test.workpath('test.pdb')))
test.fail_test(not os.path.exists(test.workpath('StdAfx.pch')))
test.fail_test(not os.path.exists(test.workpath('StdAfx.obj')))
+test.run(program=test.workpath('test.exe'), stdout='2001 test 1\n')
+
+test.write('resource.h', '''
+#define IDS_TEST 2002
+''')
+test.run(arguments='test.exe')
+test.run(program=test.workpath('test.exe'), stdout='2002 test 1\n')
+
+test.write('test.rc', '''
+#include "resource.h"
+
+STRINGTABLE DISCARDABLE
+BEGIN
+ IDS_TEST "test 2"
+END
+''')
+test.run(arguments='test.exe')
+test.run(program=test.workpath('test.exe'), stdout='2002 test 2\n')
+
test.run(arguments='-c .')
+test.fail_test(os.path.exists(test.workpath('test.exe')))
test.fail_test(os.path.exists(test.workpath('test.pdb')))
+test.fail_test(os.path.exists(test.workpath('test.res')))
test.fail_test(os.path.exists(test.workpath('StdAfx.pch')))
test.fail_test(os.path.exists(test.workpath('StdAfx.obj')))