[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 1/6] bench: create a README file with benches
From: |
Akim Demaille |
Subject: |
[PATCH 1/6] bench: create a README file with benches |
Date: |
Sun, 22 Mar 2020 16:02:06 +0100 |
* etc/bench.pl.in (&bench_with_gbenchmark): Here.
---
etc/bench.pl.in | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/etc/bench.pl.in b/etc/bench.pl.in
index badca670..e067d870 100755
--- a/etc/bench.pl.in
+++ b/etc/bench.pl.in
@@ -964,11 +964,14 @@ sub bench_with_gbenchmark ($@)
{
my ($grammar, @directive) = @_;
+ my $readme = new IO::File ">README.md";
my @obj = ();
for my $i (0 .. $#directive)
{
my $base = "y$i";
- printf " %2d. %s\n", $i, join (' ', split ("\n", $directive[$i]));
+ my $m = sprintf " %2d. %s\n", $i, join (' ', split ("\n",
$directive[$i]));
+ print $m;
+ print $readme $m;
generate_grammar ($grammar, $base, $directive[$i]);
compile ($base);
push @obj, "$base.o";
@@ -983,7 +986,7 @@ EOF
my $compiler = compiler ("y0");
run "$compiler -o main $cflags main.c @obj -lbenchmark";
- run "./main";
+ run "./main | tee -a README.md";
}
######################################################################
--
2.25.1
- [PATCH 0/6] Bench: improvements, Akim Demaille, 2020/03/22
- [PATCH 1/6] bench: create a README file with benches,
Akim Demaille <=
- [PATCH 3/6] bench: use the same prefix in both bench methods, Akim Demaille, 2020/03/22
- [PATCH 2/6] bench: use a C++-11 compiler, Akim Demaille, 2020/03/22
- [PATCH 4/6] bench: add a "latest" symlink, Akim Demaille, 2020/03/22
- [PATCH 6/6] bench: calc: no need for super long inputs, Akim Demaille, 2020/03/22
- [PATCH 5/6] bench: calc: work on a string instead of a file, Akim Demaille, 2020/03/22