@@ -1357,7 +1357,12 @@ fn make_lib_name(config: &Config, auxfile: &Path, testfile: &Path) -> PathBuf {
1357
1357
1358
1358
fn make_exe_name ( config : & Config , testfile : & Path ) -> PathBuf {
1359
1359
let mut f = output_base_name ( config, testfile) ;
1360
- if !env:: consts:: EXE_SUFFIX . is_empty ( ) {
1360
+ // FIXME: This is using the host architecture exe suffix, not target!
1361
+ if config. target == "asmjs-unknown-emscripten" {
1362
+ let mut fname = f. file_name ( ) . unwrap ( ) . to_os_string ( ) ;
1363
+ fname. push ( ".js" ) ;
1364
+ f. set_file_name ( & fname) ;
1365
+ } else if !env:: consts:: EXE_SUFFIX . is_empty ( ) {
1361
1366
let mut fname = f. file_name ( ) . unwrap ( ) . to_os_string ( ) ;
1362
1367
fname. push ( env:: consts:: EXE_SUFFIX ) ;
1363
1368
f. set_file_name ( & fname) ;
@@ -1370,6 +1375,12 @@ fn make_run_args(config: &Config, props: &TestProps, testfile: &Path)
1370
1375
// If we've got another tool to run under (valgrind),
1371
1376
// then split apart its command
1372
1377
let mut args = split_maybe_args ( & config. runtool ) ;
1378
+
1379
+ // If this is emscripten, then run tests under nodejs
1380
+ if config. target == "asmjs-unknown-emscripten" {
1381
+ args. push ( "nodejs" . to_owned ( ) ) ;
1382
+ }
1383
+
1373
1384
let exe_file = make_exe_name ( config, testfile) ;
1374
1385
1375
1386
// FIXME (#9639): This needs to handle non-utf8 paths
0 commit comments