Skip to content

ArielMAJ/test.me

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

test.me License test.me

Table of Contents

About

What is test.me?

As a software developer or even someone just starting out in the world of programming, you've probably faced the following challenges:

  1. Your code runs locally, but doesn't work in a specific auto-grading tool: the famous "but it works on my machine";

  2. Having to manually copy and paste the input for each test case and manually check if the output is correct;

  3. You have test cases with (what looks like) infinite input characters;

  4. In an online test, having to submit a file several times to test if your solution is passing on all test cases.

These are just some of the problems that can arise when you are developing a solution for a problem. Hitches like these can make things a little more difficult than they need to be and take the focus away from what really matters at the moment: YOUR CODE.

It is with these and other setbacks in mind that test.me was designed. As a way to optimize what is really important: YOUR TIME.

What does test.me do?

test.me is a tool that automates the process of testing your code. It takes your code and a folder with test cases as input and outputs the results of each test case (PASSED or FAILED).

What are the benefits of using test.me?

  • You can test your code without having to submit it to an auto-grading tool every time you make a change;

  • You can test your code offline, without having to connect to the internet;

  • You can test your code in a matter of seconds, without having to re-compile and then copy and paste your input every time;

  • Your program's output will be automatically compared to the expected output;

  • You can test your code with multiple test cases in a single command;

Example usage

2023-05-26.22-36-14.mp4

PS: The makefile commands are just to facilitate building/compiling and developing this tool. For using it, you'll only need to compile it once and just run it against your code & tests as per exemplified in part of the video and in the make run Makefile command.

Why C?

test.me could have been developed in, basically, any language. But it was developed in C as a way to improve the developer's skills in this language. Quite often, C and C++ are the languages of choice for studying Data Structures and Algorithms (DSA) and competitive programming. It is important to be able to use them efficiently.

How to prepare your environment

Linux

Install git, gcc, and make

Ctrl+Alt+T to open Terminal.

sudo apt update
sudo apt upgrade
sudo apt install git
sudo apt install make
sudo apt install gcc

Download this repo

git clone https://github.com/ArielMAJ/test.me.git
cd test.me/

Windows

Install chocolatey

  • Chocolatey is "The Sane Way to Manage Software on Windows".

Install git, gcc, and make

Press Windows+X then press A to open admin Terminal.

choco install git
choco install mingw
choco install make

Download this repo

Press Windows+X then press I to open Terminal.

Then write:

git clone https://github.com/ArielMAJ/test.me.git
cd test.me/

MacOS

TBA

How to use

Make shenanigans

make # Compiles the project.
make help # Shows the Makefile's help info.
make clean # Cleans the project's build files.
make run # Runs the project with an example input.
make run_all # Runs the project with all example inputs.
make format # Runs clang-format on the project's source files (needs clang-format installed).

Compile test.me

make

Write your code and create tests for it

Write example inputs and expected outputs as per the examples in this repo.

PS: Input and output for one single test should have the same naming except for the file extension (".in" for input, ".out" for output).

Test your code

./bin/test.me <Path to your C code> <Path to your example inputs and outputs>

e.g:

./bin/test.me ./example_input/Q03/solution.c ./example_input/Q03/tests/

or, if you have many solutions to different problems in a subfolder with the same naming structure, you can test it all with:

./bin/test.me <Solution path in each subfolder> <Tests path in each subfolder> <Folder with subfolders for testing>

e.g:

./bin/test.me ./solution.c ./tests/ ./example_input/

Compatibility

  • Windows: works and is the primary development platform;
  • Linux & WSL: works and is sporadically tested;
  • MacOS: should work, still needs testers.

Any and everyone is welcome to test this tool locally and leave feedback at #78. If you have some free time and are interested in it, please do.

Translations

Contributing

Contributions are what make the open source community such an amazing place. With them we are able to be learn, inspire and create much more. Any contributions you make are greatly appreciated. For more information, see CONTRIBUTING.

License

Distributed under the Apache 2.0 License. See LICENSE for more information.

Authors, contributors and acknowledgements

Back to top

About

A command line tool for testing code. Your local auto-grading tool.

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Sponsor this project

 

Contributors 4

  •  
  •  
  •  
  •