Skip to contentSkip to conversation

libgfs2: Add a small testing language UI

PATCH New Andrew Price 1 participant 1 message Nov 8, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libgfs2: Add a small testing language UI

This adds a minimal 'gfs2l' command to allow easy use of the testing language. It takes one -f option to specify a script file and a single argument to specify the path to the fs.

It can be used to build a rudimentary REPL e.g.

  # while read s; do echo "$s" | gfs2l -f- /dev/foo; done
  get sb
  ...

But it's mainly intended to be used as a component of in-tree test scripts and will not be installed by the build system.

---
 gfs2/libgfs2/Makefile.am |   6 ++
 gfs2/libgfs2/gfs2l.c     | 146 +++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 152 insertions(+)
 create mode 100644 gfs2/libgfs2/gfs2l.c
gfs2/libgfs2/Makefile.am +6 -0
index 7103e09..9c4e96b 100644
@@ -9,6 +9,8 @@ noinst_HEADERS		= libgfs2.h lang.h
 
 noinst_LTLIBRARIES	= libgfs2.la
 
+noinst_PROGRAMS		= gfs2l
+
 libgfs2_la_SOURCES	= block_list.c fs_bits.c gfs1.c misc.c rgrp.c super.c \
 			  buf.c fs_geometry.c gfs2_disk_hash.c ondisk.c \
 			  device_geometry.c fs_ops.c gfs2_log.c recovery.c \
@@ -19,6 +21,10 @@ libgfs2_la_CPPFLAGS	= -D_FILE_OFFSET_BITS=64 \
 			  -D_GNU_SOURCE \
 			  -I$(top_srcdir)/gfs2/include
 
+gfs2l_SOURCES		= gfs2l.c
+gfs2l_CPPFLAGS		= -I$(top_srcdir)/gfs2/include
+gfs2l_LDADD		= $(top_builddir)/gfs2/libgfs2/libgfs2.la
+
 # Autotools can't handle header files output by flex so we have to generate it manually
 lexer.h: lexer.l
 	$(LEX) -o lexer.c $(AM_LFLAGS) $^
gfs2/libgfs2/gfs2l.c new file +146 -0

146 lines not on this page · raw message

Signature · 1 line
1.7.11.7