Closed doronbehar closed 2 years ago
The yacas tests fall into two categories: standard unit tests, which for now only cover some of the big integer operations, and integration tests which use a script (test-yacas) to run yacas, perform some calculations and check if the results are correct. The log you've submitted shows that the unit tests run just fine, but the driver for integration tests (test-yacas) cannot be found.
It looks weird, because it should be there and it seems to work not only on my machine but also during the Continuous Integration (CI) tests.
OK, could you please check if the test-yacas script is there at all?
OK, could you please check if the test-yacas script is there at all?
Yes it's there. I think what it doesn't find is the files with the prefix cyacas-
and the suffix .yts
like cyacas-integrate.yts
. They are named without the cyacas-
prefix in the tests
directory.
These are names of the tests, not the files. The prefix is to differentiate between tests of c++ and java implementations of the engine; the scripts and tests files are identical for both. But OK, could you please try to run
ctest --verbose
in the build directory?
I've found 1 issue - the test-yacas
script had the shebang #!/bin/bash
and in NixOS' build sandbox that file doesn't exist, but Nix is familiar with this common issue and I've overcome that.
Now I see that ctest
still fails, with a different error. E.g:
yacas> Command = "'/build/source/build/cyacas/yacas/yacas' -pc --rootdir /build/source/scripts"
yacas> Version =
yacas> Date = "2021-11-30 17:09:11"
yacas> Logfile = "yacas-logfile.txt"
yacas> /*===================
yacas> Failed = transforms.yts
yacas> 1 of 1 tests FAILED
yacas> ===================*/
yacas> 82/82 Test #81: cyacas-trace.yts .................***Failed 0.08 sec
yacas> /build/source/tests/test-yacas: line 43: '/build/source/build/cyacas/yacas/yacas': No such file or directory
yacas> /build/source/tests/test-yacas: line 44: '/build/source/build/cyacas/yacas/yacas': No such file or directory
And indeed running /build/source/build/cyacas/yacas/yacas
, results in a segmentation fault:
[nixbld@localhost:/var/lib/cntr/build/source/build/cyacas/yacas]$ ./yacas -pc --rootdir ../../../scripts ../../../tests
Segmentation fault (core dumped)
It's peculiar because the executable seems rather functional when the build is complete after make install
.
Why is ctest trying to run /build/source/build/cyacas/yacas/yacas
when your yacas seem to be in /var/lib/cntr/build/source/build/cyacas/yacas
?
The ./yacas -pc --rootdir ../../../scripts ../../../tests
most likely segfaults because it gets directory ../../../tests
as a file to run. This should be obviously fixed, but to actually check if yacas executes tests correctly try for example ./yacas -pc --rootdir ../../../scripts ../../../tests/integrate.yts
Why is ctest trying to run
/build/source/build/cyacas/yacas/yacas
when your yacas seem to be in/var/lib/cntr/build/source/build/cyacas/yacas
?
While the build is happening, this is the same directory. If I inspect what went wrong in the build after it failed, I enter a sort of container in which the build files are actually located in /var/lib/cntr/
... That's a NixOS specific detail.
Running manually:
/build/source/tests/test-yacas \
"'/build/source/build/cyacas/yacas/yacas' -pc \
--rootdir /build/source/scripts" \
"/build/source/tests/integrate.yts"
Results in errors such as:
yacas> /build/source/tests/test-yacas: line 106: '/build/source/build/cyacas/yacas/yacas': No such file
or directory
yacas> /build/source/tests/test-yacas: line 107: '/build/source/build/cyacas/yacas/yacas': No such file
or directory
yacas> /build/source/tests/test-yacas: line 108: '/build/source/build/cyacas/yacas/yacas': No such file
or directory
yacas> {"Total", , "2021-11-30 17:56:17", , , , Pass},
yacas> rm: cannot remove '/tmp/test-yacas.897': No such file or directory
yacas> rm: cannot remove '/tmp/time-yacas.897': No such file or directory
But running:
./yacas -pc --rootdir ../../../scripts ../../../tests/integrate.yts
Seems to exit cleanly.
The problem seems to be lines like this:
Where this directory is not available in NixOS' build sandbox. We should use mktemp
there. I'll try to write a patch later tomorrow.
I get these weird errors when I build the package and test it: