Code Monkey home page Code Monkey logo

c-tester's Introduction

C-tester

This is a simple bash script to test and diff n test cases.

You will just need to organize your input files, your files with the correct output and your files with the outputs generated by your program.

The c-tester was created using a C program as a base, but theoretically any executable named "a.out" that can be executed via "./a.out < input > output" will work.

You need to organize your test cases as in the example folder. The input files must have the same name as the output files and the correct-output files, differing only by extension and location. The input files must have the extension '.in' and the correct output and output files must have the extension '.out', each in its respective directory.

Finally, the 'diff.sh' and 'run.sh' files and the 'a.out' executable of your program must be exactly 1 level before the input and output files folders.

To run, you can do:

./run.sh; ./diff.sh;

Struct:

.
├── correct-output
│   └── test-1
│       └── sometest.out
├── input
│   └── test-1
│       └── sometest.in
├── output
│   └── test-1
│       └── sometest.out
├── a.out
├── diff.sh
└── run.sh

PT

Isto é um simples script em bash para testar e dar diff em n casos de teste.

Você vai precisar apenas organizar seus arquivos de entrada, seus arquivos com a saída correta e seus arquivos com as saídas geradas pelo seu programa.

O c-tester foi criado utilizando um programa em C como base, mas, teoricamente, qualquer executável nomeado como "a.out" que possa ser executado via "./a.out < input > output" vai funcionar.

Você precisa organizar os seus casos de teste como na pasta 'exemplo'. Os arquivos de entrada devem ter o mesmo nome dos arquivos de saída e dos arquivos de saída correta, diferenciando-se apenas pela extensão e pela localização. Os arquivos de entrada devem ter a extensão '.in' e os arquivos de saída e saída-correta devem ter a extensão '.out', cada um em seu respectivo diretório.

Por fim, os arquivos 'diff.sh' e 'run.sh' e o executável 'a.out' do seu programa devem estar exatamente 1 nível antes das pastas dos arquivos de entrada e saída.

Para rodar, você pode fazer:

./run.sh; ./diff.sh;

Organização dos arquivos:

.
├── correct-output
│   └── test-1
│       └── sometest.out
├── input
│   └── test-1
│       └── sometest.in
├── output
│   └── test-1
│       └── sometest.out
├── a.out
├── diff.sh
└── run.sh

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.