dmake: do not set MAKEFLAGS=k
[unleashed/tickless.git] / usr / src / lib / cfgadm_plugins / ac / common / mema_test_config.c
blob8391b631d8f4820f1e0d901f6564d746dec39995
1 /*
2 * CDDL HEADER START
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
7 * with the License.
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
20 * CDDL HEADER END
23 * Copyright (c) 1996-1998 by Sun Microsystems, Inc.
24 * All rights reserved.
27 #pragma ident "%Z%%M% %I% %E% SMI"
29 #include <stddef.h>
30 #include <stdlib.h>
31 #include <sys/param.h>
32 #include <config_admin.h>
33 #include <memory.h>
34 #include "mema_test.h"
36 extern mtest_func_t memory_test_normal;
37 extern mtest_func_t memory_test_quick;
38 extern mtest_func_t memory_test_extended;
41 * Default test is first entry in the table (MTEST_DEFAULT_TEST).
43 struct mtest_table_ent mtest_table[] = {
44 {"normal", memory_test_normal},
45 {"quick", memory_test_quick},
46 {"extended", memory_test_extended},
49 static char **opt_array;
51 char **
52 mtest_build_opts(int *maxerr_idx)
54 if (opt_array == NULL) {
55 int nopts;
57 * Test "type" options here, max_errors should be the
58 * last one.
60 nopts = sizeof (mtest_table) / sizeof (mtest_table[0]);
61 *maxerr_idx = nopts;
64 * One extra option for "max_errors"
66 opt_array = (char **)malloc((nopts + 2) * sizeof (*opt_array));
67 if (opt_array != NULL) {
68 int i;
70 for (i = 0; i < nopts; i++)
71 opt_array[i] = (char *)mtest_table[i].test_name;
73 opt_array[nopts] = "max_errors";
74 opt_array[nopts + 1] = NULL;
77 *maxerr_idx = sizeof (mtest_table) / sizeof (mtest_table[0]);
78 return (opt_array);