39 #include <sys/types.h>
43 #include <irplib_plugin.h>
49 # define STRINGIFY(macro) CPL_XSTRINGIFY(macro)
50 # define LOG_FILE_NAME STRINGIFY(UVES_TEST_NAME)"-test-run.log"
51 # define TEST_NAME STRINGIFY(UVES_TEST_NAME)
53 # define LOG_FILE_NAME __FILE__
54 # define TEST_NAME __FILE__
81 const char * tags[] = {
95 "INSTR_RESPONSE_REDL",
96 "INSTR_RESPONSE_REDU",
109 "ORDER_GUESS_TAB_REDL",
110 "ORDER_GUESS_TAB_REDU",
117 "ARC_LAMP_FORM_BLUE",
125 "INSTR_RESPONSE_BLUE",
128 "INSTR_RESPONSE_BLUE",
132 "ORDER_GUESS_TAB_BLUE",
143 "FIB_ARC_LAMP_FORM_RED",
153 "FIB_ARC_LAMP_FORM_RED",
171 "FIB_ORDEF_TABLE_REDL",
172 "FIB_ORDEF_TABLE_REDU",
185 "FIB_LINE_TABLE_REDL",
186 "FIB_LINE_TABLE_REDU",
187 "FIB_ORDEF_TABLE_REDL",
188 "FIB_ORDEF_TABLE_REDU",
204 cpl_pluginlist * pluginlist;
205 const size_t ntags =
sizeof(tags) /
sizeof(
char*);
207 char * old_dir = NULL;
208 char * new_dir = NULL;
210 cpl_test_init_macro(LOG_FILE_NAME, PACKAGE_BUGREPORT, CPL_MSG_WARNING);
214 old_dir = cpl_malloc(1024*4);
215 cpl_test_assert(old_dir != NULL);
216 cpl_test_assert(getcwd(old_dir, 1024*4) != NULL);
219 new_dir = cpl_sprintf(
"%s/workdir_%s_pid%d", old_dir, TEST_NAME,
221 cpl_test_assert(new_dir != NULL);
222 cpl_msg_debug(cpl_func,
"Changing current working directory to: %s",
224 cpl_test_assert(mkdir(new_dir, 0777) == 0);
225 cpl_test_assert(chdir(new_dir) == 0);
230 pluginlist = cpl_pluginlist_new();
234 cpl_test(!irplib_plugin_test(pluginlist, ntags, tags));
236 cpl_pluginlist_delete(pluginlist);
238 (void) system(
"rm -f "TEST_NAME
"*.fits");
242 cpl_msg_debug(cpl_func,
"Restoring current working directory to: %s",
244 cpl_test_assert(chdir(old_dir) == 0);
246 if (cpl_test_get_failed() == 0) {
247 cpl_test_assert(rmdir(new_dir) == 0);
251 return cpl_test_end(0);
int main(void)
Find a plugin and submit it to some tests.
#define uves_msg(...)
Print a message on 'info' or 'debug' level.
int cpl_plugin_get_info(cpl_pluginlist *list)
Build the list of available plugins, for this module.