Skip to contentSkip to conversation

"unzip01" testcase failed.

LTP Mitani 2 participants 2 messages Dec 21, 2009 Kbuild

lore
Share & tools
lore

Mitani

author
#0 lore raw

Hi,

I found that "unzip01" testcase failed as follows.
----------
unzip01 1 TFAIL : Test #1: unzip output differs from expected output.
Details
----------

The above error's "expected output" and "output" are :
- "tst_unzip.out.exp" file ("expected output") :
In "${LTPROOT}/testcases/bin/unzip_tests.sh", the contents of the "tst_unzip.dir" directory are expected to output into this file.
- "tst_unzip.out" file (actual "output") :
A all contents of the "/opt/LTP/testcases/bin" directory are logged to this file.

This problem occurs because "tst_unzip.dir" directory is not created.

Why does "DIR" become "/opt/ltp/testcases/bin" set though "DIR := tst_unzip.dir" is defined in "${LTPROOT}/testcases/commands/unzip/Makefile"?

To solve this problem, it is necessary to apply the following patche to "${LTPROOT}/testcases/commands/unzip/Makefile" for creating "tst_unzip.dir" directory, I think.
============

Makefile.new renamed from Makefile +0 -0
@@ -27,8 +27,6 @@
 # Only build and install if we have the zip command.
 HAVE_ZIPTOOLS		:= $(shell if which zip >/dev/null; then echo yes;

else echo no; fi)

-DIR := tst_unzip.dir
-
RM += -r

TESTCASES_DATA_DIR := $(DESTDIR)/$(prefix)/testcases/data
@@ -36,7 +34,7 @@
ZIPFILE := $(TESTCASES_DATA_DIR)/tst_unzip_file.zip

ifeq ($(HAVE_ZIPTOOLS),yes)
-CLEAN_TARGETS := $(DIR) $(ZIPFILE)
+CLEAN_TARGETS := tst_unzip.dir $(ZIPFILE)
INSTALL_TARGETS := unzip_tests.sh
endif

@@ -45,13 +43,14 @@
$(TESTCASES_DATA_DIR):
mkdir -p "$@"

-$(ZIPFILE): | $(TESTCASES_DATA_DIR) $(DIR)
- zip -r "$@" $(DIR)
+$(ZIPFILE): | $(TESTCASES_DATA_DIR) tst_unzip.dir
+ zip -r "$@" tst_unzip.dir
chmod 00666 "$@"

# This target should be auto-removed by Make
-$(DIR): $(abs_srcdir)/unzip_genfile.sh
- $(SHELL) "$^" $(DIR)
+.INTERMEDIATE: tst_unzip.dir
+tst_unzip.dir: $(abs_srcdir)/unzip_genfile.sh
+ $(SHELL) "$^" tst_unzip.dir

include $(top_srcdir)/include/mk/generic_leaf_target.mk
============

Regards--

-Tomonori Mitani

------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community Take advantage of Verizon's best-in-class app development support A streamlined, 14 day to market process makes app distribution fast and easy Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

#1 lore raw
Quoted 57 lines · Mitani

Hi,

I found that "unzip01" testcase failed as follows.
----------
unzip01     1  TFAIL  :  Test #1: unzip output differs from expected output. Details
----------

The above error's "expected output" and "output" are :
 - "tst_unzip.out.exp" file ("expected output") :
     In "${LTPROOT}/testcases/bin/unzip_tests.sh", the contents of the "tst_unzip.dir" directory are expected to output into this file.
 - "tst_unzip.out" file (actual "output") :
     A all contents of the "/opt/LTP/testcases/bin" directory are logged to this file.

This problem occurs because "tst_unzip.dir" directory is not created.

Why does "DIR" become "/opt/ltp/testcases/bin" set though "DIR := tst_unzip.dir" is defined in "${LTPROOT}/testcases/commands/unzip/Makefile"?

To solve this problem, it is necessary to apply the following patche to "${LTPROOT}/testcases/commands/unzip/Makefile" for creating "tst_unzip.dir" directory, I think.
============

Makefile.new        2009-12-18 17:38:00.000000000 +0900 renamed from Makefile    2009-12-18 17:48:40.000000000 +0900 +0 -2
@@ -27,8 +27,6 @@
  # Only build and install if we have the zip command.
  HAVE_ZIPTOOLS          := $(shell if which zip >/dev/null; then echo yes;
 else echo no; fi)
 
-DIR                    := tst_unzip.dir
-

 RM                     += -r

 TESTCASES_DATA_DIR     := $(DESTDIR)/$(prefix)/testcases/data

Makefile.new        2009-12-18 17:38:00.000000000 +0900 renamed from Makefile    2009-12-18 17:48:40.000000000 +0900 +0 -0
@@ -36,7 +34,7 @@

 ZIPFILE                        := $(TESTCASES_DATA_DIR)/tst_unzip_file.zip

 ifeq ($(HAVE_ZIPTOOLS),yes)

Makefile.new        2009-12-18 17:38:00.000000000 +0900 renamed from Makefile    2009-12-18 17:48:40.000000000 +0900 +1 -1
-CLEAN_TARGETS          := $(DIR) $(ZIPFILE)
+CLEAN_TARGETS          := tst_unzip.dir $(ZIPFILE)

 INSTALL_TARGETS                := unzip_tests.sh
 endif

Makefile.new        2009-12-18 17:38:00.000000000 +0900 renamed from Makefile    2009-12-18 17:48:40.000000000 +0900 +0 -0
@@ -45,13 +43,14 @@

 $(TESTCASES_DATA_DIR):
       mkdir -p "$@"

-$(ZIPFILE): | $(TESTCASES_DATA_DIR) $(DIR)
-       zip -r "$@" $(DIR)
+$(ZIPFILE): | $(TESTCASES_DATA_DIR) tst_unzip.dir
+       zip -r "$@" tst_unzip.dir
       chmod 00666 "$@"

Quoted 8 lines

 # This target should be auto-removed by Make
-$(DIR): $(abs_srcdir)/unzip_genfile.sh
-       $(SHELL) "$^" $(DIR)
+.INTERMEDIATE: tst_unzip.dir
+tst_unzip.dir: $(abs_srcdir)/unzip_genfile.sh
+       $(SHELL) "$^" tst_unzip.dir

 include $(top_srcdir)/include/mk/generic_leaf_target.mk

I'm not convinced that this is the right solution because most of what's done here just replaced $(DIR)'s value with the bareword value. .INTERMEDIATE may be the only piece of value here, but I was avoiding it because it's a 3.81-ism I thought...

Thanks,
-Garrett

------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community Take advantage of Verizon's best-in-class app development support A streamlined, 14 day to market process makes app distribution fast and easy Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list