bison-patches
[Top][All Lists]
Advanced

[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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]