New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

42grader

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

42grader

A Grader framework for 42 Piscine

latest
npmnpm
Version
2.1.1
Version published
Weekly downloads
16
433.33%
Maintainers
1
Weekly downloads
 
Created
Source

42Grader

A simple tester for 42 Piscine, written in Javascript and runs on Node.js runtime.

Are you from Seoul?

Table of Contents

Install guide

42grader is avaliable in npm, so just rum npm install:

npm i -g 42grader
with nvm

1. Install node.js (lts versions are recommanded, especially v18)

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash
nvm install --lts

2. Install 42grader via npm

npm i -g 42grader
without sudo

1. Install node.js (lts versions are recommanded, especially v18)

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash
nvm install --lts

2. Change npm prefix to ~/.local

WARNING: YOU HAVE TO UNDERSTAND WHAT CHANGING NPM PREFIX MEANS. IF NOT, YOU SHOULD NOT RUN THIS COMMAND.

npm config set prefix '~/.local/'
echo 'export PATH=~/.local/bin/:$PATH' >> ~/.zshrc
zsh

3. Install 42grader via npm

npm i -g 42grader

How-to-use

42grader command runs 42Grader.

Interactive shell prompt will be displayed. Follow the instructions in prompt.

Folder structure

42Grader will use ~/.42Grader folder.

~/.42Grader/
├─ submission/
│  └─ (cloned git files)
└─ test/
   └─ tester files

submissions folder must exists if you choose no to clone git from remote.

The tester file must exist as a yaml format if you choose yes to run test(s).

tester file

Tester file should be written in yaml format.

  • Write a folder name in directory field.
  • Copy and paste the name of file in Files to turn in from your pdf to file field.
  • Also copy in function field exactly same as function prototype in your pdf.
  • In testcase, you can use standard functions in stdio.h, stdlib.h, string.h and unistd.h.
  • All answers trim one trailing newline in default. If you want to add newline in answer, just add \n or real newline.

This is sample tester file:

test:
  - directory: ex00
    file: ft_putchar.c
    function: void	ft_putchar(char c);
    testcase: |
      ft_putchar('a');
      ft_putchar('b');
    answer: |
      ab
  - directory: ex01
    file: ft_print_alphabet.c
    function: void	ft_print_alphabet(void);
    testcase: |
      ft_print_alphabet();
    answer: |
      abcdefghijklmnopqrstuvwxyz
  - directory: ex02
    file: ft_print_reverse_alphabet.c
    function: void	ft_print_reverse_alphabet(void);
    testcase: |
      ft_print_reverse_alphabet();
    answer: |
      zyxwvutsrqponmlkjihgfedcba

About

Do not use 42grader v1 in ./grader v1. It was written in C but it's almost trash;

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or any later version.

FAQs

Package last updated on 09 Jan 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts