dolik-rce / pegof

PEG grammar optimizer and formatter
Other
9 stars 2 forks source link

Tests failing on Ubuntu 18.04 #4

Closed dolik-rce closed 2 months ago

dolik-rce commented 2 years ago

It seems that the tests are broken, running the tests before and after my changes gives the same result 23 tests, 19 failures, 1 skipped .

Originally posted by @mingodad in https://github.com/dolik-rce/pegof/issues/1#issuecomment-1103693270

dolik-rce commented 2 years ago

I have tried to reproduce this in docker:

docker pull ubuntu:18.04
docker run ubuntu:18.04 bash -e -x -c "
    apt-get update
    apt-get install -y --no-install-recommends build-essential ca-certificates git cmake bats
    git clone https://github.com/arithy/packcc.git
    make -C /packcc/build/gcc release/bin/packcc
    git clone https://github.com/dolik-rce/pegof.git
    mkdir /pegof/build
    cd /pegof/build
    # fix cmake to allow definition of test target
    sed 's/add_custom_target/cmake_policy(SET CMP0037 OLD)\n&/' -i ../CMakeLists.txt
    cmake -DPACKCC=/packcc/build/gcc/release/bin/packcc ..
    make test
"

All tests pass. The only problem I've encountered is that the old version of CMake used in Ubuntu 18.04 doesn't allow us to create a test target. I had to override this by adding the cmake_policy to even make it compile. I'll bump the minimal required version to 3.11, which should have this problem fixed.

@mingodad: I can't reproduce your problem with broken tests. Please let me know if you have done something differently... I assume you probably have different versions of some packages (very probable, since you didn't complain about the cmake problem). If you can replicate your issue in docker, I can look into this further.

ismaeldamiao commented 4 months ago

To compile with a single command on build copy packcc.c and packcc.h to it and the following worked for me.

clang++ -I./ -I../ ../*.cc peg.c -o pegof
dolik-rce commented 2 months ago

Closing due to inactivity and also because 18.04 is no longer supported.