Decouple test suite from compiler internals for pure blackbox testing
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 35/100
調査の方向性
まず test/test_other.py のクイックウィン領域から始め、次に test/test_browser.py、test/test_sanity.py、test/common.py の直接インポートを追跡します。影響を受けるブラックボックス CLI テストを実行し、tools/*、options/settings、cache、ports、webassembly helpers の使用方法を比較します。完了の基準は、列挙されたテストスイートが、これらの内部依存関係なしに、CLI 経由または明示的に分離されたテストを通じてコンパイラーの動作を検証することです。
索引モデルが issue の本文から書いたものです。
説明
Most tests in test/test_core.py and test/test_browser.py test emcc as a black box via CLI invocations. However, parts of test/test_other.py, test/test_sanity.py, and the test harness (test/common.py) directly import and depend on Python compiler internals (tools/*).
If we want to rewrite the compiler (or components like the linker) in another language, or run the test suite against alternative implementations, we need to eliminate these internal dependencies and make the suite purely blackbox.
Breakdown & Estimated Effort
| Area | Current Coupling | Proposed Fix | Effort |
|---|---|---|---|
| 1. Global State Mutation | Tests for -print-* flags in test_other.py mutate options.lto and settings.MEMORY64 to predict paths via cache.get_lib_dir(). |
Assert on CLI output paths directly without altering Python singletons. | Small (~0.5 day) |
| 2. Binary Type Checks | test_other.py calls building.is_wasm(), is_wasm_dylib(), is_ar(). |
Inspect magic bytes (b'\0asm') or use llvm-readobj / llvm-ar. |
Small (~1 day) |
| 3. Direct Unit Tests | test_other.py / test_browser.py unit-test Python functions directly (binary_encode, wasm_sourcemap, response_file, closure_compiler). |
Test via CLI flags or isolate into a dedicated Python unit test directory. | Small (~1–2 days) |
| 4. Wasm Inspection | ~15 tests in test_core.py and test_other.py use tools.webassembly.Module to check section names/features. |
Replace with standard CLI tools (llvm-readobj, llvm-objdump -h, wasm-dis). |
Medium (~2–3 days) |
| 5. Cache & Ports Introspection | Tests query cache.get_sysroot_dir() or ports.Ports.get_dir() to find files in the cache. |
Expose paths via CLI (e.g. emcc --print-sysroot) and test ports via --use-port. |
Medium (~2 days) |
| 6. Harness Settings Filtering | common.py imports COMPILE_TIME_SETTINGS to filter -s flags during compile-only (-c) runs. |
Make compiler ignore/warn on link settings during -c, or query capabilities via CLI. |
Medium (~2–3 days) |
| 7. Sanity Suite Partitioning | test_sanity.py (~1,000 lines) tests the Python toolchain driver (config.py, cache locking, version checks). |
Separate Python driver tests from the language-agnostic conformance test suite. | Medium (~1–2 days) |
Total Estimated Effort: ~2 to 3 weeks
Next Steps
- Clean up quick wins in
test_other.py(removeoptions/settingsmutation, replacebuilding.is_*helpers). - Replace
tools.webassemblycalls with standard binary tools (llvm-readobj). - Decouple harness dependencies (
COMPILE_TIME_SETTINGS) and separatetest_sanity.py.
- 主要言語
- C++
- スター
- 27.8k
- フォーク
- 3.6k
- 平均マージ
- 1日 6時間
- マージ済み PR(30日)
- 181
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
emscripten-core/emscripten のほかの issue
-
`other.test_cmake_cxx_import_std` fails on CMake 3.30–4.0.2 due to missing `CMAKE_EXPERIMENTAL_CXX_IMPORT_STD` UUIDs対応中かも @subhaushsingh が 2 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
emscripten-core/emscripten#28160 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
emscripten-core/emscripten#27994 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
LEGACY_GL_EMULATION: generated fixed-function fragment shaders use mediump — fp16 overflow where mediump is half precision対応中かも @TheTomBritton が 14 日前に担当しました。 オープンDesktop OpenGL emulation
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
emscripten-core/emscripten#27948 · コメント 4 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
emscripten-core/emscripten#27906 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
run_python, run_python_compiler could readlink -f対応中かも @kapouer が 129 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
emscripten-core/emscripten#27211 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
emscripten-core/emscripten の issue をすべて見る
似ている issue
-
libc++ test-suite
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
llvm/llvm-project#239851 ·
メンテナーはふだん 1 日以内に返信
-
Bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
bug :bug:
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
comp-documentation
難易度 1/5 1時間未満 初心者へのやさしさ 84/100
ClickHouse/ClickHouse#129829 ·
メンテナーはふだん 1 日以内に返信
-
feature request Python
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 2 日以内に返信