-
Notifications
You must be signed in to change notification settings - Fork 339
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
building tests with cabal #5302
Comments
|
The tests are not included in the released version. |
@asr: Is there a strong reason why If I try this, I get an error that On a practical side, running the whole testsuite may be too much, but |
This problem is only a tip of the iceberg, and reflects that Cabal places the built binaries to where the subsequent tests don't look for it - aka, can't find. Here's my way of solving it by creating a wrapper shell script that does the right magic for the complete rebuild. It ensures (by setting appropriate env vars and removing stale binaries) that at least the right binaries are correctly located and used: #!/bin/bash
DATE_START="`date`"
export GHC_ENVIRONMENT=-
VER=`head -4 mk/versions.mk | grep VERSION | cut -f2 -d '='`
DAT=`date "+%Y-%m-%d"`
GHCVER=`ghc --numeric-version`
HOM="${PWD}"
if [[ "$OSTYPE" == "darwin"* ]]; then
# MacOS
export AGDA_BIN=${HOM}/dist-${VER}-ghc-${GHCVER}/build/Agda/agda
MAKE=gmake
else
# Linux
export AGDA_BIN=${HOM}/dist-${VER}-ghc-${GHCVER}/build/agda/agda
MAKE=make
fi
export AGDA_TESTS=${HOM}/dist-${VER}-ghc-${GHCVER}/build/agda-tests/agda-tests
echo ""
echo "GHC_ENVIRONMENT: ${GHC_ENVIRONMENT}"
echo "AGDA_bin: ${AGDA_BIN}"
echo "AGDA_TESTS: ${AGDA_TESTS}"
echo "CABAL_OPTS: ${CABAL_OPTS}"
echo ""
# Remove the leftovers from previous (successful) installs
# that may interfere with this build
find ~/.cabal/lib -name '*[Aa]gda*' -print -exec rm -rf {} \;
rm -f ~/.cabal/bin/AllNonAsciiChars ~/.cabal/bin/GenerateEverything
# Remove potentially stale "fix-whitespaces", as it's quicker to rebuild
# than to figure if it's built with the correct GHC and such
rm -rf ${HOM}/src/fix-whitespace/dist/build
# Remove stale size-solver from the past
rm -rf ${HOM}/src/size-solver/dist*
${MAKE} clean || true
${MAKE} install 2>&1 | tee make-out-${DAT}.txt
if [ $? != 0 ]; then
echo "Agda-${VER} build failed!"
exit 1
fi
${MAKE} bugs 2>&1 | tee make-bugs-${DAT}.txt
${MAKE} bugs 2>&1 | tee make-bugs-${DAT}.txt
time ${MAKE} test 2>&1 | tee make-test-${DAT}.txt
if [ $? != 0 ]; then
echo "Agda-${VER} tests failed!"
exit 1
fi
${MAKE} user-manual-pdf 2>&1 | tee make-pdf-${DAT}.txt
DATE_END="`date`"
echo ""
echo "Start: ${DATE_START}"
echo "End: ${DATE_END}"
# |
Note that once you get through this issue (e.g., by adopting the above script), you'll have to apply the workarounds from #5528 in order for your tests to actually run and pass. |
Reorganized into LaTeXAndHTML - HTML - LaTeX - QuickLaTeX rather than having LaTeXAndHTML being the union of the three subgroup next to them. This is removing duplicates from the TestTree, useful when running simply the root (`all` tests).
Er, this was many years ago, before @phile314 integrated other parts of the test suite into I started working on having |
'cabal test' will run only the tests defined by 'agda-tests'
'cabal test' will run only the tests defined by 'agda-tests'
'cabal test' will run only the tests defined by 'agda-tests'
'cabal test' will run only the tests defined by 'agda-tests'
'cabal test' will run only the tests defined by 'agda-tests'
I'd say, as long as the entire build and test-run works with Cabal, without the need to use Stack - it's not crucial whether |
Yeah, maybe a standalone |
An attempt to get `cabal test` to run after *installing* Agda rather than just building it.
An attempt to get `cabal test` to run after *installing* Agda rather than just building it.
Mainly for CI, so that we do not have to install LaTeX.
Do not work out of the box, need installation of the stdlib (for `Everything.agda`).
Cabal removes lower-case vowels from package names on macOS, see haskell/cabal#7209. Thus Agda might be just Agd in error messages reporting source locations.
The testsuite fails but does not display diffs. tasty-silver might not yet be portable, see phile314/tasty-silver#16
In PR #5536 I set up a CI (ubuntu, macOS) that runs A flaw in the ointment is that |
Correct reference is `v1-install` in `cabal v1-install --run-tests`.
As I said earlier, I see a lot of value in being able to build using Cabal without Stack (just like it is important to be able to build using Stack without Cabal). I also think that switching to But I see little benefit in replacing
|
@mouse07410 wrote:
The new CI ( Atm, we cannot fully switch the Makefile to |
Understood. This was not intended as a criticism - you guys are doing good IMHO! - but as an attempt to "help" with prioritization of efforts. |
* [ fix #5302 ] make 'cabal test' work for part of the test-suite 'cabal test' will run only the tests defined by 'agda-tests' * [ #5302 ] CI: work around haskell/cabal#7577 An attempt to get `cabal test` to run after *installing* Agda rather than just building it. * [ #5302 ] disable latex-tests for `cabal test` Mainly for CI, so that we do not have to install LaTeX. * [ #5302 ] disable compiler-stdlib tests for `cabal test` Do not work out of the box, need installation of the stdlib (for `Everything.agda`). * [ #5302 ] CI: `cabal test` also on macOS and Windows * [ #5302 ] `cabal test` macOS: work around haskell/cabal#7209 Cabal removes lower-case vowels from package names on macOS, see haskell/cabal#7209. Thus Agda might be just Agd in error messages reporting source locations. * [ #5302 ] giving up on `cabal test` under Windows The testsuite fails but does not display diffs. tasty-silver might not yet be portable, see phile314/tasty-silver#16 * [ #5302 ] fix the alert printed by `cabal test` Correct reference is `v1-install` in `cabal v1-install --run-tests`. * PR #5536: final polishing
Reorganized into LaTeXAndHTML - HTML - LaTeX - QuickLaTeX rather than having LaTeXAndHTML being the union of the three subgroup next to them. This is removing duplicates from the TestTree, useful when running simply the root (`all` tests).
* [ fix #5302 ] make 'cabal test' work for part of the test-suite 'cabal test' will run only the tests defined by 'agda-tests' * [ #5302 ] CI: work around haskell/cabal#7577 An attempt to get `cabal test` to run after *installing* Agda rather than just building it. * [ #5302 ] disable latex-tests for `cabal test` Mainly for CI, so that we do not have to install LaTeX. * [ #5302 ] disable compiler-stdlib tests for `cabal test` Do not work out of the box, need installation of the stdlib (for `Everything.agda`). * [ #5302 ] CI: `cabal test` also on macOS and Windows * [ #5302 ] `cabal test` macOS: work around haskell/cabal#7209 Cabal removes lower-case vowels from package names on macOS, see haskell/cabal#7209. Thus Agda might be just Agd in error messages reporting source locations. * [ #5302 ] giving up on `cabal test` under Windows The testsuite fails but does not display diffs. tasty-silver might not yet be portable, see phile314/tasty-silver#16 * [ #5302 ] fix the alert printed by `cabal test` Correct reference is `v1-install` in `cabal v1-install --run-tests`. * PR #5536: final polishing
What's the correct way to build the tests with cabal?
AFAIK, the
install-bin
target should createagda-tests
in the build directory, if everything is working correctly. But it doesn't. I noticed that there aren't any test suites defined inAgda.cabal
, but I'm not sure if that's the reason.Here's the log for
make test
:I'm on the latest release (
2.6.1.3
).The text was updated successfully, but these errors were encountered: