mirror of
https://github.com/tstack/lnav.git
synced 2024-08-17 00:40:30 +03:00
[tests] Skip bzip2 tests if not compiled with bzip2.
This commit is contained in:
parent
ef686b6932
commit
b371a680b3
@ -13,6 +13,10 @@ export top_builddir
|
||||
test_dir="@abssrcdir@/test"
|
||||
export test_dir
|
||||
|
||||
# Let the tests know whether bzip is supported or not.
|
||||
BZIP2_SUPPORT="@BZIP2_SUPPORT@"
|
||||
export BZIP2_SUPPORT
|
||||
|
||||
BZIP2_CMD="@BZIP2_CMD@"
|
||||
export BZIP2_CMD
|
||||
|
||||
|
@ -83,7 +83,10 @@ AC_STRUCT_TIMEZONE
|
||||
|
||||
AC_SEARCH_LIBS(openpty, util)
|
||||
AC_SEARCH_LIBS(gzseek, z, [], [AC_MSG_ERROR([libz required to build])])
|
||||
AC_SEARCH_LIBS(BZ2_bzopen, bz2)
|
||||
AC_SEARCH_LIBS(BZ2_bzopen, bz2,
|
||||
AS_VAR_SET(BZIP2_SUPPORT, 1),
|
||||
AS_VAR_SET(BZIP2_SUPPORT, 0))
|
||||
AC_SUBST(BZIP2_SUPPORT)
|
||||
AC_SEARCH_LIBS(dlopen, dl)
|
||||
AC_SEARCH_LIBS(backtrace, execinfo)
|
||||
|
||||
|
@ -101,18 +101,19 @@ int main(int argc, char *argv[])
|
||||
else {
|
||||
logfile lf(argv[0]);
|
||||
struct stat st;
|
||||
|
||||
|
||||
stat(argv[0], &st);
|
||||
assert(strcmp(argv[0], lf.get_filename().c_str()) == 0);
|
||||
|
||||
lf.rebuild_index();
|
||||
lf.rebuild_index();
|
||||
if (expected_format == "") {
|
||||
assert(lf.get_format() == NULL);
|
||||
assert(lf.get_format() == NULL);
|
||||
}
|
||||
else {
|
||||
//printf("%s %s\n", lf.get_format()->get_name().c_str(), expected_format.c_str());
|
||||
assert(lf.get_format()->get_name() == expected_format);
|
||||
//printf("%s %s\n", lf.get_format()->get_name().c_str(), expected_format.c_str());
|
||||
assert(lf.get_format() != NULL);
|
||||
assert(lf.get_format()->get_name() == expected_format);
|
||||
}
|
||||
if (!lf.is_compressed()) {
|
||||
assert(lf.get_modified_time() == st.st_mtime);
|
||||
@ -123,7 +124,7 @@ int main(int argc, char *argv[])
|
||||
break;
|
||||
case MODE_ECHO:
|
||||
for (logfile::iterator iter = lf.begin(); iter != lf.end(); ++iter) {
|
||||
printf("%s\n", lf.read_line(iter).c_str());
|
||||
printf("%s\n", lf.read_line(iter).c_str());
|
||||
}
|
||||
break;
|
||||
case MODE_LINE_COUNT:
|
||||
@ -131,19 +132,19 @@ int main(int argc, char *argv[])
|
||||
break;
|
||||
case MODE_TIMES:
|
||||
for (logfile::iterator iter = lf.begin(); iter != lf.end(); ++iter) {
|
||||
char buffer[1024];
|
||||
time_t lt;
|
||||
char buffer[1024];
|
||||
time_t lt;
|
||||
|
||||
lt = iter->get_time();
|
||||
strftime(buffer, sizeof(buffer),
|
||||
"%b %d %H:%M:%S %Y",
|
||||
gmtime(<));
|
||||
printf("%s -- %03d\n", buffer, iter->get_millis());
|
||||
lt = iter->get_time();
|
||||
strftime(buffer, sizeof(buffer),
|
||||
"%b %d %H:%M:%S %Y",
|
||||
gmtime(<));
|
||||
printf("%s -- %03d\n", buffer, iter->get_millis());
|
||||
}
|
||||
break;
|
||||
case MODE_LEVELS:
|
||||
for (logfile::iterator iter = lf.begin(); iter != lf.end(); ++iter) {
|
||||
printf("0x%02x\n", iter->get_level());
|
||||
printf("0x%02x\n", iter->get_level());
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -52,7 +52,7 @@ Dec 03 09:23:38 2006 -- 000
|
||||
Jan 03 09:47:02 2007 -- 000
|
||||
EOF
|
||||
|
||||
if test x"$BZIP2_CMD" != x""; then
|
||||
if test x"$BZIP2_SUPPORT" -eq 1 -a test x"$BZIP2_CMD" != x""; then
|
||||
$BZIP2_CMD -z -c "${srcdir}/logfile_syslog.1" > logfile_syslog.1.bz2
|
||||
|
||||
touch -t 200711030923 logfile_syslog.1.bz2
|
||||
|
Loading…
Reference in New Issue
Block a user