CODE_TESTER
Code_tester is a command-line code testing tool used to test your codes against codes of your friends/brute-force code.
Installation
Build from Source
git clone https://github.com/srbcheema1/code_testercd code_testerpython3 setup.py install --user
Install using pip
linux and mac users
python3 -m pip install --user code_tester
Don't forget ~/.local/bin should be in your PATH. Add line export PATH=$PATH:"~/.local/bin" in your ~/.bashrc
windows users
for windows users you should have python3 installed in your system
python3 -m pip install --user code_tester
Usage
srb@srb-pc:$ code_tester --help
usage: code_tester [-h] [-f FILE] [-o OTHER] [-t TEST] [-i ID] [-n NUM]
[-s SEC] [-c]
[legacy [legacy ...]]
positional arguments:
legacy legacy way of args
optional arguments:
-h, --help show this help message and exit
-f FILE, --file FILE Input file name, ex: one.cpp
-o OTHER, --other OTHER
Other input file name, ex: brute.cpp
-t TEST, --test TEST Test generator, ex: testgen.py
-i ID, --id ID Unique_id, ex: 111
-n NUM, --num NUM Maximum number of test cases, ex: 1000
-s SEC, --sec SEC Maximum time in seconds for a test file, ex: 4
-c, --clean Clean the files generated by tester
Argument --test may contain a testcase-generator which outputs a testcase OR a custom testcase txt file.
srb@srb-pc:$ code_tester -f one.cpp -o brute_one.cpp -t testgen.py -n 500
tested 100
tested 200
tested 300
tested 400
tested 500
passed 500 testcases
srb@srb-pc:$ code_tester wrong.cpp brute.cpp testgen.py
Difference detected in outputs
---------Failed Test Case----------
10 11 4
1 0 0 0 0 0 0 1 1 1
!?!!?!?!!!!
---------End of Test Case----------
first difference in line 3
+---+-----------+-----------+
| # | wrong.cpp | brute.cpp |
+---+-----------+-----------+
| 1 | 2 | 2 |
| 2 | 4 | 4 |
| 3 | 3 | 4 |
+---+-----------+-----------+
Smart enough
- smart enough to detect that
1is same as1.0 - able to detect and ignore difference of less than 1e-6 in float values
- able to ignore trailing white spaces
srb@srb-pc:$ code_tester wrong.cpp brute.cpp testgen.py
Difference detected in outputs
---------Failed Test Case----------
10
5 1
13 9
15 2
11 10
16 2
18 9
17 16
13 2
16 16
19 16
---------End of Test Case----------
first difference in line 8
+----+-------------+-----------+
| # | wrong.cpp | brute.cpp |
+----+-------------+-----------+
| 1 | 0.33333333 | 0.3333333 | ignore percision differences smaller than 1e-6
| 2 | 1.00000000 | 1 | it will detect values are same in 1.0, 1.000 and 1
| 3 | 0.25000000 | 0.2500000 |
| 4 | 1.00000000 | 1 |
| 5 | 0.25000000 | 0.2500000 |
| 6 | 1.00000000 | 1 |
| 7 | 0.14285714 | 0.1428571 | this line is not marked as diff(smart to detect negligible change)
| 8 | 0.33333333 | 0.2500000 | this one is 7th line which actually differs
| 9 | 1.00000000 | 1 |
| 10 | 1.00000000 | 1 |
+----+-------------+-----------+
Supported Languages
- c++
- c
- python3
- java
- ruby
Contact / Social Media
Developed by
Developer / Author: Srb Cheema
Metadata
Release files for code-tester 0.0.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| code_tester-0.0.8.tar.gz | 8.6 kB | Without provenance | Details for code_tester-0.0.8.tar.gz |
Release files / code_tester-0.0.8.tar.gz
| Download URL | code_tester-0.0.8.tar.gz |
|---|---|
| Size | 8.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d6faeef99224c824ad2d50dabe31cc1ae4029fd45b5b27bcdf63a7d70c796bc1
|
|
BLAKE2b-256 checksum How to use checksums |
cb4f9002bb01fda488211fd704ed8c51a4839912e55ca08c8a252e55f9da11c8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.7
|
Security for code-tester 0.0.8
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.