Coder Social home page Coder Social logo

cairotest's Introduction

The Cairo smart test suite

Author: Jamie Gabbay

What is this?

This repository contains cairotest; an automated unit- and property-based test suite for the Cairo programming language based on pytest and Hypothesis.

I am pleased to share this with the Cairo community, and feedback and suggestions are welcome.

How to use Cairo test suite

Install

Just use pip in the usual way. For example on a Linux environment this should work:

pip3 cairotest

Examples

A short tutorial is here.

For more robust usage see the cairo-integer-types library. See any file whose name begins with test_, as in test_biguint.py or test_uint125.py.

Install Cairo

Presumably if you're interested in cairotest then you have Cairo installed, but just in case ...

Why do we need a Cairo test framework?

Seriously? You do!

See this repo for usage examples.

My setup

This is what I type to get set up and running with a Cairo development environment on a fresh machine running Debian linux (Ubuntu flavour). Help yourself (but don't blame me if something goes wrong):

# Make sure the ambient Debian OS is up-to-date
sudo apt update
sudo apt upgrade

# Cairo is developed on Python 3.7 so let's get that.
sudo apt install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libsqlite3-dev libreadline-dev libffi-dev wget libbz2-dev libgmp-dev
# Download Python 3.7 and cd into directory
wget https://www.python.org/ftp/python/3.7.13/Python-3.7.13.tgz
tar xvzf Python-3.7.13.tgz
cd Python-3.7.13
# Configure compilation
./configure --enable-optimizations
# Make (8 core system)
make -j 8
# Install
# IMPORTANT: altinstall means we don't overwrite your machine's native version of Python!
sudo make altinstall

# Create Python3.7 virtual environment
python3.7 -m venv ~/cairo_venv-3.7
# Jump into the venv
source ~/cairo_venv-3.7/bin/activate

# Install prerequisites (works for Cairo 0.8)
pip3 install jinja2 pytest pytest-reverse hypothesis cairo-lang black pytest-xdist[psutil]

# Now install cairotest
pip3 install cairotest

Feedback and comments ...

... are very welcome. Thanks in advance.

cairotest's People

Contributors

bellissimogiorno avatar

Watchers

 avatar

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.