about summary refs log tree commit diff homepage
path: root/unittests
AgeCommit message (Collapse)Author
2023-03-16Add some unit tests for KDAllocDaniel Schemmel
2022-06-15Spelling Fixesm-davis
2022-05-05cmake: try using system installation of GTest if it's presentLukáš Zaoral
This is a patch that I made few months ago as Fedora forbids bundling and using pieces of software provided by other packages in its repositories but forgot to upstream it at that time. [1] It has been rebased and improved so that it also reflects changes made in #1458. This should also make the compilation of unittests easier for our users as they don't need to clone googletest from GitHub anymore and just use package manager in the distro of their choice, provided that the gtest package includes a corresponding CMake module. [1]: https://src.fedoraproject.org/rpms/klee/blob/4c81b78/f/use-system-gtest.patch
2022-03-17remove LLVM < 6 from build/test scriptsFrank Busse
2022-03-09tests: make UBSAN print stack tracesLukáš Zaoral
2022-03-09fix CMake: gtest from llvm includes gtest_mainJulian Büning
2022-01-05introduce BranchTypesFrank Busse
2022-01-05unittests/TestMain: show stack trace on errorJulian Büning
2022-01-05fix CMake: use own TestMain instead of gtest_mainJulian Büning
Before, we would use gtest_main as provided by either LLVM or Google Test itself; the TestMain.cpp was ignored (contrary to its source code comment). In newer versions of Google Test (1.8.1+), gtest_main uses `__FILE__` for its "Running main() from" line, but llvm-lit (which we use to invoke unit tests) currently matches exactly "Running main() from gtest_main.cc" for determining whether to skip this line. This results in spurious "tests" that will be shown as unresolved.
2022-01-05CMake: set Google Test options properlyJulian Büning
If the used CMake version is recent enough to support the necessary policy CMP0077, set INSTALL_GTEST using normal variables instead of cache variables. We never want to allow Google Test to add to the install target, so we should not allow a user to interfere with this. In addition, we set BUILD_GMOCK=OFF (and the necessary BUILD_GTEST=ON for Google Test 1.8.0), as our current tests do not require Google Mock.
2022-01-05fix CMake: GTEST_INSTALL -> INSTALL_GTESTJulian Büning
As far as I can tell, the variable intended to be set here was never called GTEST_INSTALL.
2022-01-05CMake: include GTest include hint for 1.8.0+Julian Büning
Later versions of googletest also ship googlemock alongside googletest. Thus, the include directory we are looking for is located in a subdirectory. The source directory, however, does not change as googletest/CMakeLists.txt references variables set in CMakeLists.txt of the root directory and is not intended to be included directly.
2020-11-04[cmake] Remove several leftovers from old autoconf build systemMartin Nowack
2020-09-03Fix PTree::remove to clean the tree properlySebastian Poeplau
The previous version left unnecessary intermediate nodes behind, sometimes leading to very long paths in the tree.
2020-07-30[unittests] use static PTree::remove method in SearcherTestFrank Busse
2020-07-30introduce --rng-initial-seed=<unsigned>Frank Busse
* move global theRNG into Executor * pass theRNG via ctor to searchers * remove some type warnings from RNG.cpp Fixes #1023.
2020-07-01Separate constraint set and constraint managerMartin Nowack
2020-07-01Move constraint implementation from header to cpp filesMartin Nowack
2020-06-29Enable subsets for RandomPathSearcherTimotej Kapus
2020-04-30Removed include/klee/util and moved header files to appropriate placesCristian Cadar
2020-04-30Move header files from lib/Expr to include/klee/Expr to eliminate includes ↵Cristian Cadar
using "../"
2020-04-30Removed the Internal directory from include/kleeCristian Cadar
2020-04-07Add unit test for Z3Solver::getConstraintLogDaniel Grumberg
2020-02-19Add move assignment operator and move construct for `ref` class.Martin Nowack
2020-02-19Add `ReferenceCounter` struct utilized by ref<>Martin Nowack
Using KLEE's `ref<>` shared ptr requires the referenced object to contain a reference counter to be added and initialised to 0 as part of the constructor. To support better reuse of the `ref<>` ptr add a `ReferenceCounter` struct. Just adding this struct to a new class/struct as member enables reference counting with `ref<>` - no additional counter management needed.
2020-02-19Fix ptr reference invalidation if last reference gets freed before new ↵Martin Nowack
reference assigned.
2019-12-12[optimize-array] Hash collision testTimotej Kapus
2019-09-03Moved solver-related header files into a separate klee/Solver/ directory.Cristian Cadar
2019-09-03Moved ConstructSolverChain.cpp to the Solver library.Cristian Cadar
2019-07-30Consolidated Expr-related include files into a single include/klee/Expr ↵Cristian Cadar
directory. This improves the organization of the code, and also makes it easier to reuse Expr outside KLEE.
2019-07-30CMake: enable reuse of LLVM's googletest src and targetsJulian Büning
Fixes an issue that occurs with USE_CMAKE_FIND_PACKAGE_LLVM=ON and LLVM compiled from sources, which then exports gtest and gtest_main targets. In case gtest and gtest_main targets are not imported from LLVM and GTEST_SRC_DIR is not set, CMake can now reuse the googletest sources from LLVM_BUILD_MAIN_SRC_DIR (if available) with USE_CMAKE_FIND_PACKAGE_LLVM=ON. This last limitation is due to LLVM making modifications to the CMakeLists.txt of googletest that requires add_llvm_library() from AddLLVM.cmake.
2019-03-12time: add double type for span multiplicationsFrank Busse
2018-10-30Base time API upon std::chronoFrank Busse
This should not change the behaviour of KLEE and mimics the old API. - functions moved from util into time namespace - uses time points and time spans instead of double - CLI arguments now have the form "3h5min8us" Changed command line parameters: - batch-time (double to string) - istats-write-interval (double to string) - max-instruction-time (double to string) - max-solver-time (double to string) - max-time (double to string) - min-query-time-to-log (double to string) - seed-time (double to string) - stats-write-interval (double to string) - uncovered-update-interval (double to string) - added: log-timed-out-queries (replaces negative max-solver-time)
2018-10-16Renamed klee/CommandLine.h to klee/SolverCmdLine.h, since this file is meant ↵Cristian Cadar
to have only solver options.
2018-07-04Support sanitizer suppression files with lit-based testingMartin Nowack
2018-06-14Add unittest for DiscretePDFMartin Nowack
2018-03-26[CMake] Add option to set GTest include dirlyxia
2017-10-06Silenced warnings on comparison of integers of different signs in TreeStreamTestAndrea Mattavelli
2017-10-04Remove Autoconf/Makefile build system and adjust the TravisCIDan Liew
configuration, TravisCI scripts and Dockerfile build appropriately. There are a bunch of clean ups this enables but this commit doesn't attempt them. We can do that in future commits.
2017-07-23Remove LLVM 2.9 from MakefilesMartin Nowack
2017-07-19Added some unit tests for TreeStream: one testing some basic behaviour, the ↵Cristian Cadar
other a regression test for #562
2017-02-16Silenced warning: comparison of integers of different signs ('const int' and ↵Andrea Mattavelli
'const unsigned long long')
2017-02-14Added unit tests for ReadExpr::create() to check that constant folding is ↵Andrea Mattavelli
correctly applied
2016-11-19[CMake] Remove unneeded dependency declarations for the unit tests.Dan Liew
These were changes that I forgot to make in dda296e09ee53ed85ccf1c3f08e7e809adce612e .
2016-11-07Implement a CMake based build system for KLEE.Dan Liew
This is based off intial work by @jirislaby in #481. However it has been substantially modified. Notably it includes a separate build sytem to build the runtimes which is inspired by the old build system. The reason for doing this is because CMake is not well suited for building the runtime: * CMake is configured to use the host compiler, not the bitcode compiler. These are not the same thing. * Building the runtime using `add_custom_command()` is flawed because we can't automatically get transitive depencies (i.e. header file dependencies) unless the CMake generator is makefiles. (See `IMPLICIT_DEPENDS` of `add_custom_command()` in CMake). So for now we have a very simple build system for building the runtimes. In the future we can replace this with something more sophisticated if we need it. Support for all features of the old build system are implemented apart from recording the git revision and showing it in the output of `klee --help`. Another notable change is the CMake build system works much better with LLVM installs which don't ship with testing tools. The build system will download the sources for `FileCheck` and `not` tools if the corresponding binaries aren't available and will build them. However `lit` (availabe via `pip install lit`) and GTest must already be installed. Apart from better support for testing a significant advantage of the new CMake build system compared to the existing "Autoconf/Makefile" build system is that it is **not** coupled to LLVM's build system (unlike the existing build system). This means that LLVM's autoconf/Makefiles don't need to be installed somewhere on the system. Currently all tests pass. Support has been implemented in TravisCI and the Dockerfile for building with CMake. The existing "Autoconf/Makefile" build system has been left intact and so both build systems can coexist for a short while. We should remove the old build system as soon as possible though because it creates an unnecessary maintance burden.
2016-09-29Fix bug in `AssignmentEvaluator` where NotOptimizedExpr would not (#466)Dan Liew
* Add unittest to check that the `Assignment` class can evaluate expressions containing a `NotOptimizedExpr`. * Fix the `AssignmentTest.FoldNotOptimized` unit test by teaching the `ExprEvaluator` to fold `NotOptimizedExpr` nodes.
2016-02-23Added missing copyright headers per klee/issue #301Marko Dimjašević
2016-02-10Add some of the basic plumbing required to support a Z3 solver in KLEE.Dan Liew
2016-01-14Refactor the MetaSMT makefile commands into its own file which canDan Liew
be included by tools that needs to link against MetaSMT. Apart from making the Makefile code cleaner this allowed the Solver unit test linking to succeed when not building with STP support. Unfortunately when using MetaSMT as the core solver the Solver unit tests do not pass. Clearly no one tried this before... :(
2016-01-14Make it possible to build KLEE without using STP and only MetaSMT.Dan Liew
The default core solver is STP if KLEE is built with STP otherwise it is MetaSMT. Whilst I'm here rename SUPPORT_METASMT macro to ENABLE_METASMT for consistency.