Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/quasilyte/phpsmith
phpsmith creates random PHP and KPHP programs to test their compilers and runtimes
https://github.com/quasilyte/phpsmith
code-generator codesmith fuzzer fuzzing kphp php testing
Last synced: 3 months ago
JSON representation
phpsmith creates random PHP and KPHP programs to test their compilers and runtimes
- Host: GitHub
- URL: https://github.com/quasilyte/phpsmith
- Owner: quasilyte
- License: mit
- Created: 2022-04-27T15:03:20.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2022-12-28T13:47:38.000Z (about 2 years ago)
- Last Synced: 2024-10-11T11:48:24.160Z (4 months ago)
- Topics: code-generator, codesmith, fuzzer, fuzzing, kphp, php, testing
- Language: Go
- Homepage:
- Size: 382 KB
- Stars: 5
- Watchers: 5
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# phpsmith
[![Tests](https://github.com/quasilyte/phpsmith/workflows/Tests/badge.svg)](https://github.com/quasilyte/phpsmith/blob/master/.github/workflows/ci.yml)
[![Go Report Card](https://goreportcard.com/badge/github.com/quasilyte/phpsmith)](https://goreportcard.com/report/github.com/quasilyte/phpsmith)
[![Go Reference](https://pkg.go.dev/badge/github.com/quasilyte/phpsmith.svg)](https://pkg.go.dev/github.com/quasilyte/phpsmith)![logo](docs/logo_small.png)
`phpsmith` creates random PHP and KPHP programs to test their compilers and runtimes.
It can create both valid (but very contrived) and invalid programs.
### Features
* Random valid php code generation
* Random invalid php code generation
* Reproducible program generation by seed
* Big generation variability### How it works
Phpsmith can be executed in two modes: `fuzz`, `generate`:
- `fuzz`:
- infinitely generate php programs
- run it on php and kphp
- catch exceptions, segmentation faults, fatal errors
- compare results between php and kphp
- save diff in logs- `generate`:
- generate php program by provided seed### Installation
```bash
go install github.com/quasilyte/phpsmith
```### Pre-installation requirements
- php ≥7.0
- kphp ≥9.3.0### Usage
Run `phpsmith` without arguments to get help output.
```
Possible commands are:version print phpsmith version info to stdout and exit
fuzz run fuzzing using the provided configuration
generate generate a program using the provided configuration
````fuzz` command examples:
```bash
phpsmith fuzz -o ~/phpsmith_out
````generate` command examples:
```bash
phpsmith generate -seed 1651182107
```