From: Karel Zak Date: Fri, 22 Apr 2016 11:39:31 +0000 (+0200) Subject: tests: move getopt to separate directory X-Git-Tag: v2.29-rc1~271 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b6782d869710557b1f2252c03dda23b5fa246ac3;p=thirdparty%2Futil-linux.git tests: move getopt to separate directory Signed-off-by: Karel Zak --- diff --git a/tests/expected/misc/getopt b/tests/expected/getopt/basic similarity index 100% rename from tests/expected/misc/getopt rename to tests/expected/getopt/basic diff --git a/tests/expected/misc/getopt2-alternative_option_clash b/tests/expected/getopt/options-alternative_option_clash similarity index 100% rename from tests/expected/misc/getopt2-alternative_option_clash rename to tests/expected/getopt/options-alternative_option_clash diff --git a/tests/expected/misc/getopt2-alternative_option_long b/tests/expected/getopt/options-alternative_option_long similarity index 100% rename from tests/expected/misc/getopt2-alternative_option_long rename to tests/expected/getopt/options-alternative_option_long diff --git a/tests/expected/misc/getopt2-alternative_option_short b/tests/expected/getopt/options-alternative_option_short similarity index 100% rename from tests/expected/misc/getopt2-alternative_option_short rename to tests/expected/getopt/options-alternative_option_short diff --git a/tests/expected/misc/getopt3-compatible b/tests/expected/getopt/options-compatible similarity index 100% rename from tests/expected/misc/getopt3-compatible rename to tests/expected/getopt/options-compatible diff --git a/tests/expected/misc/getopt3-csh b/tests/expected/getopt/options-csh similarity index 100% rename from tests/expected/misc/getopt3-csh rename to tests/expected/getopt/options-csh diff --git a/tests/expected/misc/getopt2-invalid_getopt_option b/tests/expected/getopt/options-invalid_getopt_option similarity index 100% rename from tests/expected/misc/getopt2-invalid_getopt_option rename to tests/expected/getopt/options-invalid_getopt_option diff --git a/tests/expected/misc/getopt2-invocation_model_one b/tests/expected/getopt/options-invocation_model_one similarity index 100% rename from tests/expected/misc/getopt2-invocation_model_one rename to tests/expected/getopt/options-invocation_model_one diff --git a/tests/expected/misc/getopt2-invocation_model_three_as_one b/tests/expected/getopt/options-invocation_model_three_as_one similarity index 100% rename from tests/expected/misc/getopt2-invocation_model_three_as_one rename to tests/expected/getopt/options-invocation_model_three_as_one diff --git a/tests/expected/misc/getopt2-invocation_model_two_as_one b/tests/expected/getopt/options-invocation_model_two_as_one similarity index 100% rename from tests/expected/misc/getopt2-invocation_model_two_as_one rename to tests/expected/getopt/options-invocation_model_two_as_one diff --git a/tests/expected/misc/getopt2-invocation_without_parameters b/tests/expected/getopt/options-invocation_without_parameters similarity index 100% rename from tests/expected/misc/getopt2-invocation_without_parameters rename to tests/expected/getopt/options-invocation_without_parameters diff --git a/tests/expected/misc/getopt2-long_option_ambiguous_1 b/tests/expected/getopt/options-long_option_ambiguous_1 similarity index 100% rename from tests/expected/misc/getopt2-long_option_ambiguous_1 rename to tests/expected/getopt/options-long_option_ambiguous_1 diff --git a/tests/expected/misc/getopt2-longopts b/tests/expected/getopt/options-longopts similarity index 100% rename from tests/expected/misc/getopt2-longopts rename to tests/expected/getopt/options-longopts diff --git a/tests/expected/misc/getopt2-name_option_long b/tests/expected/getopt/options-name_option_long similarity index 100% rename from tests/expected/misc/getopt2-name_option_long rename to tests/expected/getopt/options-name_option_long diff --git a/tests/expected/misc/getopt2-name_option_short b/tests/expected/getopt/options-name_option_short similarity index 100% rename from tests/expected/misc/getopt2-name_option_short rename to tests/expected/getopt/options-name_option_short diff --git a/tests/expected/misc/getopt3-no-arguments b/tests/expected/getopt/options-no-arguments similarity index 100% rename from tests/expected/misc/getopt3-no-arguments rename to tests/expected/getopt/options-no-arguments diff --git a/tests/expected/misc/getopt3-non-option b/tests/expected/getopt/options-non-option similarity index 100% rename from tests/expected/misc/getopt3-non-option rename to tests/expected/getopt/options-non-option diff --git a/tests/expected/misc/getopt3-posix_correctly b/tests/expected/getopt/options-posix_correctly similarity index 100% rename from tests/expected/misc/getopt3-posix_correctly rename to tests/expected/getopt/options-posix_correctly diff --git a/tests/expected/misc/getopt2-quiet_option_long b/tests/expected/getopt/options-quiet_option_long similarity index 100% rename from tests/expected/misc/getopt2-quiet_option_long rename to tests/expected/getopt/options-quiet_option_long diff --git a/tests/expected/misc/getopt2-quiet_option_short b/tests/expected/getopt/options-quiet_option_short similarity index 100% rename from tests/expected/misc/getopt2-quiet_option_short rename to tests/expected/getopt/options-quiet_option_short diff --git a/tests/expected/misc/getopt2-quiet_output_option_long b/tests/expected/getopt/options-quiet_output_option_long similarity index 100% rename from tests/expected/misc/getopt2-quiet_output_option_long rename to tests/expected/getopt/options-quiet_output_option_long diff --git a/tests/expected/misc/getopt2-quiet_output_option_short b/tests/expected/getopt/options-quiet_output_option_short similarity index 100% rename from tests/expected/misc/getopt2-quiet_output_option_short rename to tests/expected/getopt/options-quiet_output_option_short diff --git a/tests/expected/misc/getopt2-same_long_short_options b/tests/expected/getopt/options-same_long_short_options similarity index 100% rename from tests/expected/misc/getopt2-same_long_short_options rename to tests/expected/getopt/options-same_long_short_options diff --git a/tests/expected/misc/getopt3-sh b/tests/expected/getopt/options-sh similarity index 100% rename from tests/expected/misc/getopt3-sh rename to tests/expected/getopt/options-sh diff --git a/tests/expected/misc/getopt2-test_for_enhanced_getopt b/tests/expected/getopt/options-test_for_enhanced_getopt similarity index 100% rename from tests/expected/misc/getopt2-test_for_enhanced_getopt rename to tests/expected/getopt/options-test_for_enhanced_getopt diff --git a/tests/expected/misc/getopt2-unknown_options b/tests/expected/getopt/options-unknown_options similarity index 100% rename from tests/expected/misc/getopt2-unknown_options rename to tests/expected/getopt/options-unknown_options diff --git a/tests/expected/misc/getopt2-unquoted_option_bash b/tests/expected/getopt/options-unquoted_option_bash similarity index 100% rename from tests/expected/misc/getopt2-unquoted_option_bash rename to tests/expected/getopt/options-unquoted_option_bash diff --git a/tests/expected/misc/getopt2-unquoted_option_tcsh b/tests/expected/getopt/options-unquoted_option_tcsh similarity index 100% rename from tests/expected/misc/getopt2-unquoted_option_tcsh rename to tests/expected/getopt/options-unquoted_option_tcsh diff --git a/tests/expected/misc/getopt2-weird_quoting_bash b/tests/expected/getopt/options-weird_quoting_bash similarity index 100% rename from tests/expected/misc/getopt2-weird_quoting_bash rename to tests/expected/getopt/options-weird_quoting_bash diff --git a/tests/expected/misc/getopt2-weird_quoting_tcsh b/tests/expected/getopt/options-weird_quoting_tcsh similarity index 100% rename from tests/expected/misc/getopt2-weird_quoting_tcsh rename to tests/expected/getopt/options-weird_quoting_tcsh diff --git a/tests/ts/misc/getopt b/tests/ts/getopt/basic similarity index 98% rename from tests/ts/misc/getopt rename to tests/ts/getopt/basic index 460f8a83be..be2928bc1a 100755 --- a/tests/ts/misc/getopt +++ b/tests/ts/getopt/basic @@ -16,7 +16,7 @@ # file in misc/ directory. TS_TOPDIR="${0%/*}/../.." -TS_DESC="getopt" +TS_DESC="basic" . $TS_TOPDIR/functions.sh ts_init "$*" diff --git a/tests/ts/misc/getopt2 b/tests/ts/getopt/options similarity index 80% rename from tests/ts/misc/getopt2 rename to tests/ts/getopt/options index 8ca2d55461..c9ac53dd31 100755 --- a/tests/ts/misc/getopt2 +++ b/tests/ts/getopt/options @@ -13,7 +13,7 @@ # GNU General Public License for more details. TS_TOPDIR="${0%/*}/../.." -TS_DESC="getopt2" +TS_DESC="options" . $TS_TOPDIR/functions.sh @@ -190,4 +190,42 @@ echo "exit value: $?" >> $TS_OUTPUT gnu_getopt_clean ts_finalize_subtest +ts_init_subtest compatible +$TS_CMD_GETOPT >> $TS_OUTPUT 2>&1 +echo "exit value: $?" >> $TS_OUTPUT +GETOPT_COMPATIBLE='' $TS_CMD_GETOPT >> $TS_OUTPUT 2>&1 +echo "exit value: $?" >> $TS_OUTPUT +sed -i '1,1s/.*\///' $TS_OUTPUT +ts_finalize_subtest + +ts_init_subtest sh +$TS_CMD_GETOPT --shell=sh -o ab:c:: --long a-long,b-long:,c-long:: -n 'example.sh' -- -a -b 1 -c2 --a-long --b-long 3 --c-long foo bar >> $TS_OUTPUT 2>&1 +echo "exit value: $?" >> $TS_OUTPUT +ts_finalize_subtest + +ts_init_subtest csh +$TS_CMD_GETOPT --shell=csh -o ab:c:: --long a-long,b-long:,c-long:: -n 'example.csh' -- -a -b 1 -c2 --a-long --b-long 3 --c-long foo bar >> $TS_OUTPUT 2>&1 +echo "exit value: $?" >> $TS_OUTPUT +ts_finalize_subtest + +ts_init_subtest no-arguments +$TS_CMD_GETOPT >> $TS_OUTPUT 2>&1 +echo "exit value: $?" >> $TS_OUTPUT +sed -i '1,1s/.*\///' $TS_OUTPUT +ts_finalize_subtest + +ts_init_subtest posix_correctly +$TS_CMD_GETOPT -o +ab:c:: --long a-long,b-long:,c-long:: -n 'example' -- -a -b 1 -c2 --a-long --b-long 3 --c-long foo bar xyxxy --a-long >> $TS_OUTPUT 2>&1 +echo "exit value: $?" >> $TS_OUTPUT +POSIXLY_CORRECT='' $TS_CMD_GETOPT -o ab:c:: --long a-long,b-long:,c-long:: -n 'example' -- -a -b 1 -c2 --a-long --b-long 3 --c-long foo bar xyxxy --a-long >> $TS_OUTPUT 2>&1 +echo "exit value: $?" >> $TS_OUTPUT +ts_finalize_subtest + +ts_init_subtest non-option +$TS_CMD_GETOPT -o +a:b: -- -a x y -b z w >> $TS_OUTPUT 2>&1 +$TS_CMD_GETOPT -o a:b: -- -a x y -b z w >> $TS_OUTPUT 2>&1 +$TS_CMD_GETOPT -o -a:b: -- -a x y -b z w >> $TS_OUTPUT 2>&1 +echo "exit value: $?" >> $TS_OUTPUT +ts_finalize_subtest + ts_finalize diff --git a/tests/ts/misc/getopt3 b/tests/ts/misc/getopt3 deleted file mode 100755 index 68dc0698fc..0000000000 --- a/tests/ts/misc/getopt3 +++ /dev/null @@ -1,63 +0,0 @@ -#!/bin/bash - -# This file is part of util-linux. -# -# This file is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This file is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -TS_TOPDIR="${0%/*}/../.." -TS_DESC="getopt3" - -. $TS_TOPDIR/functions.sh - -ts_init "$*" -ts_check_test_command "$TS_CMD_GETOPT" - -export LANG=C - -ts_init_subtest compatible -$TS_CMD_GETOPT >> $TS_OUTPUT 2>&1 -echo "exit value: $?" >> $TS_OUTPUT -GETOPT_COMPATIBLE='' $TS_CMD_GETOPT >> $TS_OUTPUT 2>&1 -echo "exit value: $?" >> $TS_OUTPUT -sed -i '1,1s/.*\///' $TS_OUTPUT -ts_finalize_subtest - -ts_init_subtest sh -$TS_CMD_GETOPT --shell=sh -o ab:c:: --long a-long,b-long:,c-long:: -n 'example.sh' -- -a -b 1 -c2 --a-long --b-long 3 --c-long foo bar >> $TS_OUTPUT 2>&1 -echo "exit value: $?" >> $TS_OUTPUT -ts_finalize_subtest - -ts_init_subtest csh -$TS_CMD_GETOPT --shell=csh -o ab:c:: --long a-long,b-long:,c-long:: -n 'example.csh' -- -a -b 1 -c2 --a-long --b-long 3 --c-long foo bar >> $TS_OUTPUT 2>&1 -echo "exit value: $?" >> $TS_OUTPUT -ts_finalize_subtest - -ts_init_subtest no-arguments -$TS_CMD_GETOPT >> $TS_OUTPUT 2>&1 -echo "exit value: $?" >> $TS_OUTPUT -sed -i '1,1s/.*\///' $TS_OUTPUT -ts_finalize_subtest - -ts_init_subtest posix_correctly -$TS_CMD_GETOPT -o +ab:c:: --long a-long,b-long:,c-long:: -n 'example' -- -a -b 1 -c2 --a-long --b-long 3 --c-long foo bar xyxxy --a-long >> $TS_OUTPUT 2>&1 -echo "exit value: $?" >> $TS_OUTPUT -POSIXLY_CORRECT='' $TS_CMD_GETOPT -o ab:c:: --long a-long,b-long:,c-long:: -n 'example' -- -a -b 1 -c2 --a-long --b-long 3 --c-long foo bar xyxxy --a-long >> $TS_OUTPUT 2>&1 -echo "exit value: $?" >> $TS_OUTPUT -ts_finalize_subtest - -ts_init_subtest non-option -$TS_CMD_GETOPT -o +a:b: -- -a x y -b z w >> $TS_OUTPUT 2>&1 -$TS_CMD_GETOPT -o a:b: -- -a x y -b z w >> $TS_OUTPUT 2>&1 -$TS_CMD_GETOPT -o -a:b: -- -a x y -b z w >> $TS_OUTPUT 2>&1 -echo "exit value: $?" >> $TS_OUTPUT -ts_finalize_subtest - -ts_finalize