-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #39 from Jon4t4n/ci
Add CI and fix/disable broken tests
- Loading branch information
Showing
44 changed files
with
682 additions
and
154 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
name: Install | ||
runs: | ||
using: composite | ||
steps: | ||
- shell: bash | ||
run: | | ||
export DEBIAN_FRONTEND="noninteractive" | ||
sudo apt-get update | ||
sudo apt-get -y -q install firebird-dev firebird3.0 firebird3.0-common firebird3.0-server | ||
FB_ORIGINAL_PASS=`sudo cat /etc/firebird/3.0/SYSDBA.password | grep ISC_PASSWORD | sed -e 's/ISC_PASSWORD="\([^"]*\)".*/\1/'` | ||
gsec -user SYSDBA -password ${FB_ORIGINAL_PASS} -modify sysdba -pw masterkey | ||
sudo service firebird3.0 restart | ||
sudo apt-get -y install pkg-config build-essential autoconf bison re2c libxml2-dev libsqlite3-dev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
on: | ||
push: | ||
pull_request: | ||
schedule: | ||
- cron: '0 0 * * *' | ||
|
||
jobs: | ||
linux: | ||
runs-on: ubuntu-latest | ||
continue-on-error: false | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
php: ['7.4', '8.0', '8.1', '8.2'] | ||
steps: | ||
- name: Checkout php-src | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: 'php/php-src' | ||
ref: 'PHP-${{ matrix.php }}' | ||
- name: Checkout php-firebird | ||
uses: actions/checkout@v3 | ||
with: | ||
path: 'ext/php-firebird' | ||
- name: Install dependencies | ||
uses: ./ext/php-firebird/.github/actions/install-linux | ||
- name: Build | ||
run: | | ||
./buildconf --force | ||
./configure --disable-all --with-interbase | ||
make -j$(/usr/bin/nproc) | ||
- name: Test | ||
run: sudo make test TESTS='ext/php-firebird --show-diff' | ||
linux-debug: | ||
runs-on: ubuntu-latest | ||
continue-on-error: false | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
php: ['7.4', '8.0', '8.1', '8.2'] | ||
steps: | ||
- name: Checkout php-src | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: 'php/php-src' | ||
ref: 'PHP-${{ matrix.php }}' | ||
- name: Checkout php-firebird | ||
uses: actions/checkout@v3 | ||
with: | ||
path: 'ext/php-firebird' | ||
- name: Install dependencies | ||
uses: ./ext/php-firebird/.github/actions/install-linux | ||
- name: Build | ||
run: | | ||
./buildconf --force | ||
./configure --disable-all --with-interbase --enable-debug | ||
make -j$(/usr/bin/nproc) | ||
- name: Test | ||
run: sudo make test TESTS='ext/php-firebird --show-diff' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
--TEST-- | ||
Bug #46247 (ibase_set_event_handler() is allowing to pass callback without event) | ||
--SKIPIF-- | ||
<?php include("skipif.inc"); ?> | ||
--FILE-- | ||
<?php | ||
|
||
require("interbase.inc"); | ||
|
||
$db = ibase_connect($test_base); | ||
|
||
ibase_set_event_handler('foo', 1); | ||
ibase_set_event_handler($db, 'foo', 1); | ||
|
||
?> | ||
--EXPECTF-- | ||
Warning: ibase_set_event_handler(): Callback argument foo is not a callable function in %s on line %d | ||
|
||
Warning: ibase_set_event_handler(): Callback argument foo is not a callable function in %s on line %d |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
--TEST-- | ||
Bug #46247 (ibase_set_event_handler() is allowing to pass callback without event) | ||
--SKIPIF-- | ||
<?php | ||
include("skipif.inc"); | ||
include("skipif-php7-or-older.inc"); | ||
?> | ||
--FILE-- | ||
<?php | ||
|
||
require("interbase.inc"); | ||
|
||
$db = ibase_connect($test_base); | ||
|
||
function test() { } | ||
|
||
ibase_set_event_handler(); | ||
|
||
?> | ||
--EXPECTF-- | ||
Fatal error: Uncaught ArgumentCountError: Wrong parameter count for ibase_set_event_handler() in %a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
--TEST-- | ||
Bug #46247 (ibase_set_event_handler() is allowing to pass callback without event) | ||
--SKIPIF-- | ||
<?php | ||
include("skipif.inc"); | ||
include("skipif-php7-or-older.inc"); | ||
?> | ||
--FILE-- | ||
<?php | ||
|
||
require("interbase.inc"); | ||
|
||
$db = ibase_connect($test_base); | ||
|
||
function test() { } | ||
|
||
ibase_set_event_handler(NULL, 'test', 1); | ||
|
||
?> | ||
--EXPECTF-- | ||
Fatal error: Uncaught TypeError: ibase_set_event_handler(): supplied argument is not a valid InterBase link resource in %a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?php | ||
|
||
$user = 'SYSDBA'; | ||
$password = 'masterkey'; | ||
ini_set('ibase.default_user',$user); | ||
ini_set('ibase.default_password',$password); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
<?php | ||
|
||
srand(((int)(double)microtime()*1000000)); | ||
|
||
function out_table($table_name) | ||
{ | ||
echo "--- $table_name ---\n"; | ||
$res = ibase_query("select * from $table_name"); | ||
while ($r = ibase_fetch_row($res)) { | ||
echo join("\t",$r)."\t\n"; | ||
} | ||
ibase_free_result($res); | ||
echo "---\n"; | ||
} | ||
|
||
function out_result($result, $table_name = "") | ||
{ | ||
echo "--- $table_name ---\n"; | ||
while ($r = ibase_fetch_row($result)) { | ||
echo join("\t",$r)."\t\n"; | ||
} | ||
echo "---\n"; | ||
} | ||
|
||
function out_result_trap_error($result, $table_name = "") | ||
{ | ||
echo "--- $table_name ---\n"; | ||
while ($r = @ibase_fetch_row($result)) { | ||
echo join("\t",$r)."\t\n"; | ||
} | ||
echo "errmsg [" . ibase_errmsg() . "]\n"; | ||
echo "---\n"; | ||
} | ||
|
||
/* M/D/Y H:M:S */ | ||
function rand_datetime() | ||
{ | ||
return sprintf("%02d/%02d/%4d %02d:%02d:%02d", | ||
rand()%12+1, rand()%28+1, rand()%100+1910, | ||
rand()%24, rand()%60, rand()%60); | ||
} | ||
|
||
/* random binary string */ | ||
function rand_binstr($max_len) | ||
{ | ||
$len = rand() % $max_len; | ||
$s = ""; | ||
while($len--) { | ||
$s .= sprintf("%c", rand() % 256); | ||
} | ||
return $s; | ||
} | ||
|
||
function rand_str($max_len) | ||
{ | ||
$len = rand() % $max_len; | ||
$s = ""; | ||
while ($len--) { | ||
$s .= sprintf("%c", rand() % 26 + 65); | ||
} | ||
return $s; | ||
} | ||
|
||
function rand_number($len , $prec = -1, $sign = 1) | ||
{ | ||
if ($prec == -1) { | ||
$n = substr(rand() . rand(), 0, rand() % $len + 1); | ||
if (strlen($n) < $len) { | ||
$n .= "." . substr(rand(), 0, rand() % ($len - strlen($n)) + 1); | ||
} | ||
} else if ($prec == 0) { | ||
$n = substr(rand() . rand(), 0, rand() % $len + 1); | ||
} else if (($prec - $len) == 0) { | ||
$n = substr(rand() . rand(), 0, 1); | ||
$n .= "." . substr(rand(), 0, $prec); | ||
} else { | ||
$n = substr(rand() . rand(), 0, rand() % ($len - $prec) + 1); | ||
$n .= "." . substr(rand(), 0, $prec); | ||
} | ||
if ($sign && (rand() % 3 == 0)) { | ||
$n = "-" .$n; | ||
} | ||
return $n; | ||
} |
Oops, something went wrong.