Coder Social home page Coder Social logo

philipp-classen / cppquickcheck Goto Github PK

View Code? Open in Web Editor NEW

This project forked from grogers0/cppquickcheck

13.0 13.0 4.0 385 KB

QuickCheck-like property based automated testing tool for C++

License: BSD 2-Clause "Simplified" License

CMake 0.17% C++ 99.81% C 0.02%

cppquickcheck's People

Contributors

bardurarantsson avatar grogers0 avatar irpab avatar mhwombat avatar philipp-classen avatar vstrisovsky avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

cppquickcheck's Issues

Travis is broken

Fetched 281 kB in 10s (26.6 kB/s)
Reading package lists... Done
W: The repository 'http://llvm.org/apt/precise llvm-toolchain-precise-3.8 Release' is not signed.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: http://ppa.launchpad.net/couchdb/stable/ubuntu/dists/trusty/Release.gpg: Signature by key 15866BAFD9BCC4F3C1E0DFC7D69548E1C17EAB57 uses weak digest algorithm (SHA1)
W: The repository 'http://ppa.launchpad.net/ubuntu-cloud-archive/icehouse-staging/ubuntu trusty Release' does not have a Release file.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: http://ppa.launchpad.net/h-rayflood/gcc-upper/ubuntu/dists/trusty/Release.gpg: Signature by key EF9300D9D55E308863EA191B9DB3C0CF23957A28 uses weak digest algorithm (SHA1)
E: Failed to fetch http://ppa.launchpad.net/ubuntu-cloud-archive/icehouse-staging/ubuntu/dists/trusty/main/binary-amd64/Packages  404  Not Found
E: Failed to fetch http://ppa.launchpad.net/ubuntu-cloud-archive/icehouse-staging/ubuntu/dists/trusty/main/binary-i386/Packages  404  Not Found
E: Some index files failed to download. They have been ignored, or old ones used instead.

The travis setup is quite old. While fixing it, it would to be a good opportunity to migrate it to a Docker setup:

https://docs.travis-ci.com/user/docker

Header only version

At the moment, src/Arbitrary.cpp prevents the library from being used in a header-only style. Starting with C++17, this could be avoided.

Idea: For C++11, leave everything as it is, but for C++17, provide a single, header-only version of the library.

Advantage: In C++17 environments, this would simplify the installation.

Add Clang-format config file

Please add the clang-format configuration file to the repository.

Without the config file the process of formatting using clang-format is not reproducible. For example, I'm getting a lot of "spurious" changes which I just run clang-format -i ... on my system.

The file can be generated by running clang-format -style=... -dump-config on your system. (You might need to change the settings to whatever you used originally when reformatting.)

Default Arbitrary instances for e.g. long return very small values?

It seems that the default Arbitrary instances for integral types return very small values. Here's the small prop I've been using to test:

template <typename T>
struct ReproducerProp: cppqc::Property<T>
{
	bool check(const T &expected) const override
	{
		std::cout << expected << std::endl;
		if (expected > 255) {
			return false;
		}
		if (expected < -255) {
			return false;
		}
		return true;
	}
};

I would certainly have expected this to fail at least some of the time, but I've done ~20 runs (each with 100 tests) and it's not failed so far.

It seems very odd that it's not using the full range of the type by default.

(Generally speaking it might also be a good idea to make sure to always include the min/max/0 value for any given type in the set of integers tested, by that's another issue.)

EDIT: Oh, the runner code is

	quickCheckOutput(ReproducerProp<long>());

Tested current master.

Avoid Boost dependencies if the functionality comes with C++11

(issue migrated from grogers0/CppQuickCheck)

We already have C++11 as a requirement. Some aspects, which are currently implemented via Boost, could now be replaced. For instance:

  • Random number generators
  • boost::tuple
  • boost::bind
  • boost::function

For now, I would avoid upgrading to C++14 unless there is a significant need. However, starting to gradually migrate straightforward parts (currently implemented with Boost) to C++11 should simplify the maintenance in the long run.

From what I see, it would eliminate the need for Boost. Although a dependency to Boost is not really harmful, we should avoid it if all functionality that we are using comes now with C++11.

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.