Git Product home page Git Product logo

c-testsuite's Introduction

c-testsuite

This project aims to be a collaborative database of C compiler test cases, minimal test runners, and public test results. The general idea is that the various test suites here adhere to well defined, simple interfaces and projects can contribute tests back that match those interfaces, or use those tests by implementing runner scripts matching the specifications.

There are many tools that may benefit such as C compilers, transpilers, interpreters and emulators, so we should seek to agree on simple easy test interfaces, and implement those interfaces for a variety of tools.

results are published daily to https://c-testsuite.github.io/

Cuik fork

This fork is built to run Cuik testing, you'll need to download or compile Cuik then run this:

python test.py

Test suites

The top level test-suite runners output https://testanything.org output.

single-exec suite

entry point is ./single-exec

runners/single-exec/*

The runner will be invoked as:

$ ./runners/single-exec/$NAME test/single-exec/case.c

The runner is free to output any data it wants, but must return nonzero on failure.

The runner will be considered a failure if it takes more than 5 minutes.

tests/single-exec/*

  • Single .c file tests.
  • 'main' is the entry point.
  • The file $t.c.expected must match stdout+stderr of the test.
  • The test programs exit with 0 on success.

C standard, Portability, preprocessor and libc requirements are specified via tags that can be filtered against using search queries, that can generate skip lists.

Example:

$ ./single-exec gcc-x86_64

Skipping tests

Try to skip a test if your compiler platform can NEVER pass it, the test is not appropriate. In that case, there is only one mechanism, add a command that prints a list of tests to skip on stdout named:

./runners/*/$TOOL.skip

Search and query

All tests have a matching $t.tags file. This file specifies attributes of the test that can be filtered and queried.

The query language is based off of https://github.com/oniony/TMSU tags.

The query language grammar is shown here:

https://github.com/oniony/TMSU/blob/master/misc/ebnf/query.ebnf

Support tags are currently

suite={single-exec, ...}
portable
	The test should be portable C.
arch-x86_64
	The test should pass on x86_64
c89
c99
c11
needs-cpp
    Test relies on the preprocessor
needs-libc
    Test relies on libc

Implicit tags:

c89 implies c99 and c11 c99 implies c11

example query:

$ ./scripts/make-search-index
$ ./scripts/search-tests "c99 suite=single-exec (portable or arch-amd64)"

These queries can be used to generate skip lists.

otags files

otag files are intended to allow a tests origin to be discovered. They contain the following fields.

org=$DOMAINNAME
repository=$SRCURL
version=$UNIQUE_VERSION
path=$TEST_PATH_IN_REPOSITORY

Dependencies

Running tests

  • posix sh
  • python3
  • coreutils
  • tool under test

Querying tests:

Currently test search is based on

https://github.com/oniony/TMSU

We are sympathetic to those who do not wish to deal with installing a lesser known third party tool, so will think of ways to ease the burden in the future.

Tips

Naming test cases

The names are not stable for now, so if you refer to a test case in your issue tracker, it is best to name it something like c-testsuite/$CTESTGITCOMMIT/path/to/test.

Getting a summary from the command line

./single-exec $runner | ./scripts/tapsummary | head

The full TAP test suites report can be viewed or 'curl'ed

For example:

c-testsuite's People

Contributors

andrewchambers avatar realnegate avatar alexfru 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.