@@ -7840,6 +7840,24 @@ def test_override_js_execution_environment(self):
78407840 seen = self.run_js('test.js', engine=engine, assert_returncode=NON_ZERO)
78417841 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)
78427842
7843+ @requires_node
7844+ @with_env_modify({'FOO': 'bar'})
7845+ @parameterized({
7846+ '': ([], '|(null)|\n'),
7847+ 'rawfs': (['-sNODERAWFS'], '|bar|\n'),
7848+ 'rawfs_no_env': (['-sNODERAWFS', '-sNODE_HOST_ENV=0'], '|(null)|\n'),
7849+ 'enabled': (['-sNODE_HOST_ENV'], '|bar|\n'),
7850+ })
7851+ def test_node_host_env(self, args, expected):
7852+ create_file('src.c', r'''
7853+ #include <stdlib.h>
7854+ #include <stdio.h>
7855+ int main() {
7856+ printf("|%s|\n", getenv("FOO"));
7857+ }
7858+ ''')
7859+ self.do_runf('src.c', expected, cflags=args)
7860+
78437861 def test_override_c_environ(self):
78447862 create_file('pre.js', r'''
78457863 Module.preRun = () => { ENV.hello = '💩 world'; ENV.LANG = undefined; }
@@ -13644,12 +13662,20 @@ def test_fs_icase(self):
1364413662 # c++20 for ends_with().
1364513663 self.do_other_test('test_fs_icase.cpp', cflags=['-sCASE_INSENSITIVE_FS', '-std=c++20'])
1364613664
13665+ @crossplatform
1364713666 @with_all_fs
1364813667 def test_std_filesystem(self):
1364913668 if (WINDOWS or MACOS) and self.get_setting('NODERAWFS'):
1365013669 self.skipTest('Rawfs directory removal works only on Linux')
1365113670 self.do_other_test('test_std_filesystem.cpp')
1365213671
13672+ @crossplatform
13673+ @with_all_fs
13674+ def test_std_filesystem_tempdir(self):
13675+ if (WINDOWS or MACOS) and self.get_setting('NODERAWFS') and self.get_setting('WASMFS'):
13676+ self.skipTest('NODERAWFS + WASMFS is does not allow access to arbitrary paths')
13677+ self.do_other_test('test_std_filesystem_tempdir.cpp', cflags=['-g'])
13678+
1365313679 def test_strict_js_closure(self):
1365413680 self.do_runf('hello_world.c', cflags=['-sSTRICT_JS', '-Werror=closure', '--closure=1', '-O3'])
1365513681
0 commit comments