Skip to main content

python tests for Hadassah Academic Collage intro2cs courses

Project description

inferno tests

Github licence

Github release Github tag PyPI version

Code style: black

This project is an automation for teats for the Hadassah Academic College courses
Intro2cs and Intro2cs2

The tests will:

  1. Checks the differences between your output and the school solution output
  2. Checks the differences between your errors (cerr) and the school solution errors
  3. Checks for leak memory using valgrind

How to Install

Virtual Machine

Because the virtual machine has internet connection you may only use the following terminal command

$ python -m pip install --user hac-intro2cs-tests

NoMachine

the NoMachine has no internet connection so you must download the file from PyPI page
Now add the file to the NoMachine and run the following command: command

$ python -m pip install --user <file_name>

replace the <file_name> with the name of the file you downloaded

How to Use

  1. Open the linux (NoMachine or Virtual Machine) and make directory with the following files:

    • School solution file with the extension "sol",
      must be the only file with "sol" in the name of the file
    • your executable file must be the same name of the the school solution file without the "sol"
    • tests files with "_test" in the name

    For example, directory with the following files:

    • ex1asol
    • ex1a
    • ex1a_test00.in
    • ex1a_test01.in
    • ex1a_test02.in

    (The directory may also contain the file ex1a.cc for easy use)

  2. Open the terminal at the directory and write the following command:

    python -m test_ex
    

    For each test the program will print the name of the test and the problem in the test (is there output diff, is there errors (cerr) diff, is there a leak memory).
    the tests automatically run with timeout of 5 seconds to your program.
    to run the program with X seconds timeout, run the following command

    test_ex --timeout X
    

    To run with no timeout (Strongly recommended not to), set the timeout flag to 0:

    test_ex --timeout 0
    

    For more information run:

    test_ex --help
    

Alias

you can add alisa to the command by writing the next line to the file ~/.tcshrc:

alias test_ex python -m test_ex

you may run the following command to do so:

$ echo "alias test_ex python -m test_ex" >> ~/.tcshrc

now you can run the command:

$ test_ex

instead of

$ python -m test_ex

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hac-intro2cs-tests-1.2.3.tar.gz (4.4 kB view hashes)

Uploaded Source

Built Distribution

hac_intro2cs_tests-1.2.3-py3-none-any.whl (7.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page