Skip to content

Commit

Permalink
feat: Add OO interface for module objects
Browse files Browse the repository at this point in the history
  • Loading branch information
jubianchi committed Feb 18, 2021
1 parent fb4d562 commit 0cd0969
Show file tree
Hide file tree
Showing 32 changed files with 3,686 additions and 462 deletions.
3 changes: 1 addition & 2 deletions .atoum.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@

$php = getenv('PHP_EXECUTABLE') ?: 'php';

$script->enableBranchAndPathCoverage();
$runner->setPhpPath($php.' -dextension='.__DIR__.'/ext/modules/wasm.so -dzend_extension=/Users/jubianchi.wasm/repositories/php/php-src/php-build-debug/lib/php/extensions/debug-non-zts-20200930/xdebug.so -dxdebug.mode=coverage');
$runner->setPhpPath($php.' -dextension='.__DIR__.'/ext/modules/wasm.so');
$runner->addTestsFromDirectory('tests');
2 changes: 1 addition & 1 deletion .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 7.4
php-version: 8.0
- name: Checkout code
uses: actions/checkout@v2
- name: Configure
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,39 +21,39 @@ jobs:
include:
- id: linux-x64
os: ubuntu-18.04
php: '7.3'
php: 7.3
# TODO(jubianchi): Remove this once PHP 7.3 is supported
allow_failure: true
- id: linux-x64
os: ubuntu-18.04
php: '7.4'
php: 7.4
# TODO(jubianchi): Remove this once PHP 7.4 is supported
allow_failure: true
- id: linux-x64
os: ubuntu-18.04
php: '8.0'
php: 8.0
allow_failure: false
- id: linux-x64
os: ubuntu-18.04
php: '8.1'
php: 8.1
allow_failure: false
- id: macos-x64
os: macos-latest
php: '7.3'
php: 7.3
# TODO(jubianchi): Remove this once PHP 7.3 is supported
allow_failure: true
- id: macos-x64
os: macos-latest
# TODO(jubianchi): Remove this once PHP 7.4 is supported
php: '7.4'
php: 7.4
allow_failure: true
- id: macos-x64
os: macos-latest
php: '8.0'
php: 8.0
allow_failure: false
- id: macos-x64
os: macos-latest
php: '8.1'
php: 8.1
allow_failure: false
steps:
- name: Setup PHP
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,4 @@ ext/tests/**/*.sh
/vendor
/.phpdoc
/.php_cs.cache
/.phpunit.result.cache
7 changes: 4 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ include ext/Makefile
documentation: .phpdoc/build/index.html

.PHONY: unit
unit: vendor/atoum/atoum/bin/atoum
PHP_EXECUTABLE="$(PHP_EXECUTABLE)" $(PHP_EXECUTABLE) $(PHP_TEST_SETTINGS) -dzend_extension=xdebug.so $<
unit: vendor/atoum/atoum/bin/atoum vendor/phpunit/phpunit/phpunit
PHP_EXECUTABLE="$(PHP_EXECUTABLE)" $(PHP_EXECUTABLE) $(PHP_TEST_SETTINGS) $<
PHP_EXECUTABLE="$(PHP_EXECUTABLE)" $(PHP_EXECUTABLE) $(PHP_TEST_SETTINGS) -dextension=ext/modules/wasm.so $(filter-out $<, $^)

.PHONY: lint
lint: vendor/friendsofphp/php-cs-fixer/php-cs-fixer
Expand All @@ -13,7 +14,7 @@ lint: vendor/friendsofphp/php-cs-fixer/php-cs-fixer
.phpdoc/build/index.html: vendor/phpdocumentor/phpdocumentor/bin/phpdoc phpdoc.dist.xml ext/src/wasmer_*.stub.php src/*.php src/Exception/*.php src/Type/*.php
$<

vendor/phpdocumentor/phpdocumentor/bin/phpdoc vendor/friendsofphp/php-cs-fixer/php-cs-fixer vendor/atoum/atoum/bin/atoum: composer.lock
vendor/phpdocumentor/phpdocumentor/bin/phpdoc vendor/friendsofphp/php-cs-fixer/php-cs-fixer vendor/atoum/atoum/bin/atoum vendor/phpunit/phpunit/phpunit: composer.lock
composer install

composer.lock: composer.json
Expand Down
8 changes: 7 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"require-dev": {
"phpdocumentor/phpdocumentor": "@dev",
"friendsofphp/php-cs-fixer": "@dev",
"atoum/atoum": "@stable"
"atoum/atoum": "@stable",
"phpunit/phpunit": "@stable"
},
"minimum-stability": "dev",
"license": "MIT",
Expand All @@ -28,5 +29,10 @@
"psr-4": {
"Wasm\\": "src"
}
},
"autoload-dev": {
"psr-4": {
"Wasm\\Tests\\": "tests"
}
}
}
Loading

0 comments on commit 0cd0969

Please sign in to comment.