diff --git a/test/test_other.py b/test/test_other.py index 3eca9b8dd5bc2..948fa14436d24 100644 --- a/test/test_other.py +++ b/test/test_other.py @@ -3271,18 +3271,18 @@ def check(text): self.fail('output contains more then one empty line in row') # relative path must be within/below the current dir - stderr = self.expect_fail([FILE_PACKAGER, 'test.data', '--preload', '../data1.txt']) + stderr = self.expect_fail([FILE_PACKAGER, 'test.data', '--quiet', '--preload', '../data1.txt']) self.assertContained('which is not contained within the current directory', stderr) # relative path that ends up under us is cool - proc = self.run_process([FILE_PACKAGER, 'test.data', '--preload', '../subdir/data2.txt'], stderr=PIPE, stdout=PIPE) - self.assertNotContained('which is not contained within the current directory', proc.stderr) + proc = self.run_process([FILE_PACKAGER, 'test.data', '--quiet', '--preload', '../subdir/data2.txt'], stderr=PIPE, stdout=PIPE) + self.assertEqual(proc.stderr, '') check(proc.stdout) # direct path leads to the same code being generated - relative path does not make us do anything different - proc2 = self.run_process([FILE_PACKAGER, 'test.data', '--preload', 'data2.txt'], stderr=PIPE, stdout=PIPE) + proc2 = self.run_process([FILE_PACKAGER, 'test.data', '--quiet', '--preload', 'data2.txt'], stderr=PIPE, stdout=PIPE) check(proc2.stdout) - self.assertNotContained('below the current directory', proc2.stderr) + self.assertEqual(proc2.stderr, '') def clean(txt): lines = txt.splitlines() @@ -3294,7 +3294,7 @@ def clean(txt): # verify '--separate-metadata' option produces separate metadata file os.chdir('..') - self.run_process([FILE_PACKAGER, 'test.data', '--preload', 'data1.txt', '--preload', 'subdir/data2.txt', '--js-output=immutable.js', '--separate-metadata', '--use-preload-cache']) + self.run_process([FILE_PACKAGER, 'test.data', '--quiet', '--preload', 'data1.txt', '--preload', 'subdir/data2.txt', '--js-output=immutable.js', '--separate-metadata', '--use-preload-cache']) self.assertExists('immutable.js.metadata') # verify js output JS file is not touched when the metadata is separated orig_timestamp = os.path.getmtime('immutable.js') @@ -3302,7 +3302,7 @@ def clean(txt): # ensure some time passes before running the packager again so that if it does touch the # js file it will end up with the different timestamp. time.sleep(1.0) - self.run_process([FILE_PACKAGER, 'test.data', '--preload', 'data1.txt', '--preload', 'subdir/data2.txt', '--js-output=immutable.js', '--separate-metadata', '--use-preload-cache']) + self.run_process([FILE_PACKAGER, 'test.data', '--quiet', '--preload', 'data1.txt', '--preload', 'subdir/data2.txt', '--js-output=immutable.js', '--separate-metadata', '--use-preload-cache']) # assert both file content and timestamp are the same as reference copy self.assertTextDataIdentical(orig_content, read_file('immutable.js')) self.assertEqual(orig_timestamp, os.path.getmtime('immutable.js')) diff --git a/tools/file_packager.py b/tools/file_packager.py index 69d05f256aa26..956ab8a3530cf 100755 --- a/tools/file_packager.py +++ b/tools/file_packager.py @@ -57,6 +57,8 @@ --no-node Whether to support Node.js. By default we do, which emits some extra code. + --quiet Suppress reminder about using `FORCE_FILESYSTEM` + Notes: * The file packager generates unix-style file paths. So if you are on windows and a file is accessed at @@ -110,6 +112,7 @@ def __init__(self): self.obj_output = None self.depfile = None self.from_emcc = False + self.quiet = False self.force = True # If set to True, IndexedDB (IDBFS in library_idbfs.js) is used to locally # cache VFS XHR so that subsequent page loads can read the data from the @@ -411,9 +414,11 @@ def main(): if '=' in arg: options.export_name = arg.split('=', 1)[1] leading = '' - elif arg.startswith('--from-emcc'): + elif arg == '--from-emcc': options.from_emcc = True leading = '' + elif arg == '--quiet': + options.quiet = True elif arg.startswith('--plugin'): plugin = utils.read_file(arg.split('=', 1)[1]) eval(plugin) # should append itself to plugins @@ -454,7 +459,7 @@ def main(): 'and a specified --js-output') return 1 - if not options.from_emcc: + if not options.from_emcc and not options.quiet: err('Remember to build the main file with `-sFORCE_FILESYSTEM` ' 'so that it includes support for loading this file package')