# HG changeset patch # User Craig Mohrman # Date 1438399131 25200 # Node ID 1841446970afe5267ed6d1070cdaadaf5e8a5e03 # Parent a766705f467f021281ef3062fa3c0988f7d3430d 21526480 gperf needs test and system-test targets hooked up diff -r a766705f467f -r 1841446970af components/gperf/Makefile --- a/components/gperf/Makefile Fri Jul 31 14:38:43 2015 -0700 +++ b/components/gperf/Makefile Fri Jul 31 20:18:51 2015 -0700 @@ -47,6 +47,35 @@ ASLR_MODE = $(ASLR_ENABLE) +# test/system-test is tricky. +# Reason being is this component bundles! test results +# with the source and those results are compared against +# generated results. +# Unfortunately these test results embed the string: +# /* Command-line: ../src/gperf -L C -F ', 0, 0' -j1 -i 1 -g +# which contains the actual command run: ../src/gperf +# That string is correct for test but system-test will have /usr/bin/gperf +# do a sed is run over the bundled test results with /usr/bin/gperf +# so that an internal compare will pass. +# Put another way this component does internally what the userland +# test infrastructure is doing. + +# modify bundled test results for system-test +COMPONENT_PRE_SYSTEM_TEST_ACTION = \ + ($(GSED) -i -e "s|../src/gperf|/usr/bin/gperf|" \ + $(SOURCE_DIR)/tests/*.exp) + +COMPONENT_SYSTEM_TEST_ARGS = GPERF=/usr/bin/gperf + +# normalize the name of gperf +# remove compilation lines +COMPONENT_TEST_TRANSFORMS += \ + '-e "s|../src/gperf|gperf|g" ' \ + '-e "s|/usr/bin/gperf|gperf|g" ' \ + '-e "s|^.*$(CC).*$$|XXX_CC_XXX|g" ' \ + '-e "/^XXX_CC_XXX$$/d" ' + + configure: $(CONFIGURE_64) build: $(BUILD_64) @@ -55,7 +84,8 @@ test: $(TEST_64) -system-test: $(SYSTEM_TESTS_NOT_IMPLEMENTED) +# must build tests before use +system-test: build $(SYSTEM_TEST_64) REQUIRED_PACKAGES += system/library diff -r a766705f467f -r 1841446970af components/gperf/test/results-64.master --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/components/gperf/test/results-64.master Fri Jul 31 20:18:51 2015 -0700 @@ -0,0 +1,88 @@ +make[1]: Entering directory `$(@D)' +cd lib; /usr/gnu/bin/make check +make[2]: Entering directory `$(@D)/lib' +make[2]: Nothing to be done for `check'. +make[2]: Leaving directory `$(@D)/lib' +cd src; /usr/gnu/bin/make check +make[2]: Entering directory `$(@D)/src' +make[2]: Nothing to be done for `check'. +make[2]: Leaving directory `$(@D)/src' +cd tests; /usr/gnu/bin/make check +make[2]: Entering directory `$(@D)/tests' +performing some tests of the perfect hash generator +gperf -c -l -S1 -I -o $(SOURCE_DIR)/tests/c.gperf > cinset.c +testing ANSI C reserved words, all items should be found in the set +./cout -v < $(SOURCE_DIR)/tests/c.gperf | tr -d '\r' > c.out +diff $(SOURCE_DIR)/tests/c.exp c.out +gperf -k1,4,'$' -I $(SOURCE_DIR)/tests/ada.gperf > adainset.c +testing Ada reserved words, all items should be found in the set +./aout -v < $(SOURCE_DIR)/tests/ada.gperf | tr -d '\r' > ada-res.out +diff $(SOURCE_DIR)/tests/ada-res.exp ada-res.out +gperf -D -k1,'$' -s 2 -I -o $(SOURCE_DIR)/tests/adadefs.gperf > preinset.c +1 input keys have identical hash values, examine output carefully... +testing Ada predefined words, all items should be found in the set +./preout -v < $(SOURCE_DIR)/tests/adadefs.gperf | tr -d '\r' > ada-pred.out +diff $(SOURCE_DIR)/tests/ada-pred.exp ada-pred.out +gperf -k1,2,'$' -I -o $(SOURCE_DIR)/tests/modula3.gperf > m3inset.c +testing Modula3 reserved words, all items should be found in the set +./m3out -v < $(SOURCE_DIR)/tests/modula3.gperf | tr -d '\r' > modula.out +diff $(SOURCE_DIR)/tests/modula.exp modula.out +gperf -o -S2 -I < $(SOURCE_DIR)/tests/pascal.gperf > pinset.c +testing Pascal reserved words, all items should be found in the set +./pout -v < $(SOURCE_DIR)/tests/pascal.gperf | tr -d '\r' > pascal.out +diff $(SOURCE_DIR)/tests/pascal.exp pascal.out +gperf -k1 -t -I -K foreign_name < $(SOURCE_DIR)/tests/lang-utf8.gperf > lu8inset.c +testing UTF-8 encoded languages, all items should be found in the set +sed -e '1,6d' -e 's/,.*//' < $(SOURCE_DIR)/tests/lang-utf8.gperf | ./lu8out -v | tr -d '\r' > lang-utf8.out +diff $(SOURCE_DIR)/tests/lang-utf8.exp lang-utf8.out +gperf -k4 -t -l -I -K foreign_name < $(SOURCE_DIR)/tests/lang-ucs2.gperf > lu2inset.c +testing UCS-2 encoded languages, all items should be found in the set +./lu2out -v < $(SOURCE_DIR)/tests/lang-ucs2.in | tr -d '\r' > lang-ucs2.out +diff $(SOURCE_DIR)/tests/lang-ucs2.exp lang-ucs2.out +testing SMTP keywords, case-insensitive +gperf --struct-type --readonly-table --enum --global -K field_name -N header_entry --ignore-case $(SOURCE_DIR)/tests/smtp.gperf > smtp.c +./smtp +gperf --struct-type --readonly-table --enum --global -K field_name -N header_entry --ignore-case --compare-strncmp $(SOURCE_DIR)/tests/smtp.gperf > smtp.c +./smtp +gperf --struct-type --readonly-table --enum --global -K field_name -N header_entry --ignore-case --compare-lengths $(SOURCE_DIR)/tests/smtp.gperf > smtp.c +./smtp +gperf -L C -F ', 0, 0' -j1 -i 1 -g -o -t -G -N is_reserved_word -k1,3,'$' < $(SOURCE_DIR)/tests/c-parse.gperf | tr -d '\r' | sed -e 's|[^ ]*[/\\][\\]*src[/\\][\\]*gperf[^ ]*|gperf|' > c-parse.out +diff $(SOURCE_DIR)/tests/c-parse.exp c-parse.out +gperf -j1 -i 1 -g -o -t -N is_reserved_word -k1,3,'$' < $(SOURCE_DIR)/tests/objc.gperf | tr -d '\r' | sed -e 's|[^ ]*[/\\][\\]*src[/\\][\\]*gperf[^ ]*|gperf|' > objc.out +diff $(SOURCE_DIR)/tests/objc.exp objc.out +gperf -L C -F ', 0, 0, 0' -D -E -S1 -j1 -i 1 -g -o -t -k'*' < $(SOURCE_DIR)/tests/chill.gperf | tr -d '\r' | sed -e 's|[^ ]*[/\\][\\]*src[/\\][\\]*gperf[^ ]*|gperf|' > chill.out +diff $(SOURCE_DIR)/tests/chill.exp chill.out +gperf -L C -F ', 0, 0' -j1 -g -o -t -N is_reserved_word -k1,4,7,'$' < $(SOURCE_DIR)/tests/cplusplus.gperf | tr -d '\r' | sed -e 's|[^ ]*[/\\][\\]*src[/\\][\\]*gperf[^ ]*|gperf|' > cplusplus.out +diff $(SOURCE_DIR)/tests/cplusplus.exp cplusplus.out +gperf -L C -F ', 0' -t -j1 -i 1 -g -o -N java_keyword -k1,3,'$' < $(SOURCE_DIR)/tests/java.gperf | tr -d '\r' | sed -e 's|[^ ]*[/\\][\\]*src[/\\][\\]*gperf[^ ]*|gperf|' > java.out +diff $(SOURCE_DIR)/tests/java.exp java.out +gperf -n -k1-8 -l < $(SOURCE_DIR)/tests/modula2.gperf | tr -d '\r' | sed -e 's|[^ ]*[/\\][\\]*src[/\\][\\]*gperf[^ ]*|gperf|' > modula2.out +diff $(SOURCE_DIR)/tests/modula2.exp modula2.out +gperf -D -t -k1,'$' < $(SOURCE_DIR)/tests/c-parse.gperf | tr -d '\r' | sed -e 's|[^ ]*[/\\][\\]*src[/\\][\\]*gperf[^ ]*|gperf|' > test-4.out +8 input keys have identical hash values, examine output carefully... +diff $(SOURCE_DIR)/tests/test-4.exp test-4.out +gperf -g -o -j1 -t -N is_reserved_word < $(SOURCE_DIR)/tests/gpc.gperf | tr -d '\r' | sed -e 's|[^ ]*[/\\][\\]*src[/\\][\\]*gperf[^ ]*|gperf|' > gpc.out +diff $(SOURCE_DIR)/tests/gpc.exp gpc.out +gperf -m5 < $(SOURCE_DIR)/tests/permut2.gperf | tr -d '\r' | sed -e 's|[^ ]*[/\\][\\]*src[/\\][\\]*gperf[^ ]*|gperf|' > permut2.out +diff $(SOURCE_DIR)/tests/permut2.exp permut2.out +gperf -m5 < $(SOURCE_DIR)/tests/permut3.gperf | tr -d '\r' | sed -e 's|[^ ]*[/\\][\\]*src[/\\][\\]*gperf[^ ]*|gperf|' > permut3.out +diff $(SOURCE_DIR)/tests/permut3.exp permut3.out +gperf -m5 --ignore-case < $(SOURCE_DIR)/tests/permutc2.gperf | tr -d '\r' | sed -e 's|[^ ]*[/\\][\\]*src[/\\][\\]*gperf[^ ]*|gperf|' > permutc2.out +diff $(SOURCE_DIR)/tests/permutc2.exp permutc2.out +gperf -C -E -G -I -t < $(SOURCE_DIR)/tests/charsets.gperf | tr -d '\r' | sed -e 's|[^ ]*[/\\][\\]*src[/\\][\\]*gperf[^ ]*|gperf|' > charsets.out +diff $(SOURCE_DIR)/tests/charsets.exp charsets.out +gperf -C -E -G -I -t < $(SOURCE_DIR)/tests/languages.gperf | tr -d '\r' | sed -e 's|[^ ]*[/\\][\\]*src[/\\][\\]*gperf[^ ]*|gperf|' > languages.out +diff $(SOURCE_DIR)/tests/languages.exp languages.out +gperf -t < $(SOURCE_DIR)/tests/incomplete.gperf | tr -d '\r' | sed -e 's|[^ ]*[/\\][\\]*src[/\\][\\]*gperf[^ ]*|gperf|' > incomplete.out +diff $(SOURCE_DIR)/tests/incomplete.exp incomplete.out +gperf -h | tr -d '\r' | sed -e 's|[^ ]*[/\\][\\]*src[/\\][\\]*gperf[^ ]*|gperf|' > test-6.out +diff $(SOURCE_DIR)/tests/test-6.exp test-6.out +only if, do, for, case, goto, else, while, and return should be found +./aout -v < $(SOURCE_DIR)/tests/c.gperf | tr -d '\r' | sed -e 's|[^ ]*[/\\][\\]*src[/\\][\\]*gperf[^ ]*|gperf|' > test-7.out +diff $(SOURCE_DIR)/tests/test-7.exp test-7.out +make[2]: Leaving directory `$(@D)/tests' +cd doc; /usr/gnu/bin/make check +make[2]: Entering directory `$(@D)/doc' +make[2]: Nothing to be done for `check'. +make[2]: Leaving directory `$(@D)/doc' +make[1]: Leaving directory `$(@D)'