@@ -7841,6 +7841,24 @@ def test_override_js_execution_environment(self):
78417841 seen = self.run_js('test.js', engine=engine, assert_returncode=NON_ZERO)
78427842 self.assertContained('Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -sENVIRONMENT=web or -sENVIRONMENT=node', seen)
78437843
7844+ @requires_node
7845+ @with_env_modify({'FOO': 'bar'})
7846+ @parameterized({
7847+ '': ([], '|(null)|\n'),
7848+ 'rawfs': (['-sNODERAWFS'], '|bar|\n'),
7849+ 'rawfs_no_env': (['-sNODERAWFS', '-sNODE_HOST_ENV=0'], '|(null)|\n'),
7850+ 'enabled': (['-sNODE_HOST_ENV'], '|bar|\n'),
7851+ })
7852+ def test_node_host_env(self, args, expected):
7853+ create_file('src.c', r'''
7854+ #include <stdlib.h>
7855+ #include <stdio.h>
7856+ int main() {
7857+ printf("|%s|\n", getenv("FOO"));
7858+ }
7859+ ''')
7860+ self.do_runf('src.c', expected, cflags=args)
7861+
78447862 def test_override_c_environ(self):
78457863 create_file('pre.js', r'''
78467864 Module.preRun = () => { ENV.hello = '💩 world'; ENV.LANG = undefined; }
@@ -13653,12 +13671,20 @@ def test_fs_icase(self):
1365313671 # c++20 for ends_with().
1365413672 self.do_other_test('test_fs_icase.cpp', cflags=['-sCASE_INSENSITIVE_FS', '-std=c++20'])
1365513673
13674+ @crossplatform
1365613675 @with_all_fs
1365713676 def test_std_filesystem(self):
1365813677 if (WINDOWS or MACOS) and self.get_setting('NODERAWFS'):
1365913678 self.skipTest('Rawfs directory removal works only on Linux')
1366013679 self.do_other_test('test_std_filesystem.cpp')
1366113680
13681+ @crossplatform
13682+ @with_all_fs
13683+ def test_std_filesystem_tempdir(self):
13684+ if (WINDOWS or MACOS) and self.get_setting('NODERAWFS') and self.get_setting('WASMFS'):
13685+ self.skipTest('NODERAWFS + WASMFS is does not allow access to arbitrary paths')
13686+ self.do_other_test('test_std_filesystem_tempdir.cpp', cflags=['-g'])
13687+
1366213688 def test_strict_js_closure(self):
1366313689 self.do_runf('hello_world.c', cflags=['-sSTRICT_JS', '-Werror=closure', '--closure=1', '-O3'])
1366413690
0 commit comments