Skip to content

Commit

Permalink
Initial implementation of the dummy benchmark ##tests
Browse files Browse the repository at this point in the history
  • Loading branch information
trufae committed Jan 6, 2022
1 parent 8194bfc commit 7cfd367
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 0 deletions.
3 changes: 3 additions & 0 deletions test/bench/Makefile
@@ -0,0 +1,3 @@
T=rarun2 time=true
all:
for a in r2pipe/* ; do echo "[TT] $$a" ; $T system="r2 -qi $$a /bin/ls" > /dev/null ; done
4 changes: 4 additions & 0 deletions test/bench/README.md
@@ -0,0 +1,4 @@
Benchmark testsuite
===================

Run `make` and compare results with runs of previous commits.
8 changes: 8 additions & 0 deletions test/bench/r2pipe/test-example.js
@@ -0,0 +1,8 @@
const r2pipe = require("r2pipe");
const r2 = r2pipe.open()

console.log("jo")
r2.cmd("aa");
var res = r2.cmdj("aflj");
console.log(res);
console.log("done")
4 changes: 4 additions & 0 deletions test/bench/r2pipe/test-example.py
@@ -0,0 +1,4 @@
import r2pipe
r2=r2pipe.open()
r2.cmd("aa")
print(r2.cmdj("aflj"))
4 changes: 4 additions & 0 deletions test/bench/r2pipe/test-example.qjs
@@ -0,0 +1,4 @@
import("r2").then((r2) => {
var a = JSON.parse(r2.cmd("aa;aflj"));
r2.log(JSON.stringify(a));
});
29 changes: 29 additions & 0 deletions test/bench/r2pipe/test-example.wren
@@ -0,0 +1,29 @@


System.print("Hello World")
var a = R2.cmd("?E hello world;aaa")

var json_length = R2.cmd("aflj").count
System.print("input json length = " + json_length.toString)
var obj = R2.cmdj("aflj")
System.print("contains = " + obj.count.toString + " entries")

class R2Api {
foo=(v) {
//this.foo = v
}
construct new() {
this.foo = 123
}
fileInfo() {
return R2.cmdj("ij")
}
}


var ra = R2Api.new()
/*
var fi = ra.fileInfo()
System.print(fi["core"])
*/

0 comments on commit 7cfd367

Please sign in to comment.