Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version 2.1.1 #2

Merged
merged 12 commits into from
Nov 24, 2018
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/node_modules

/dist
# /build
/tests

/*.cpp
Expand Down
61 changes: 37 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,53 +1,66 @@
# Codeforces project generator

**Warning:** This is a dev version, might be unstable or have errors.
**Warning:** This is a dev version - it might be unstable or have errors, because it has not been tested properly. Feel free to test it yourself and report errors.

## Instalation

```
npm install -g https://github.com/tao24/gcg.git#dev
```

## Local building and testing

1. Clone repository:
## Usage instruction

### Directory management
```
git clone -b dev https://github.com/tao24/gcg.git gcg-dev
cd gcg-dev
gcg init <task-name> [--overwrite] [--input-only]
```

2. Intall, build and run project locally:
Initializes directory with template `.cpp` file and tests (you should start copying tests to clipboard).

```
npm install
npm run build
npm start <params>
```
Flag `--input-only` makes it so it creates only `*.in` files, omitting `*.out` files. Make sure to create `[task-name]_out.exe` validator file working as specified below.

3. (optional) Before publishing (pushing to repository), remember to build in production mode first:
### Testing

```
npm run build:prod
gcg run <task-name> [-f <folder-name>] [-t <test-name>] [--no-compile]
```

Runs specified task on its tests (tests in folder `tests` which begin with `<task-name>` and all test in folder `tests/<task-name>`).
#### Available options:
- `-f, --folder <folder-name>` runs program on all tests in specified folder,
- `-t, --test <test-name>` runs program only on specified test (but it must be in either `tests` folder, in `tests/<program-name>` or in folder specified by `-f <folder-name>`),
- `--no-compile` turns off compiling program before testing.

If no corresponding `.out` or `.ans` files are found, then it tries to use `<task-name>_out[.exe]` executable to validate program. Validator should work as follows:

## Usage instruction
1. read from stdin test specification (`<test-name>.in` file)
2. read from stdin your programs' output
3. validate output
4. if result is ok, return with no result. If not, it should print non-empty string on standard output (it will be displayed in console during testing).

**Note**: Validator runs ```g++ -std=c++17 <task-name>.cpp -o <task-name>```. Make sure you have a c++ compiler.


## Local building and testing

1. Clone repository:

### Directory management
```
gcg init [task-name] [--overwrite]
git clone -b dev https://github.com/tao24/gcg.git gcg-dev
cd gcg-dev
```

Initializes directory with template ```.cpp``` files and tests (you should start copying tests to clipboard). If [task-name] is specified, then it only initializes this task.

### Testing
2. To install and run project locally:

```
gcg run <task-name> [--no-compile]
npm install
npm start -- <params>
```

Runs specified task on its tests (any test that begins with ```<task-name>```). Flag ```--no-compile``` turns off compiling.
3. (optional) To install CLI from local folder:

```
npm run build
npm install -g
```

**Note**: Validator runs ```g++ -std=c++17 <task-name>.cpp -o <task-name>```. Make sure it works.
<!-- Before publishing (or pushing to repository), remember to build first (`npm run build:prod`). -->
39 changes: 0 additions & 39 deletions app/index.js

This file was deleted.

12 changes: 0 additions & 12 deletions app/res/templates/main.cpp

This file was deleted.

61 changes: 0 additions & 61 deletions app/src/init.js

This file was deleted.

5 changes: 0 additions & 5 deletions app/src/input.js

This file was deleted.

106 changes: 0 additions & 106 deletions app/src/interactive.js

This file was deleted.

67 changes: 0 additions & 67 deletions app/src/validate.js

This file was deleted.

Loading