Skip to content

Latest commit

 

History

History
117 lines (74 loc) · 2.81 KB

File metadata and controls

117 lines (74 loc) · 2.81 KB

System Testing

Folder Layout

Each folder contains a different program and has the following files:

  • serve.bat/sh: Starts up all the servers needed
  • run.bat: For Windows Users, to run the system tests
  • run.sh: For Mac Users, to run the system tests
  • source.txt: The source program we are testing against
  • sourceNumbered.txt: A well formatted source.txt to be used for reference only, with proper indentation and line numbering
  • And various test files based on relationships

Running all system tests at once

  1. Open a terminal in the systemtest folder or cd into it.

  2. For Windows Users, run:

    .\serve.bat

    For Mac Users:

    Remember to set your permissions to allow for execution of your OS's respective files.

    chmod u+x run.sh
    ./serve.sh
    
    # alternatively
    bash serve.sh

    What this does is that it starts up all the servers needed for system tests.

    i.e If there are 5 system tests, ports 8100, 8200, 8300, ..., 8500 will be used up.

  3. Everytime you change a test case and want to re run the output, run the following from the same directory:

    .\run.bat

    For Mac Users:

    Remember to set your permissions to allow for execution of your OS's respective files.

    chmod u+x run.sh
    ./run.sh
    
    # alternatively
    bash run.sh

    This will trigger each individual system test's run file.

Running an inidividual system test

E.g: To run systemtest1,

  1. Open a terminal in the systemtest1 folder or cd into it.

  2. Copy and paste analysis.xsl from Code06\tests and paste it inside systemtest1.

  3. For Windows Users, run:

    .\run.bat

    For Mac Users:

    Remember to set your permissions to allow for execution of your OS's respective files.

    chmod u+x run.sh
    ./run.sh

    .out files should appear.

  4. To view the results of the test, run the following command in the same folder: (Having two terminals would help in case you want to re-run the tests)

    python -m http.server {PORT_OF_YOUR_CHOICE}

  5. Visit localhost:{PORT_OF_YOUR_CHOICE} to view the test results.

Automatically check for correctness

Given how we will have an increasing number of systemtests, it would be easier to aid your workflow by just seeing which systemtests are failing.

To do so, you can run the python script found in this directory.

python3 check.py

It is also used in our CI to check for failing files.

Diagrams

The Control Flow Graphs for each system test can be found here for reference:

systemtest1

systemtest2

systemtest3