[meson] Use a glob.py instead of ls / dir
diff --git a/.circleci/config.yml b/.circleci/config.yml
index 1bed230..495a6a9 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -149,9 +149,8 @@
executor: win64-executor
steps:
- checkout
- - run: dpkg --add-architecture i386
- run: apt update
- - run: DEBIAN_FRONTEND=noninteractive apt install -y ninja-build python3 python3-pip python3-venv git g++-mingw-w64-x86-64 zip wine wine64 wine32:i386
+ - run: DEBIAN_FRONTEND=noninteractive apt install -y ninja-build python3 python3-pip python3-venv git g++-mingw-w64-x86-64 zip wine wine64
- run: |
export LANG=en_US.UTF-8
python3 -m venv venv
diff --git a/test/fuzzing/glob.py b/test/fuzzing/glob.py
new file mode 100755
index 0000000..606ac77
--- /dev/null
+++ b/test/fuzzing/glob.py
@@ -0,0 +1,16 @@
+#!/usr/bin/env python3
+
+import sys
+import os
+
+if len(sys.argv) < 2:
+ print("Usage: python glob.py [DIR]...")
+ sys.exit(1)
+
+for arg in sys.argv[1:]:
+ if os.path.isdir(arg):
+ for dirpath, dirnames, filenames in os.walk(arg):
+ for filename in filenames:
+ print(os.path.join(dirpath, filename))
+ elif os.path.isfile(arg):
+ print(arg)
diff --git a/test/fuzzing/meson.build b/test/fuzzing/meson.build
index 2cd80f6..488d978 100644
--- a/test/fuzzing/meson.build
+++ b/test/fuzzing/meson.build
@@ -66,27 +66,13 @@
suite: ['fuzzing'],
)
-ls = find_program('ls')
-if not ls.found()
- # On Windows, we need to use the 'dir' command to list files in a directory.
- # The 'ls' command is not available by default.
- find = [find_program('dir', required: true), '/b', '/a-d']
-else
- # On other platforms, we can use the 'ls' command.
- find = [find_program('ls', required: true)]
-endif
+glob_cmd = find_program('glob.py', required: true)
# Subset fuzzer: feed the fuzzer directly, without run-fuzzer-tests.py
font_dirs = [
meson.current_source_dir() / 'fonts',
meson.current_source_dir() / '..' / 'subset' / 'data' / 'fonts',
]
-glob = []
-foreach font_dir : font_dirs
- dir = run_command(find, font_dir, check:true).stdout().strip().split('\n')
- foreach item : dir
- glob += [font_dir / item]
- endforeach
-endforeach
+glob = run_command(glob_cmd, font_dirs, check:true).stdout().strip().split('\n')
# Chunk glob and call runner for each chunk
chunk_size = 64