From 983ae027239c7a0aed45e5d9bd7d87f7cb2630bc Mon Sep 17 00:00:00 2001 From: arnav-ag Date: Sat, 20 Apr 2024 00:49:38 +0800 Subject: [PATCH] Move tests to getting started --- README.md | 69 ++++++++++++++++++++++++++----------------------------- 1 file changed, 33 insertions(+), 36 deletions(-) diff --git a/README.md b/README.md index 982ac17..c227d34 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,6 @@ Ooga is a concurrent virtual machine and interpreter for a subset of the Go prog - [Running Tests](#running-tests) - [Dev Workflow](#dev-workflow) - [Usage](#usage) -- [Test Suite](#test-suite) - [Project Structure](#project-structure) - [Contributing](#contributing) - [License](#license) @@ -86,44 +85,54 @@ The toolchain is designed to be modular, with a clean separation between each ph ### Installation 1. Clone the repository: - ``` - git clone https://github.com/CS4215-OOGA/ooga-lang.git - ``` +```bash +git clone https://github.com/CS4215-OOGA/ooga-lang.git +``` 2. Install dependencies: - ``` - cd ooga-lang - yarn install - ``` +```bash +cd ooga-lang +yarn install +``` ### Running the Toolchain 1. Generate the parser from the Peggy grammar file: - ```bash - yarn peggy - ``` - This command generates `src/parser/ooga.js` from `src/parser/ooga.pegjs`. +```bash +yarn peggy +``` + +This command generates `src/parser/ooga.js` from `src/parser/ooga.pegjs`. 2. Compile the TypeScript source code: - ```bash - yarn build - ``` - This command compiles all TypeScript files in the `src` directory into JavaScript in the `dist` directory. +```bash +yarn build +``` + +This command compiles all TypeScript files in the `src` directory into JavaScript in the `dist` directory. 3. Start the server: - ```bash - yarn server - ``` - This command starts the server at http://localhost:3001. +```bash +yarn server +``` + +This command starts the server at http://localhost:3001. The Ooga playground frontend (in the [ooga-frontend](https://github.com/CS4215-OOGA/ooga-frontend) repo) communicates with this server to execute Ooga code and retrieve debugging information. ### Running Tests -Ooga comes with an extensive test suite that covers all language features. To run the tests: - ```bash - yarn tooga - ``` + +The Ooga test suite is located in `src/tests/test.ts`. It contains a series of integration tests that cover all language features and edge cases. + +To run the test suite: +```bash +yarn tooga +``` + +The test suite will compile and run each test case, checking the output against the expected result. The stdout of each test case is also captured and compared to the expected output. Any discrepancies will cause the test to fail. + +Actions are set up to run the test suite on every commit pushed to this repository to ensure that the codebase remains correct. ## Dev Workflow @@ -168,18 +177,6 @@ Use `breakpoint;` statements in your code to set breakpoints. In debug mode, you can inspect the state of each goroutine's operand stack and stack frames, as well as the heap state at each breakpoint. -## Test Suite - -The Ooga test suite is located in `src/tests/test.ts`. It contains a series of integration tests that cover all language features and edge cases. - -To run the test suite: -```bash -yarn tooga -``` - -The test suite will compile and run each test case, checking the output against the expected result. The stdout of each test case is also captured and compared to the expected output. Any discrepancies will cause the test to fail. - -Actions are set up to run the test suite on every commit pushed to this repository to ensure that the codebase remains correct. ## Project Structure