add testing for EMCC_FORCE_STDLIBS=1 on dynamic linking
This commit is contained in:
Родитель
d0ed46f3e4
Коммит
9c77d0fd9f
|
@ -3901,31 +3901,36 @@ var Module = {
|
||||||
''', expected=['main: jslib_x is 148.\nside: jslib_x is 148.\n'], main_emcc_args=['--js-library', 'lib.js'])
|
''', expected=['main: jslib_x is 148.\nside: jslib_x is 148.\n'], main_emcc_args=['--js-library', 'lib.js'])
|
||||||
|
|
||||||
def test_dylink_syslibs(self): # one module uses libcextra, need to force its inclusion when it isn't the main
|
def test_dylink_syslibs(self): # one module uses libcextra, need to force its inclusion when it isn't the main
|
||||||
try:
|
def test(syslibs):
|
||||||
os.environ['EMCC_FORCE_STDLIBS'] = 'libc,libcextra'
|
print 'syslibs', syslibs
|
||||||
self.dylink_test(header=r'''
|
try:
|
||||||
#include <string.h>
|
os.environ['EMCC_FORCE_STDLIBS'] = syslibs
|
||||||
int side();
|
self.dylink_test(header=r'''
|
||||||
''', main=r'''
|
#include <string.h>
|
||||||
#include <stdio.h>
|
int side();
|
||||||
#include <wchar.h>
|
''', main=r'''
|
||||||
#include "header.h"
|
#include <stdio.h>
|
||||||
int main() {
|
#include <wchar.h>
|
||||||
printf("|%d|\n", side());
|
#include "header.h"
|
||||||
wprintf (L"Characters: %lc %lc\n", L'a', 65);
|
int main() {
|
||||||
return 0;
|
printf("|%d|\n", side());
|
||||||
}
|
wprintf (L"Characters: %lc %lc\n", L'a', 65);
|
||||||
''', side=r'''
|
return 0;
|
||||||
#include <stdlib.h>
|
}
|
||||||
#include <malloc.h>
|
''', side=r'''
|
||||||
#include "header.h"
|
#include <stdlib.h>
|
||||||
int side() {
|
#include <malloc.h>
|
||||||
struct mallinfo m = mallinfo();
|
#include "header.h"
|
||||||
return m.arena > 1;
|
int side() {
|
||||||
}
|
struct mallinfo m = mallinfo();
|
||||||
''', expected=['|1|\nCharacters: a A\n'])
|
return m.arena > 1;
|
||||||
finally:
|
}
|
||||||
del os.environ['EMCC_FORCE_STDLIBS']
|
''', expected=['|1|\nCharacters: a A\n'])
|
||||||
|
finally:
|
||||||
|
del os.environ['EMCC_FORCE_STDLIBS']
|
||||||
|
|
||||||
|
test('libc,libcextra')
|
||||||
|
test('1')
|
||||||
|
|
||||||
def test_dylink_iostream(self):
|
def test_dylink_iostream(self):
|
||||||
try:
|
try:
|
||||||
|
|
Загрузка…
Ссылка в новой задаче