Skip to content

Commit

Permalink
feat: move conformance tests to a separate repository
Browse files Browse the repository at this point in the history
  • Loading branch information
ramsey committed Jul 18, 2023
1 parent cc0cd3a commit 0b41c08
Show file tree
Hide file tree
Showing 161 changed files with 178 additions and 7,046 deletions.
4 changes: 0 additions & 4 deletions .clang-format

This file was deleted.

29 changes: 0 additions & 29 deletions .clang-tidy

This file was deleted.

11 changes: 1 addition & 10 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,5 @@ charset = utf-8
indent_style = space
indent_size = 4

[*.{c,cpp,h,hpp}]
[*.{yml,yaml}]
indent_size = 2

[*.{yml,yaml,m4,w32}]
indent_size = 2

[*.phpt]
trim_trailing_whitespace = false

[Makefile.frag]
indent_style = tab
8 changes: 0 additions & 8 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,20 +1,15 @@
/.clang-format export-ignore
/.clang-tidy export-ignore
/.editorconfig export-ignore
/.gitattributes export-ignore
/.github/ export-ignore
/.gitignore export-ignore
/.gitmodules export-ignore
/bin/ export-ignore
/build/ export-ignore
/captainhook.json export-ignore
/CHANGELOG.md export-ignore
/codecov.yml export-ignore
/CODE_OF_CONDUCT.md export-ignore
/composer.json export-ignore
/CONTRIBUTING.md export-ignore
/conventional-commits.json export-ignore
/docker-compose.yml export-ignore
/docs/ export-ignore
/phpcs.xml.dist export-ignore
/phpstan.neon.dist export-ignore
Expand All @@ -23,6 +18,3 @@
/psalm.xml export-ignore
/resources/ export-ignore
/SECURITY.md export-ignore
/tests/Pest.php export-ignore
/tests/pest/ export-ignore
/tools/ export-ignore
85 changes: 22 additions & 63 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,55 +25,26 @@ jobs:

steps:
- name: "Checkout repository"
uses: "actions/checkout@v3.5.3"

- name: "Check formatting (clang-format)"
uses: "jidicula/clang-format-action@v4.11.0"
with:
clang-format-version: "16"
check-path: "src"
exclude-regex: "^.*arginfo\\.h$"

memcheck:
name: "Test for Memory Leaks"
runs-on: "ubuntu-latest"

steps:
- name: "Checkout repository"
uses: "actions/checkout@v3.5.3"

- name: "Install Valgrind"
run: |
sudo apt-get update
sudo apt-get install -y valgrind
valgrind --version
uses: "actions/checkout@v3.5.2"

- name: "Install PHP"
uses: "shivammathur/setup-php@2.25.4"
uses: "shivammathur/setup-php@2.25.2"
with:
php-version: "latest"
extensions: "intl-70.1"
coverage: "none"
env:
debug: true
phpts: "ts"

- name: "Install dependencies (Composer)"
uses: "ramsey/composer-install@2.2.0"

- name: "Build and install ecma_intl"
run: |
phpize
./configure --enable-ecma_intl
make -j$(nproc)
php -d extension="$PWD/modules/ecma_intl.so" --ri ecma_intl
- name: "Check syntax (php-parallel-lint)"
run: "composer dev:lint:syntax"

- name: "Run tests (PHPT with memcheck)"
run: "composer dev:test:memcheck"
- name: "Check coding standards (PHP_CodeSniffer)"
run: "composer dev:lint:style"

tests:
name: "Tests: PHP ${{ matrix.php }}, ICU ${{ matrix.icu }}"
needs: ["coding-standards", "memcheck"]
conformance-tests:
name: "Conformance tests"
needs: ["coding-standards"]
runs-on: "ubuntu-latest"

strategy:
Expand All @@ -83,44 +54,32 @@ jobs:
- "8.2"
icu:
- "70.1"
- "71.1"
- "72.1"
- "73.1"

steps:
- name: "Checkout repository"
uses: "actions/checkout@v3.5.3"

- name: "Install Criterion"
run: |
sudo apt-get update
sudo apt-get install -y libcriterion3 libcriterion-dev
uses: "actions/checkout@v3.5.2"
with:
submodules: true

- name: "Install PHP"
uses: "shivammathur/setup-php@2.25.4"
uses: "shivammathur/setup-php@2.25.2"
with:
php-version: "${{ matrix.php }}"
extensions: "intl-${{ matrix.icu }}"
ini-values: "extension=ecma_intl"
coverage: "none"
env:
debug: true
phpts: "ts"

- name: "Install dependencies (Composer)"
uses: "ramsey/composer-install@2.2.0"

- name: "Build and install ecma_intl"
run: |
cd ./resources/ext/
phpize
./configure --enable-ecma_intl --enable-criterion
./configure --enable-ecma_intl
make -j$(nproc)
php -d extension="$PWD/modules/ecma_intl.so" --ri ecma_intl
sudo make install
- name: "Run tests (PHPT)"
run: "composer dev:test:phpt"

- name: "Run tests (Criterion)"
run: "composer dev:test:criterion"
- name: "Install dependencies (Composer)"
uses: "ramsey/composer-install@2.2.0"

- name: "Run tests (Pest)"
run: "composer dev:test:pest -- --colors=always"
- name: "Run conformance tests (Pest)"
shell: "bash"
run: "composer dev:test:pest"
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[submodule "resources/test262"]
path = resources/test262
url = https://github.com/tc39/test262.git
[submodule "resources/ext"]
path = resources/ext
url = https://github.com/ramsey/php-ecma-intl-ext.git
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# php-ecma-intl/ext Changelog
# php-ecma-intl/test Changelog

All notable changes to this project will be documented in this file.

Expand Down
21 changes: 13 additions & 8 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ code.

You can find help and discussion in the following places:

* GitHub Issues: <https://github.com/php-ecma-intl/ext/issues>
* GitHub Issues: <https://github.com/php-ecma-intl/test/issues>

## Reporting Bugs

Expand Down Expand Up @@ -72,11 +72,11 @@ When you do begin working on your feature, here are some guidelines to consider:
We will use this description to update the CHANGELOG. If there is no
description, or it does not adequately describe your feature, we may ask you
to update the description.
* php-ecma-intl/ext follows a superset of **[PSR-12 coding standard][psr-12]**.
* php-ecma-intl/test follows a superset of **[PSR-12 coding standard][psr-12]**.
Please ensure your code does, too. _Hint: run `composer dev:lint` to check._
* Please **write tests** for any new features you add.
* Please **ensure that tests pass** before submitting your pull request.
php-ecma-intl/ext automatically runs tests for pull requests. However,
php-ecma-intl/test automatically runs tests for pull requests. However,
running the tests locally will help save time. _Hint: run `composer test`._
* **Use topic/feature branches.** Please do not ask to pull from your main branch.
* For more information, see "[Understanding the GitHub flow][gh-flow]."
Expand Down Expand Up @@ -150,8 +150,13 @@ composer dev:analyze

### Project Structure

This project uses [pds/skeleton](https://github.com/php-pds/skeleton) as its
base folder structure and layout.
Files within this test suite use the [Pest testing framework](https://pestphp.com)
and are named according to their names and paths within the original Test262
repository. For example, the test file
`intl402/Intl/getCanonicalLocales/complex-region-subtag-replacement.php` has a
corresponding test file in Test262 at the path
`test/intl402/Intl/getCanonicalLocales/complex-region-subtag-replacement.js`.


### Running Tests

Expand All @@ -169,9 +174,9 @@ composer test
CaptainHook will automatically run all tests before pushing to the remote
repository.

[github]: https://github.com/php-ecma-intl/ext
[issues]: https://github.com/php-ecma-intl/ext/issues
[pull requests]: https://github.com/php-ecma-intl/ext/pulls
[github]: https://github.com/php-ecma-intl/test
[issues]: https://github.com/php-ecma-intl/test/issues
[pull requests]: https://github.com/php-ecma-intl/test/pulls
[psr-12]: https://www.php-fig.org/psr/psr-12/
[gh-flow]: https://guides.github.com/introduction/flow/
[conventional commits]: https://www.conventionalcommits.org/
2 changes: 0 additions & 2 deletions CREDITS

This file was deleted.

Empty file removed EXPERIMENTAL
Empty file.
40 changes: 24 additions & 16 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,19 +1,27 @@
Copyright (c) 2023 Ben Ramsey <ben@benramsey.com>
Copyright (c) 2023 php-ecma-intl contributors.
All rights reserved.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 changes: 0 additions & 30 deletions Makefile.frag

This file was deleted.

31 changes: 0 additions & 31 deletions NOTICE
Original file line number Diff line number Diff line change
Expand Up @@ -3,37 +3,6 @@ use of which is hereby acknowledged.

--------------------------------------------------------------------------------

The WebKit Open Source Project and JavaScriptCore Project

Copyright (c) 2015 Andy VanWagoner (andy@vanwagoner.family)
Copyright (c) 2015 Sukolsak Sakshuwong (sukolsak@gmail.com)
Copyright (c) 2016-2021 Apple Inc. All rights reserved.
Copyright (c) 2020 Sony Interactive Entertainment Inc.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:

1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
THE POSSIBILITY OF SUCH DAMAGE.

--------------------------------------------------------------------------------

Test262: ECMAScript Test Suite

Copyright (c) 2011, 2012 Norbert Lindenberg. All rights reserved.
Expand Down
Loading

0 comments on commit 0b41c08

Please sign in to comment.