Commit 3ac4d258 authored by Michel Arruat's avatar Michel Arruat Committed by Adam Wujek

libextest: add git version and build info for libextest

Signed-off-by: Michel Arruat's avatarMichel Arruat <michel.arruat@cern.ch>

libextest: add git version and build info for libextest
Signed-off-by: Michel Arruat's avatarMichel Arruat <michel.arruat@cern.ch>
parent 35c1a5b5
......@@ -3,10 +3,14 @@
# build a particular environment.
-include Makefile.specific
GIT_VER =? $(shell git describe --always --dirty)
GIT_USR =? $(shell git config --get-all user.name)
LIB = libextest.a
LOBJ := extest.o
CFLAGS = -Wall -ggdb -fPIC -Werror -I./
CFLAGS += -D__GIT_VER__="\"$(GIT_VER)\"" -D__GIT_USR__="\"$(GIT_USR)\""
LDFLAGS = -L. -lextest
%: %.c $(LIB)
......
......@@ -68,6 +68,9 @@ static int _cmdlist_size = 0;
static struct atom _args_copy[MAX_ARG_COUNT + 1]; /* +1 for the terminator */
static void (*user_sig_hndl)() = NULL; // user sig handler
static const char * const libextest_version_s = "libextest version: "
__GIT_VER__ ", by " __GIT_USR__ " " __TIME__ " " __DATE__;
/**
* sighandler - SIGNAL handler
*
......@@ -804,6 +807,11 @@ static struct cmd_desc _built_in_cmdlist[CMD_USR] = {
* extest's User's API
*******************************************/
const char * const extest_get_version()
{
return libextest_version_s;
}
/**
* do_yes_no - Get user answer (y/n)
*
......
......@@ -139,6 +139,9 @@ int extest_register_user_cmd(struct cmd_desc user_cmdlist[],
int user_cmd_nb);
int extest_run(char* prg_name, void (*user_sighndl)());
int extest_is_last_atom(struct atom *atom);
const char * const extest_get_version();
//@}
#endif /* _EXTEST_H_ */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment