Skip to content

Commit a679600

Browse files
committed
Merge branch 'master' of github.com:seanmorris/php-wasm
2 parents 901922f + 76f7e08 commit a679600

File tree

17 files changed

+203
-184
lines changed

17 files changed

+203
-184
lines changed

Makefile

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -898,9 +898,11 @@ NPM_PUBLISH_DRY?=--dry-run
898898
publish:
899899
npm publish ${NPM_PUBLISH_DRY}
900900

901-
test:
902-
${DOCKER_RUN} echo "Works!"
903-
${MAKE} node-mjs
901+
test: node-mjs
902+
${MAKE} test-node
903+
${MAKE} test-deno
904+
905+
test-node:
904906
WITH_LIBXML=${WITH_LIBXML} \
905907
WITH_LIBZIP=${WITH_LIBZIP} \
906908
WITH_ICONV=${WITH_ICONV} \
@@ -921,6 +923,27 @@ test:
921923
WITH_OPENSSL=${WITH_OPENSSL} \
922924
WITH_INTL=${WITH_INTL} node --test ${TEST_LIST} `ls test/*.mjs`
923925

926+
test-deno:
927+
WITH_LIBXML=${WITH_LIBXML} \
928+
WITH_LIBZIP=${WITH_LIBZIP} \
929+
WITH_ICONV=${WITH_ICONV} \
930+
WITH_SQLITE=${WITH_ICONV} \
931+
WITH_GD=${WITH_GD} \
932+
WITH_PHAR=${WITH_PHAR} \
933+
WITH_ZLIB=${WITH_ZLIB} \
934+
WITH_LIBPNG=${WITH_LIBPNG} \
935+
WITH_FREETYPE=${WITH_FREETYPE} \
936+
WITH_LIBJPEG=${WITH_LIBJPEG} \
937+
WITH_DOM=${WITH_DOM} \
938+
WITH_SIMPLEXML=${WITH_SIMPLEXML} \
939+
WITH_XML=${WITH_XML} \
940+
WITH_YAML=${WITH_YAML} \
941+
WITH_TIDY=${WITH_TIDY} \
942+
WITH_MBSTRING=${WITH_MBSTRING} \
943+
WITH_ONIGURUMA=${WITH_ONIGURUMA} \
944+
WITH_OPENSSL=${WITH_OPENSSL} \
945+
WITH_INTL=${WITH_INTL} deno test ${TEST_LIST} `ls test/*.mjs` --allow-read --allow-write --allow-env --allow-net
946+
924947
run:
925948
${DOCKER_ENV} emscripten-builder bash
926949

demo-node/index.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env node
2-
import http from 'http';
2+
import http from 'node:http';
33
import { PhpCgiNode } from 'php-cgi-wasm/PhpCgiNode.mjs';
44

55
const php = new PhpCgiNode({

packages/dom/test/basic.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import { test } from 'node:test';
22
import { strict as assert } from 'node:assert';
33
import { PhpNode } from '../../../packages/php-wasm/PhpNode.mjs';
4+
import { env } from 'node:process';
45

56
test('DOM Extension is enabled.', async () => {
6-
const php = process.env.WITH_DOM === 'dynamic'
7+
const php = env.WITH_DOM === 'dynamic'
78
? new PhpNode({sharedLibs:[`php${PhpNode.phpVersion}-dom.so`]})
89
: new PhpNode;
910

packages/gd/test/basic.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import { test } from 'node:test';
22
import { strict as assert } from 'node:assert';
33
import { PhpNode } from '../../../packages/php-wasm/PhpNode.mjs';
4+
import { env } from 'node:process';
45

56
test('GD Extension is enabled.', async () => {
6-
const php = process.env.WITH_GD === 'dynamic'
7+
const php = env.WITH_GD === 'dynamic'
78
? new PhpNode({sharedLibs:[`php${PhpNode.phpVersion}-gd.so`]})
89
: new PhpNode;
910

packages/iconv/test/basic.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import { test } from 'node:test';
22
import { strict as assert } from 'node:assert';
33
import { PhpNode } from '../../../packages/php-wasm/PhpNode.mjs';
4+
import { env } from 'node:process';
45

56
test('Iconv Extension is enabled.', async () => {
6-
const php = process.env.WITH_INTL === 'dynamic'
7+
const php = env.WITH_INTL === 'dynamic'
78
? new PhpNode({sharedLibs:[`php${PhpNode.phpVersion}-iconv.so`]})
89
: new PhpNode;
910

packages/intl/test/basic.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import { test } from 'node:test';
22
import { strict as assert } from 'node:assert';
33
import { PhpNode } from '../../../packages/php-wasm/PhpNode.mjs';
4+
import { env } from 'node:process';
45

56
test('Intl Extension is enabled. (explicit)', async () => {
6-
const php = process.env.WITH_INTL === 'dynamic'
7+
const php = env.WITH_INTL === 'dynamic'
78
? new PhpNode({
89
sharedLibs: [`php${PhpNode.phpVersion}-intl.so`]
910
, files: [{parent: '/preload/', name: 'icudt72l.dat', url: './node_modules/php-wasm-intl/icudt72l.dat'}]

packages/libyaml/test/basic.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import { test } from 'node:test';
22
import { strict as assert } from 'node:assert';
33
import { PhpNode } from '../../../packages/php-wasm/PhpNode.mjs';
4+
import { env } from 'node:process';
45

56
test('Yaml Extension is enabled.', async () => {
6-
const php = process.env.WITH_YAML === 'dynamic'
7+
const php = env.WITH_YAML === 'dynamic'
78
? new PhpNode({sharedLibs:[`php${PhpNode.phpVersion}-yaml.so`]})
89
: new PhpNode;
910

packages/libzip/test/basic.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import { test } from 'node:test';
22
import { strict as assert } from 'node:assert';
33
import { PhpNode } from '../../../packages/php-wasm/PhpNode.mjs';
4+
import { env } from 'node:process';
45

56
test('Zip Extension is enabled.', async () => {
6-
const php = process.env.WITH_LIBZIP === 'dynamic'
7+
const php = env.WITH_LIBZIP === 'dynamic'
78
? new PhpNode({sharedLibs:[`php${PhpNode.phpVersion}-zip.so`]})
89
: new PhpNode;
910

packages/openssl/test/basic.mjs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import { test } from 'node:test';
22
import { strict as assert } from 'node:assert';
33
import { PhpNode } from '../../../packages/php-wasm/PhpNode.mjs';
4+
import { env } from 'node:process';
45

56
test('OpenSSL Extension is enabled.', async () => {
6-
const php = process.env.WITH_OPENSSL === 'dynamic'
7+
const php = env.WITH_OPENSSL === 'dynamic'
78
? new PhpNode({sharedLibs:[`php${PhpNode.phpVersion}-openssl.so`]})
89
: new PhpNode;
910
let stdOut = '', stdErr = '';
@@ -22,7 +23,7 @@ test('OpenSSL Extension is enabled.', async () => {
2223
});
2324

2425
test('OpenSSL can generate SHA-256 hashes.', async () => {
25-
const php = process.env.WITH_OPENSSL === 'dynamic'
26+
const php = env.WITH_OPENSSL === 'dynamic'
2627
? new PhpNode({sharedLibs:[`php${PhpNode.phpVersion}-openssl.so`]})
2728
: new PhpNode;
2829

packages/phar/test/basic.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import { test } from 'node:test';
22
import { strict as assert } from 'node:assert';
33
import { PhpNode } from '../../../packages/php-wasm/PhpNode.mjs';
4+
import { env } from 'node:process';
45

56
test('Phar Extension is enabled.', async () => {
6-
const php = process.env.WITH_PHAR === 'dynamic'
7+
const php = env.WITH_PHAR === 'dynamic'
78
? new PhpNode({sharedLibs:[`php${PhpNode.phpVersion}-phar.so`]})
89
: new PhpNode;
910

packages/simplexml/test/basic.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import { test } from 'node:test';
22
import { strict as assert } from 'node:assert';
33
import { PhpNode } from '../../../packages/php-wasm/PhpNode.mjs';
4+
import { env } from 'node:process';
45

56
test('SimpleXML Extension is enabled.', async () => {
6-
const php = process.env.WITH_SIMPLEXML === 'dynamic'
7+
const php = env.WITH_SIMPLEXML === 'dynamic'
78
? new PhpNode({sharedLibs:[`php${PhpNode.phpVersion}-simplexml.so`]})
89
: new PhpNode;
910

packages/sqlite/test/basic.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import { test } from 'node:test';
22
import { strict as assert } from 'node:assert';
33
import { PhpNode } from '../../../packages/php-wasm/PhpNode.mjs';
4+
import { env } from 'node:process';
45

56
test('Sqlite3 Extension is enabled.', async () => {
6-
const php = process.env.WITH_SQLITE === 'dynamic'
7+
const php = env.WITH_SQLITE === 'dynamic'
78
? new PhpNode({sharedLibs:[`php${PhpNode.phpVersion}-sqlite.so`]})
89
: new PhpNode;
910

packages/tidy/test/basic.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import { test } from 'node:test';
22
import { strict as assert } from 'node:assert';
33
import { PhpNode } from '../../../packages/php-wasm/PhpNode.mjs';
4+
import { env } from 'node:process';
45

56
test('Tidy Extension is enabled.', async () => {
6-
const php = process.env.WITH_TIDY === 'dynamic'
7+
const php = env.WITH_TIDY === 'dynamic'
78
? new PhpNode({sharedLibs:[`php${PhpNode.phpVersion}-tidy.so`]})
89
: new PhpNode;
910

0 commit comments

Comments
 (0)