Skip to content

Commit

Permalink
Check API coverage (#104)
Browse files Browse the repository at this point in the history
  • Loading branch information
raviqqe committed May 8, 2023
1 parent 44d90bc commit 81aa405
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

[![GitHub Action](https://img.shields.io/github/actions/workflow/status/raviqqe/melior/test.yaml?branch=main&style=flat-square)](https://github.com/raviqqe/melior/actions?query=workflow%3Atest)
[![Crate](https://img.shields.io/crates/v/melior.svg?style=flat-square)](https://crates.io/crates/melior)
![API coverage](https://img.shields.io/badge/api%20coverage-36%25-blue.svg?style=flat-square)
[![License](https://img.shields.io/github/license/raviqqe/melior.svg?style=flat-square)](LICENSE)

The rustic MLIR bindings for Rust
Expand Down
21 changes: 21 additions & 0 deletions tools/api_completeness.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/sh

set -e

cd $(dirname $0)/..
cd melior

count() {
grep -o '\(m\|M\)lir[A-Z][a-zA-Z0-9]*' | sort -u | wc -l
}

implemented_count() {
cargo install cargo-expand
cargo expand | count
}

upstream_count() {
cat $(find $(brew --prefix llvm)/include/mlir-c -type f) | count
}

echo $(implemented_count) / $(upstream_count) | bc -l

0 comments on commit 81aa405

Please sign in to comment.