+2017-06-15 Adhemerval Zanella <adhemerval.zanella@linaro.org>
+
+ * support/support_test_main.c (support_test_main): Use optstring
+ member for option string in getopt_long.
+ * support/test-driver.c: Add comment about CMDLINE_OPTSTRING.
+ (CMDLINE_OPTSTRING): New define.
+ * support/test-driver.h (test_config): Add optstring member.
+
2017-06-15 H.J. Lu <hongjiu.lu@intel.com>
* sysdeps/x86_64/multiarch/Makefile (sysdep_routines): Add
mallopt (M_PERTURB, 42);
}
- while ((opt = getopt_long (argc, argv, "+", options, NULL)) != -1)
+ while ((opt = getopt_long (argc, argv, config->optstring, options, NULL))
+ != -1)
switch (opt)
{
case '?':
has this type:
void CMDLINE_PROCESS (int);
+
+ If the program also to process custom default short command line
+ argument (similar to getopt) it must define CMDLINE_OPTSTRING
+ with the expected options (for instance "vb").
*/
#include <support/test-driver.h>
#ifdef CMDLINE_PROCESS
test_config.cmdline_function = CMDLINE_PROCESS;
#endif
+#ifdef CMDLINE_OPTSTRING
+ test_config.optstring = "+" CMDLINE_OPTSTRING;
+#else
+ test_config.optstring = "+";
+#endif
return support_test_main (argc, argv, &test_config);
}
int expected_status; /* Expected exit status. */
int expected_signal; /* If non-zero, expect termination by signal. */
char no_mallopt; /* Boolean flag to disable mallopt. */
+ const char *optstring; /* Short command line options. */
};
enum