Skip to content

xjtu-enre/ENRE-test

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ENRE testing framework

This repository provides start code for applying the ENRE document driven test framework to ENRE single language version. The framework is powered by ENRE-ts's test components.

Basic concepts

This is a Node.js project written in JavaScript, that transforms ENRE unified test documents and standalone test cases into language specific test framework code (for example, junit in Java), so that developers of ENRE single language version can run tests natively, which enabling breakpoint debugging and other IDE features. Besides, this project also checks and enforces the format of ENRE test documents, which can also be used as a format checker.

Category Concept Explanation Comment
The input (Test artifacts) Test document A markdown file located in /docs/ of an ENRE project's root. The document format is strictly restricted, a violation will result in parse fail and no output.
Standalone test case A directory contains both a project to be analyzed (by ENRE) and an assertion.yaml file, where the directory is located in /tests/cases/. The standalone test case is suitable for complex test cases or a whole project.
The format of assertion.yaml is the same as an assertion block within a markdown file.
Process Parse CLI commands Provided The most necessary commands are not modifiable, however it is allowed to append customized commands.
Find, validate and parse test artifacts Provided Features are provided by components of ENRE-ts, are not modifiable.
Clear old files and setup relevant directories Provided
Generate native test code Waiting implementation Follow the instructions in comments so that your code fit in the framework's design philosophy will make things easy.
The output Native test code The language and test framework relevant code file.
Format check result While this project produce native test code, the format of input is also checked, the result will be printed in the command line. A good test input is the one that no error is reported.
After these Run native test code Run generated native test code and do all debugging staffs on demand.

Getting started

Prerequisites

Node.js 16~18.

Setup and run

  1. In this project's root, run npm i to download and setup all dependencies.

  2. Fulfill all TODOs in /src/index.js that transform assertion YAML object and build native test code.

  3. Change the working directory to ENRE's root and then run node --experimental-specifier-resolution=node path/to/this-project/index.js to start the framework.

    You can append -- -h to see the help message, likely all other commands that should be interpreted by this project's CLI should be appended after --.

  4. (If no error) The output native test code will be located in /tests/suites/ of ENRE's root.

Version control this project

This project should also be version controlled by Git and submit to GitHub as a public standalone repository.

  • You should use this template project to create a new repository in GitHub and name it as ENRE-xx-test where xx is the language label.

  • You should also update the package.json file to reflect the language label and other information.

  • If this template (upstream) is updated, you should merge the upstream changes into your new repository.

  • You should also add the new repository as a Git submodule of the ENRE project, and document the setup and usage in the ENRE project's README file.

    (EN Tutorial, CHS Tutorial)

Bugs & Suggestions

Please submit an issue to this repository. Do not submit issues to ENRE-ts's repository.

About

ENRE testing framework template

Resources

Stars

Watchers

Forks