diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0f58412..b8cea1d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,7 +25,7 @@ jobs: - name: Install librrd run: | sudo apt-get update - sudo apt-get install -y librrd-dev pkg-config + sudo apt-get install -y librrd-dev pkg-config rrdtool - name: Setup PHP uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # v2.37.2 @@ -40,6 +40,9 @@ jobs: ./configure --with-rrd make -j"$(nproc)" + - name: Generate test fixtures + run: make -C tests/data all + - name: Test run: make test env: diff --git a/.gitignore b/.gitignore index 1f91b0f..8cd5787 100644 --- a/.gitignore +++ b/.gitignore @@ -29,3 +29,19 @@ modules run-tests.php tmp-php.ini tests/rrdtool-bin.inc +*.dep +configure.ac +tests/*.diff +tests/*.exp +tests/*.log +tests/*.out +tests/*.php +tests/*.sh +tests/*.txt +tests/*.png +tests/*.rrd +tests/data/*.png +tests/data/*.rrd +tests/data/*.txt +tests/data/*.xml +tests/data/Makefile diff --git a/tests/rrd_016.phpt b/tests/rrd_016.phpt index 14b2c7d..d79fe57 100644 --- a/tests/rrd_016.phpt +++ b/tests/rrd_016.phpt @@ -22,4 +22,3 @@ var_dump(rrd_tune($destFile, array("true"))); bool(true) bool(false) bool(true) -%s \ No newline at end of file diff --git a/tests/rrd_017.phpt b/tests/rrd_017.phpt index 633cf95..11e3423 100644 --- a/tests/rrd_017.phpt +++ b/tests/rrd_017.phpt @@ -11,92 +11,66 @@ if (!file_exists($data_updatedDb)) { --FILE-- $result["end"]) { $aligned = false; } +} +var_dump($aligned, count($speed) === count($real)); ?> ---EXPECTF-- +--EXPECT-- array(4) { - ["start"]=> + [0]=> + string(5) "start" + [1]=> + string(3) "end" + [2]=> + string(4) "step" + [3]=> + string(4) "data" +} +int(920804700) +int(300) +array(2) { + [0]=> + string(7) "myspeed" + [1]=> + string(9) "realspeed" +} +array(3) { + [0]=> int(920804700) - ["end"]=> - int(920808300) - ["step"]=> - int(300) - ["data"]=> - array(2) { - [0]=> - array(2) { - ["legend"]=> - string(7) "myspeed" - ["data"]=> - array(13) { - [920804700]=> - float(NAN) - [920805000]=> - float(0.04) - [920805300]=> - float(0.02) - [920805600]=> - float(0) - [920805900]=> - float(0) - [920806200]=> - float(0.0333333333%s) - [920806500]=> - float(0.0333333333%s) - [920806800]=> - float(0.0333333333%s) - [920807100]=> - float(0.02) - [920807400]=> - float(0.02) - [920807700]=> - float(0.02) - [920808000]=> - float(0.0133333333%s) - [920808300]=> - float(0.0166666666%s) - } - } - [1]=> - array(2) { - ["legend"]=> - string(9) "realspeed" - ["data"]=> - array(13) { - [920804700]=> - float(NAN) - [920805000]=> - float(40) - [920805300]=> - float(20) - [920805600]=> - float(0) - [920805900]=> - float(0) - [920806200]=> - float(33.333333333%s) - [920806500]=> - float(33.333333333%s) - [920806800]=> - float(33.333333333%s) - [920807100]=> - float(20) - [920807400]=> - float(20) - [920807700]=> - float(20) - [920808000]=> - float(13.333333333%s) - [920808300]=> - float(16.666666666%s) - } - } - } + [1]=> + int(920805000) + [2]=> + int(920805300) } +bool(true) +0.0400 0.0200 0.0333 +40.0000 20.0000 33.3333 +bool(true) +bool(true)