9
9
WINDOWS = sys .platform .startswith ('win' )
10
10
MACOS = sys .platform == 'darwin'
11
11
12
+ assert 'EM_CONFIG' in os .environ
13
+
12
14
upstream_emcc = os .path .join ('upstream' , 'emscripten' , 'emcc' )
13
15
fastcomp_emcc = os .path .join ('fastcomp' , 'emscripten' , 'emcc' )
14
16
emsdk = './emsdk'
15
17
if WINDOWS :
16
18
upstream_emcc += '.bat'
17
19
fastcomp_emcc += '.bat'
18
20
emsdk = 'emsdk.bat'
19
- else :
20
- emsdk = './emsdk'
21
21
22
22
# Utilities
23
23
@@ -76,13 +76,13 @@ def hack_emsdk(marker, replacement):
76
76
77
77
TAGS = json .loads (open ('emscripten-releases-tags.txt' ).read ())
78
78
79
- LIBC = os . path . expanduser ( '~/ .emscripten_cache/wasm/libc.a')
79
+ LIBC = ' .emscripten_cache/wasm/libc.a'
80
80
81
81
# Tests
82
82
83
83
print ('test .emscripten contents (latest was installed/activated in test.sh)' )
84
- assert 'fastcomp' not in open (os . path . expanduser ( '~/ .emscripten') ).read ()
85
- assert 'upstream' in open (os . path . expanduser ( '~/ .emscripten') ).read ()
84
+ assert 'fastcomp' not in open (' .emscripten' ).read ()
85
+ assert 'upstream' in open (' .emscripten' ).read ()
86
86
87
87
# Test we don't re-download unnecessarily
88
88
checked_call_with_output (emsdk + ' install latest' , expected = 'already installed' , unexpected = 'Downloading:' )
@@ -134,9 +134,9 @@ def run_emsdk(cmd):
134
134
run_emsdk ('activate latest-fastcomp' )
135
135
136
136
test_lib_building (fastcomp_emcc , use_asmjs_optimizer = False )
137
- assert open (os . path . expanduser ( '~/ .emscripten') ).read ().count ('LLVM_ROOT' ) == 1
138
- assert 'upstream' not in open (os . path . expanduser ( '~/ .emscripten') ).read ()
139
- assert 'fastcomp' in open (os . path . expanduser ( '~/ .emscripten') ).read ()
137
+ assert open (' .emscripten' ).read ().count ('LLVM_ROOT' ) == 1
138
+ assert 'upstream' not in open (' .emscripten' ).read ()
139
+ assert 'fastcomp' in open (' .emscripten' ).read ()
140
140
141
141
print ('verify version' )
142
142
checked_call_with_output (fastcomp_emcc + ' -v' , TAGS ['latest' ], stderr = subprocess .STDOUT )
@@ -154,9 +154,9 @@ def run_emsdk(cmd):
154
154
print ('test tot-upstream' )
155
155
run_emsdk ('install tot-upstream' )
156
156
assert not os .path .exists (LIBC )
157
- old_config = open (os . path . expanduser ( '~/ .emscripten') ).read ()
157
+ old_config = open (' .emscripten' ).read ()
158
158
run_emsdk ('activate tot-upstream' )
159
- assert old_config == open (os . path . expanduser ( '~/ .emscripten.old') ).read ()
159
+ assert old_config == open (' .emscripten.old' ).read ()
160
160
# TODO; test on latest as well
161
161
assert os .path .exists (LIBC ), 'activation supplies prebuilt libc'
162
162
check_call (upstream_emcc + ' hello_world.c' )
@@ -175,8 +175,8 @@ def run_emsdk(cmd):
175
175
print ('another install, but no need for re-download' )
176
176
checked_call_with_output (emsdk + ' install 1.38.33' , expected = 'Skipped' , unexpected = 'Downloading:' )
177
177
run_emsdk ('activate 1.38.33' )
178
- assert 'upstream' not in open (os . path . expanduser ( '~/ .emscripten') ).read ()
179
- assert 'fastcomp' in open (os . path . expanduser ( '~/ .emscripten') ).read ()
178
+ assert 'upstream' not in open (' .emscripten' ).read ()
179
+ assert 'fastcomp' in open (' .emscripten' ).read ()
180
180
181
181
print ('test specific release (new, full name)' )
182
182
run_emsdk ('install sdk-1.38.33-upstream-64bit' )
0 commit comments