Skip to content

Commit 7d291a7

Browse files
authored
Rename tests/ to test/. NFC (#17502)
The name of the directory where tests live is more commonly known as just `test`. This matches the convention used by sister projects of emscripten: llvm, binaryen, and wabt. This is big change but git is good a tracking renames so anyone with outstanding changes in this directory should not have any issues.
1 parent 0d92586 commit 7d291a7

File tree

4,727 files changed

+175
-172
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

4,727 files changed

+175
-172
lines changed

.circleci/config.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -108,12 +108,12 @@ commands:
108108
name: embuilder build ALL
109109
command: |
110110
./embuilder build ALL
111-
./tests/runner test_hello_world
111+
./test/runner test_hello_world
112112
- run:
113113
name: embuilder (LTO)
114114
command: |
115115
./embuilder build MINIMAL --lto
116-
./tests/runner test_hello_world
116+
./test/runner test_hello_world
117117
- run:
118118
name: embuilder (WASM64)
119119
command: |
@@ -122,12 +122,12 @@ commands:
122122
name: embuilder (PIC)
123123
command: |
124124
./embuilder build MINIMAL_PIC --pic
125-
./tests/runner test_hello_world
125+
./test/runner test_hello_world
126126
- run:
127127
name: embuilder (PIC+LTO)
128128
command: |
129129
./embuilder build MINIMAL --pic --lto
130-
./tests/runner test_hello_world
130+
./test/runner test_hello_world
131131
- run:
132132
name: freeze cache
133133
command: |
@@ -169,7 +169,7 @@ commands:
169169
- run:
170170
name: run tests
171171
command: |
172-
./tests/runner << parameters.test_targets >>
172+
./test/runner << parameters.test_targets >>
173173
$EMSDK_PYTHON ./tools/check_clean.py
174174
run-tests-linux:
175175
description: "Runs emscripten tests"
@@ -229,7 +229,7 @@ commands:
229229
echo "-----"
230230
echo "Running browser tests"
231231
echo "-----"
232-
tests/runner browser skip:browser.test_sdl2_mouse skip:browser.test_html5_webgl_create_context skip:browser.test_webgl_offscreen_canvas_in_pthread skip:browser.test_webgl_offscreen_canvas_in_mainthread_after_pthread skip:browser.test_glut_glutget
232+
test/runner browser skip:browser.test_sdl2_mouse skip:browser.test_html5_webgl_create_context skip:browser.test_webgl_offscreen_canvas_in_pthread skip:browser.test_webgl_offscreen_canvas_in_mainthread_after_pthread skip:browser.test_glut_glutget
233233
# posix and emrun suites are disabled because firefox errors on
234234
# "Firefox is already running, but is not responding."
235235
# TODO: find out a way to shut down and restart firefox
@@ -256,8 +256,8 @@ commands:
256256
# PIC version of libSDL which is used by test_sdl2_misc_main_module
257257
export EM_FROZEN_CACHE=""
258258
# skip test_zzz_zzz_4gb_fail as it OOMs on the current bot
259-
tests/runner browser posixtest_browser.test_pthread_create_1_1 skip:browser.test_zzz_zzz_4gb_fail
260-
tests/runner emrun
259+
test/runner browser posixtest_browser.test_pthread_create_1_1 skip:browser.test_zzz_zzz_4gb_fail
260+
test/runner emrun
261261
test-sockets-chrome:
262262
description: "Runs emscripten sockets tests under chrome"
263263
steps:
@@ -276,7 +276,7 @@ commands:
276276
CHROME_FLAGS_NOCACHE: "--disk-cache-dir=/dev/null --disk-cache-size=1 --media-cache-size=1 --disable-application-cache --incognito"
277277
command: |
278278
export EMTEST_BROWSER="/usr/bin/google-chrome $CHROME_FLAGS_BASE $CHROME_FLAGS_HEADLESS $CHROME_FLAGS_WASM $CHROME_FLAGS_NOCACHE"
279-
tests/runner sockets
279+
test/runner sockets
280280
281281
jobs:
282282
build-docs:

.coveragerc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[run]
22
source = .
3-
omit = ./tests/*
3+
omit = ./test/*
44
./third_party/*
55
./tools/emcoverage.py
66
test.py

.eslintrc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ ignorePatterns:
1010
- "site/"
1111
- "cache/"
1212
- "third_party/"
13-
- "tests/"
13+
- "test/"
1414
- "src/polyfill/"
1515
- "src/library*.js"
1616
- "src/runtime_*.js"

.flake8

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ exclude =
44
./third_party/, # third-party code
55
./tools/filelock.py, # third-party code
66
./tools/scons/, # third-party code
7-
./tests/third_party/, # third-party code
7+
./test/third_party/, # third-party code
88
./site/source/conf.py,
99
./tools/debug/,
1010
./system/lib/, # system libraries
@@ -14,5 +14,5 @@ exclude =
1414
# they need to implement the specific plugin APIs
1515
per-file-ignores =
1616
./tools/ports/*.py: U100
17-
./tests/*.py: U100
17+
./test/*.py: U100
1818
./tools/toolchain_profiler.py: U100

.gitattributes

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
tools/crunch-worker.js -diff
44
third_party/lzma.js/lzma-decoder.js -diff
55
third_party/lzma.js/lzma-full.js -diff
6-
tests/other/test_emsize.js -diff
6+
test/other/test_emsize.js -diff
77
src/emscripten-source-map.min.js -diff
8-
tests/* linguist-vendored
8+
test/* linguist-vendored
99
third_party/* linguist-vendored
1010
system/ linguist-vendored
1111

.gitmodules

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
[submodule "tests/third_party/posixtestsuite"]
2-
path = tests/third_party/posixtestsuite
1+
[submodule "test/third_party/posixtestsuite"]
2+
path = test/third_party/posixtestsuite
33
url = https://github.com/emscripten-core/posixtestsuite

ChangeLog.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ See docs/process.md for more on how version tagging works.
2020

2121
3.1.18
2222
------
23+
- The tests/ directory was renamed to just test/ to match other project close
24+
emscripten (llvm, wabt, binaryen). This should not effect any users of
25+
emscripten, only developers. (#17502)
2326

2427
3.1.17 - 07/22/2022
2528
------

docs/packaging.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ linux distributions, or other downstream SDKs.
66

77
Firstly, we provide an install script in `tools/install.py`. This allows
88
just the end-user parts of emscripten to be installed. For example this avoids
9-
including the `tests/third_party` directory which is of that biggest parts
9+
including the `test/third_party` directory which is of that biggest parts
1010
of the source tree.
1111

1212
If you prefer, you can use `make install` or `make dist` which invokes

emcc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1118,7 +1118,7 @@ def run(args):
11181118
compiler = shared.EMCC
11191119
if run_via_emxx:
11201120
compiler = shared.EMXX
1121-
cmd = [compiler, utils.path_from_root('tests', input_file), '-v', '-c', '-o', temp_target] + args
1121+
cmd = [compiler, utils.path_from_root('test', input_file), '-v', '-c', '-o', temp_target] + args
11221122
proc = run_process(cmd, stderr=PIPE, check=False)
11231123
if proc.returncode != 0:
11241124
print(proc.stderr)

requirements-dev.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@ jinja2<3.1
1818
# Pin docutils because newer versions are not compatible with sphinx 2.4.4
1919
docutils==0.17.1
2020

21-
# Needed by tests/test_sockets.py
21+
# Needed by test/test_sockets.py
2222
websockify==0.10.0

site/source/docs/api_reference/Filesystem-API.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Emscripten predominantly compiles code that uses synchronous file I/O, so the ma
1616

1717
File data in Emscripten is partitioned by mounted file systems. Several file systems are provided. An instance of :ref:`MEMFS <filesystem-api-memfs>` is mounted to ``/`` by default. The subdirectories `/home/web_user` and `/tmp` are also created automatically, in addition to several other special devices and streams (e.g. `/dev/null`, `/dev/random`, `/dev/stdin`, `/proc/self/fd`); see `FS.staticInit()` in the FS library for full details. Instances of :ref:`NODEFS <filesystem-api-nodefs>` and :ref:`IDBFS <filesystem-api-idbfs>` can be mounted to other directories if your application needs to :ref:`persist data <filesystem-api-persist-data>`.
1818

19-
The automatic tests in `tests/test_core.py <https://github.com/emscripten-core/emscripten/blob/1.29.12/tests/test_core.py#L4285>`_ (search for ``test_files``) contain many examples of how to use this API. The :ref:`tutorial <tutorial-files>` also shows how to pre-load a file so that it can be read from compiled C/C++.
19+
The automatic tests in `test/test_core.py <https://github.com/emscripten-core/emscripten/blob/1.29.12/tests/test_core.py#L4285>`_ (search for ``test_files``) contain many examples of how to use this API. The :ref:`tutorial <tutorial-files>` also shows how to pre-load a file so that it can be read from compiled C/C++.
2020

2121
A high level overview of the way File Systems work in Emscripten-ported code is provided in the :ref:`file-system-overview`.
2222

@@ -75,7 +75,7 @@ NODEFS
7575

7676
This file system lets a program in *node* map directories (via a mount operation) on the host filesystem to directories in Emscripten's virtual filesystem. It uses node's synchronous `FS API <http://nodejs.org/api/fs.html>`_ to immediately persist any data written to the Emscripten file system to your local disk.
7777

78-
See `this test <https://github.com/emscripten-core/emscripten/blob/main/tests/fs/test_nodefs_rw.c>`_ for an example.
78+
See `this test <https://github.com/emscripten-core/emscripten/blob/main/test/fs/test_nodefs_rw.c>`_ for an example.
7979

8080
.. _filesystem-api-noderawfs:
8181

@@ -260,7 +260,7 @@ File system API
260260
});
261261
}
262262
263-
A real example of this functionality can be seen in `test_idbfs_sync.c <https://github.com/emscripten-core/emscripten/blob/main/tests/fs/test_idbfs_sync.c>`_.
263+
A real example of this functionality can be seen in `test_idbfs_sync.c <https://github.com/emscripten-core/emscripten/blob/main/test/fs/test_idbfs_sync.c>`_.
264264

265265
:param bool populate: ``true`` to initialize Emscripten's file system data with the data from the file system's persistent source, and ``false`` to save Emscripten`s file system data to the file system's persistent source.
266266
:param callback: A notification callback function that is invoked on completion of the synchronization. If an error occurred, it will be provided as a parameter to this function.

site/source/docs/api_reference/emscripten.h.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1282,7 +1282,7 @@ Typedefs
12821282
12831283
Unaligned types. These may be used to force LLVM to emit unaligned loads/stores in places in your code where :ref:`SAFE_HEAP <debugging-SAFE-HEAP>` found an unaligned operation.
12841284
1285-
For usage examples see `tests/core/test_set_align.c <https://github.com/emscripten-core/emscripten/blob/main/tests/core/test_set_align.c>`_.
1285+
For usage examples see `test/core/test_set_align.c <https://github.com/emscripten-core/emscripten/blob/main/test/core/test_set_align.c>`_.
12861286
12871287
.. note:: It is better to avoid unaligned operations, but if you are reading from a packed stream of bytes or such, these types may be useful!
12881288

site/source/docs/api_reference/fetch.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ attributes:
8787
}
8888
8989
For a full example, see the file
90-
tests/fetch/example_async_xhr_to_memory_via_indexeddb.c.
90+
``test/fetch/example_async_xhr_to_memory_via_indexeddb.c``.
9191

9292
Persisting data bytes from memory
9393
---------------------------------

site/source/docs/api_reference/html5.h.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,9 @@ Test/Example code
131131

132132
The HTML5 test code demonstrates how to use this API:
133133

134-
- `test_html5_core.c <https://github.com/emscripten-core/emscripten/blob/main/tests/test_html5_core.c>`_
135-
- `test_html5_fullscreen.c <https://github.com/emscripten-core/emscripten/blob/main/tests/test_html5_fullscreen.c>`_
136-
- `test_html5_mouse.c <https://github.com/emscripten-core/emscripten/blob/main/tests/test_html5_mouse.c>`_
134+
- `test_html5_core.c <https://github.com/emscripten-core/emscripten/blob/main/test/test_html5_core.c>`_
135+
- `test_html5_fullscreen.c <https://github.com/emscripten-core/emscripten/blob/main/test/test_html5_fullscreen.c>`_
136+
- `test_html5_mouse.c <https://github.com/emscripten-core/emscripten/blob/main/test/test_html5_mouse.c>`_
137137

138138

139139
General types

site/source/docs/api_reference/module.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,15 +159,15 @@ Other methods
159159

160160
.. js:function:: Module.getPreloadedPackage
161161

162-
If you want to manually manage the download of .data file packages for custom caching, progress reporting and error handling behavior, you can implement the ``Module.getPreloadedPackage = function(remotePackageName, remotePackageSize)`` callback to provide the contents of the data files back to the file loading scripts. The return value of this callback should be an Arraybuffer with the contents of the downloade file data. See file ``tests/manual_download_data.html`` and the test ``browser.test_preload_file_with_manual_data_download`` for an example.
162+
If you want to manually manage the download of .data file packages for custom caching, progress reporting and error handling behavior, you can implement the ``Module.getPreloadedPackage = function(remotePackageName, remotePackageSize)`` callback to provide the contents of the data files back to the file loading scripts. The return value of this callback should be an Arraybuffer with the contents of the downloade file data. See file ``test/manual_download_data.html`` and the test ``browser.test_preload_file_with_manual_data_download`` for an example.
163163

164164
.. js:function:: Module.instantiateWasm
165165

166166
When targeting WebAssembly, Module.instantiateWasm is an optional user-implemented callback function that the Emscripten runtime calls to perform the WebAssembly instantiation action. The callback function will be called with two parameters, ``imports`` and ``successCallback``. ``imports`` is a JS object which contains all the function imports that need to be passed to the WebAssembly Module when instantiating, and once instantiated, this callback function should call ``successCallback()`` with the generated WebAssembly Instance object.
167167

168168
The instantiation can be performed either synchronously or asynchronously. The return value of this function should contain the ``exports`` object of the instantiated WebAssembly Module, or an empty dictionary object ``{}`` if the instantiation is performed asynchronously, or ``false`` if instantiation failed.
169169

170-
Overriding the WebAssembly instantiation procedure via this function is useful when you have other custom asynchronous startup actions or downloads that can be performed in parallel to WebAssembly compilation. Implementing this callback allows performing all of these in parallel. See the file ``tests/manual_wasm_instantiate.html`` and the test ``browser.test_manual_wasm_instantiate`` for an example of how this construct works in action.
170+
Overriding the WebAssembly instantiation procedure via this function is useful when you have other custom asynchronous startup actions or downloads that can be performed in parallel to WebAssembly compilation. Implementing this callback allows performing all of these in parallel. See the file ``test/manual_wasm_instantiate.html`` and the test ``browser.test_manual_wasm_instantiate`` for an example of how this construct works in action.
171171

172172
.. note:: Sanitizers or source map is currently not supported if overriding WebAssembly instantiation with Module.instantiateWasm. Providing Module.instantiateWasm when source map or sanitizer is enabled can prevent WebAssembly instantiation from finishing.
173173

site/source/docs/api_reference/proxying.h.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,5 +135,5 @@ defined within namespace ``emscripten``.
135135
``emscripten_proxying_finish`` or ``ProxyingCtx::finish`` and ``false`` otherwise.
136136
137137
.. _proxying.h: https://github.com/emscripten-core/emscripten/blob/main/system/include/emscripten/proxying.h
138-
.. _test_pthread_proxying.c: https://github.com/emscripten-core/emscripten/blob/main/tests/pthread/test_pthread_proxying.c
139-
.. _test_pthread_proxying_cpp.cpp: https://github.com/emscripten-core/emscripten/blob/main/tests/pthread/test_pthread_proxying_cpp.cpp
138+
.. _test_pthread_proxying.c: https://github.com/emscripten-core/emscripten/blob/main/test/pthread/test_pthread_proxying.c
139+
.. _test_pthread_proxying_cpp.cpp: https://github.com/emscripten-core/emscripten/blob/main/test/pthread/test_pthread_proxying_cpp.cpp

site/source/docs/api_reference/wasm_workers.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ Pthreads and Wasm Workers share several similarities:
8989
* Both types of threads have thread-local storage (TLS) support via ``thread_local`` (C++11),
9090
``_Thread_local`` (C11) and ``__thread`` (GNU11) keywords.
9191
* Both types of threads support TLS via explicitly linked in Wasm globals (see
92-
``tests/wasm_worker/wasm_worker_tls_wasm_assembly.c/.S`` for example code)
92+
``test/wasm_worker/wasm_worker_tls_wasm_assembly.c/.S`` for example code)
9393
* Both types of threads have a concept of a thread ID (``pthread_self()`` for pthreads,
9494
``emscripten_wasm_worker_self_id()`` for Wasm Workers)
9595
* Both types of threads can perform an event-based and an infinite loop programming model.
@@ -352,4 +352,4 @@ The following build options are not supported at the moment with Wasm Workers:
352352
Example Code
353353
============
354354

355-
See the directory tests/wasm_workers/ for code examples on different Wasm Workers API functionality.
355+
See the directory ``test/wasm_workers/`` for code examples on different Wasm Workers API functionality.

site/source/docs/building_from_source/verify_emscripten_environment.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ The next test is to actually build some code! On the command prompt navigate to
4343
::
4444

4545
cd emscripten/<version of emscripten you installed>
46-
./emcc tests/hello_world.cpp
46+
./emcc test/hello_world.cpp
4747

4848
This command should complete without warnings and you should find the newly-compiled JavaScript file (**a.out.js**) in the current directory.
4949

site/source/docs/compiling/Building-Projects.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ Using libraries
189189
Built-in support is available for a number of standard libraries: *libc*, *libc++* and *SDL*. These will automatically be linked when you compile code that uses them (you do not even need to add ``-lSDL``, but see below for more SDL-specific details).
190190

191191
If your project uses other libraries, for example
192-
`zlib <https://github.com/emscripten-core/emscripten/tree/main/tests/third_party/zlib>`_
192+
`zlib <https://github.com/emscripten-core/emscripten/tree/main/test/third_party/zlib>`_
193193
or *glib*, you will need to build and link them. The normal approach is to build
194194
the libraries (to object files, or ``.a`` archives of them) and then link those
195195
with your main program to emit JavaScript+WebAssembly.
@@ -217,7 +217,7 @@ Emscripten Ports is a collection of useful libraries, ported to Emscripten. They
217217

218218
.. code-block:: bash
219219
220-
emcc tests/sdl2glshader.c -sUSE_SDL=2 -sLEGACY_GL_EMULATION -o sdl2.html
220+
emcc test/sdl2glshader.c -sUSE_SDL=2 -sLEGACY_GL_EMULATION -o sdl2.html
221221
222222
You should see some notifications about SDL2 being used, and built if it wasn't previously. You can then view ``sdl2.html`` in your browser.
223223

@@ -370,7 +370,7 @@ set via an environment variable. e.g::
370370
Examples / test code
371371
====================
372372

373-
The Emscripten test suite (`tests/runner.py <https://github.com/emscripten-core/emscripten/blob/main/tests/runner.py>`_) contains a number of good examples — large C/C++ projects that are built using their normal build systems as described above: `freetype <https://github.com/emscripten-core/emscripten/tree/main/tests/third_party/freetype>`_, `openjpeg <https://github.com/emscripten-core/emscripten/tree/main/tests/third_party/openjpeg>`_, `zlib <https://github.com/emscripten-core/emscripten/tree/main/tests/third_party/zlib>`_, `bullet <https://github.com/emscripten-core/emscripten/tree/main/tests/third_party/bullet>`_ and `poppler <https://github.com/emscripten-core/emscripten/tree/main/tests/third_party/poppler>`_.
373+
The Emscripten test suite (`test/runner.py <https://github.com/emscripten-core/emscripten/blob/main/test/runner.py>`_) contains a number of good examples — large C/C++ projects that are built using their normal build systems as described above: `freetype <https://github.com/emscripten-core/emscripten/tree/main/test/third_party/freetype>`_, `openjpeg <https://github.com/emscripten-core/emscripten/tree/main/test/third_party/openjpeg>`_, `zlib <https://github.com/emscripten-core/emscripten/tree/main/test/third_party/zlib>`_, `bullet <https://github.com/emscripten-core/emscripten/tree/main/test/third_party/bullet>`_ and `poppler <https://github.com/emscripten-core/emscripten/tree/main/test/third_party/poppler>`_.
374374

375375
It is also worth looking at the build scripts in the `ammo.js <https://github.com/kripken/ammo.js/blob/main/CMakeLists.txt>`_ project.
376376

site/source/docs/contributing/developers_guide.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ Patches should be submitted as *pull requests* in the normal way on GitHub.
5252
When submitting patches, please:
5353

5454
- Add an automatic test if you add any new functionality or fix a bug. Search
55-
in ``tests/*.py`` for related tests, as often the simplest thing is to add to
55+
in ``test/*.py`` for related tests, as often the simplest thing is to add to
5656
an existing one. If you're not sure how to test your code, feel free to ask
5757
for help.
5858
- Pay attention to our coding style specified in

0 commit comments

Comments
 (0)