Giter Site home page Giter Site logo

Document how to run the test suite about cgal HOT 17 CLOSED

cgal avatar cgal commented on May 17, 2024
Document how to run the test suite

from cgal.

Comments (17)

bo0ts avatar bo0ts commented on May 17, 2024

πŸ‘ A quick workaround to test an individual package on a Unix system:

# make sure CGAL_DIR is set, have a configured build 
# tree with all the options (especially CMAKE_BUILD_TYPE=Release)
export CGAL_DIR=/path/to/cgal/build
# make sure you have the CGAL scripts in your path
export PATH="$PATH;/path/to/cgal/Scripts/developer_scripts;/path/to/cgal/Scripts/scripts"
# go to your package
cd /path/to/cgal/package/test/package
# run the testsuite
cgal_test_with_cmake
# Repeat for the examples folder

This should give you an idea how to test a single package and maybe some obvious dependencies.

from cgal.

lrineau avatar lrineau commented on May 17, 2024

@drewish Have you tried what is suggested by @bo0ts?

from cgal.

drewish avatar drewish commented on May 17, 2024

@lrineau i did. i guess i was expecting more of a test suite rather than having to manually run each of the test programs. i was able to run them but without knowing the expected output it wasn't obvious if they were doing what they were supposed to do. i ended up just making sure the affected ones would compile.

from cgal.

lrineau avatar lrineau commented on May 17, 2024

Actually the CGAL testsuite runs every night from a release tarball. The set of scripts, see in Scripts/developers_scripts, are made to run in the tarball flat layout, and not in the modular layout of the Git repository.

from cgal.

bo0ts avatar bo0ts commented on May 17, 2024

@drewish The few commands I gave you should be able to compile, run and confirm the correctness of the tests without you needing to know that. In general, a test will be considered correct based on the process exit code and if it prints the word ERROR to stdout. How to invoke a test/example binary for testing is a bit more complicated but you hopefully shouldn't need to know that when using cgal_test_with_cmake.

from cgal.

drewish avatar drewish commented on May 17, 2024

Good to know I should just be looking for errors.

I tried these instructions on another computer (using the master branch) and ended up getting some errors when trying to test the Straight_skeleton_2 tests or examples:

In file included from /Users/amorton/projects/cgal/Straight_skeleton_2/test/Straight_skeleton_2/offset_bug.cpp:1:
In file included from /Users/amorton/projects/cgal/Cartesian_kernel/include/CGAL/Cartesian.h:28:
In file included from /Users/amorton/projects/cgal/Cartesian_kernel/include/CGAL/Cartesian/Cartesian_base.h:28:
In file included from /Users/amorton/projects/cgal/Kernel_23/include/CGAL/basic.h:29:
/Users/amorton/projects/cgal/Installation/include/CGAL/config.h:43:4: error: The test-suite needs no NDEBUG defined
#  error The test-suite needs no NDEBUG defined
   ^
1 error generated.

I can include more of the compiler output if that's helpful.

from cgal.

bo0ts avatar bo0ts commented on May 17, 2024

No, the output is sufficient. That is one of the peculiarities of our
testsuite. It can only run when NDEBUG is defined (meaning that assertions
are enabled). The compilation flags are taken from the CMake build
(CMakeCache.txt) found in CGAL_DIR. I assume you configured that build
with CMAKE_BUILD_TYPE=Release resulting in a build with no debugging. For
simple testing purposes I would recommend changing that variable to the
value Debug. For this:

cmake $CGAL_DIR
cmake -DCMAKE_BUILD_TYPE=Debug . # or use ccmake, cmake-gui etc
make clean && make # rebuild

No rinse and repeat the testing process. You probably need to remove the
CMakeCache.txt to delete the cache generated by cgal_test_with_cmake.
Thanks for staying with me through this.

from cgal.

lrineau avatar lrineau commented on May 17, 2024

I wonder why <CGAL/config.h> is complaining about NDEBUG instead of "#undef-ing" it. I think that header should warn about NDEBUG if it is defined at the same time CGAL_TESTSUITE is defined, and then it should undefine the macro.

(Note for @bo0ts: It seems that GitHub does not format using Markdown when the answer is send by mail.)

from cgal.

bo0ts avatar bo0ts commented on May 17, 2024

I think the current behavior is OK. If you #undef NDEBUG you cannot be sure if <assert> or any other debug header has already been included or not. The current implementation is more robust.

from cgal.

lrineau avatar lrineau commented on May 17, 2024

As the CGAL testsuite is on our repository, we could enforce that CGAL/config.h is always included first in CGAL tests and examples.

from cgal.

bo0ts avatar bo0ts commented on May 17, 2024

IMO too much effort to actually have a test for this and not enough returns. In examples it also would be misleading for users, because they would believe they always have to include CGAL/config.h even if this is not the case and we don't want them to believe that.

from cgal.

lrineau avatar lrineau commented on May 17, 2024

In example that is easy: most if not all CGAL headers also include CGAL/config.h first.

Philipp Moeller [email protected] a Γ©critΒ :

IMO too much effort to actually have a test for this and not enough returns. In examples it also would be misleading for users, because they would believe they always have to include CGAL/config.h even if this is not the case and we don't want them to believe that.

β€”
Reply to this email directly or view it on GitHub.οΏΌ

from cgal.

bo0ts avatar bo0ts commented on May 17, 2024

Which brings us back to the problem that

#include <boost/assert.hpp> // imagine any other assertion include here
#include <CGAL/config.h> // CGAL/config.h

will be broken, because it now depends on the include order and boost.assert is going to behave differently from the CGAL assertions. The current practice is OK IMO, maybe we should add the options to enable assertions in automated builds, but this is anoher issue. Anyway, this is getting to far of topic. Let's continue this discussion elsewhere if you think it is necessary.

from cgal.

lrineau avatar lrineau commented on May 17, 2024

The current behavior is completely OK. I was trying to find out if we can improve it, to avoid what Andrew has reported at #39 (comment).

But it that would create more confusion, let's forget that proposal.

from cgal.

strk avatar strk commented on May 17, 2024

Having a "check" Makefile target could be useful for many (it's a standard GNU target).

from cgal.

bo0ts avatar bo0ts commented on May 17, 2024

@strk Yes, but currently this is far from feasible as it would entail creating a release and running the testsuite on it. We are trying to get their though.

from cgal.

sloriot avatar sloriot commented on May 17, 2024

See #504

from cgal.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.