X-shooter Pipeline Reference Manual 3.8.15
Macros | Functions
tests.h File Reference
#include <cpl.h>
#include <xsh_drl.h>
#include <stdbool.h>
#include <xsh_data_order.h>
#include <config.h>
#include <stdlib.h>
#include <unistd.h>

Go to the source code of this file.

Macros

#define TESTS_INIT(DRL_ID)
 
#define TEST_END()
 
#define TESTS_XSH_INSTRUMENT_CREATE(instr, mode, arm, lamp, recipe)
 
#define TESTS_XSH_FRAME_CREATE(frame, tag, name)
 
#define TESTS_DATA(file)   XSH_TEST_DATA_PATH "/" file
 
#define TESTS_INIT_WORKSPACE(DRL_ID)
 
#define TESTS_CLEAN_WORKSPACE(DRL_ID)
 
#define XSH_DRL_FUNC_RMS   0.01
 
#define XSH_FLOAT_PRECISION   0.000003
 

Functions

void tests_set_defaults (cpl_parameterlist *parlist)
 Set unset parameters to default value.
 
cpl_image * xsh_test_create_bias_image (const char *name, int nx, int ny, xsh_instrument *instrument)
 
cpl_propertylist * mkHeader (XSH_INSTRCONFIG *iconfig, int nx, int ny, double exptime)
 
void setHeader (cpl_propertylist *header, XSH_INSTRCONFIG *iconfig, int nx, int ny, double exptime)
 
cpl_frame * xsh_test_create_frame (const char *name, int nx, int ny, const char *tag, cpl_frame_group group, xsh_instrument *instrument)
 
void add_to_order_list (xsh_order_list *list, int order, int absorder, cpl_polynomial *poly, int xdelta, int starty, int endy)
 
xsh_order_listcreate_order_list (int norder, xsh_instrument *instrument)
 
cpl_image * create_order_image (xsh_order_list *list, int nx, int ny)
 
cpl_frame * create_rectify_nod_list (int dual, const char *fname, xsh_instrument *instr)
 
cpl_frameset * sof_to_frameset (const char *sof_name)
 
xsh_instrumentcreate_instrument (const char *filename)
 

Macro Definition Documentation

◆ TEST_END

#define TEST_END ( )
Value:
cpl_end()
void xsh_free_temporary_files(void)
Free temprary files list.
Definition: xsh_utils.c:1451

Definition at line 111 of file tests.h.

◆ TESTS_CLEAN_WORKSPACE

#define TESTS_CLEAN_WORKSPACE (   DRL_ID)
Value:
/* Delete the test sub-directory if it exists and no errors \
* were found when running the unit tests. */ \
(void) chdir(".."); \
if (cpl_error_get_code() == CPL_ERROR_NONE) { \
(void) system("test -d workspace_Test-"DRL_ID \
" && rm -r -f workspace_Test-"DRL_ID); \
} \

Definition at line 139 of file tests.h.

◆ TESTS_DATA

#define TESTS_DATA (   file)    XSH_TEST_DATA_PATH "/" file

Definition at line 131 of file tests.h.

◆ TESTS_INIT

#define TESTS_INIT (   DRL_ID)
Value:
do { \
cpl_init(CPL_INIT_DEFAULT); \
xsh_init(); \
cpl_msg_set_domain("Test-" DRL_ID); \
} while(false)

Definition at line 105 of file tests.h.

◆ TESTS_INIT_WORKSPACE

#define TESTS_INIT_WORKSPACE (   DRL_ID)
Value:
/* Create an new workspace and change to that directory. */ \
(void) system("test -d workspace_Test-"DRL_ID \
" || mkdir workspace_Test-"DRL_ID); \
(void) chdir("workspace_Test-"DRL_ID);

Definition at line 133 of file tests.h.

◆ TESTS_XSH_FRAME_CREATE

#define TESTS_XSH_FRAME_CREATE (   frame,
  tag,
  name 
)
Value:
frame = cpl_frame_new();\
cpl_frame_set_filename( frame, name);\
cpl_frame_set_level( frame, CPL_FRAME_LEVEL_TEMPORARY);\
cpl_frame_set_group( frame, CPL_FRAME_GROUP_RAW);\
cpl_frame_set_tag( frame, tag)

Definition at line 123 of file tests.h.

◆ TESTS_XSH_INSTRUMENT_CREATE

#define TESTS_XSH_INSTRUMENT_CREATE (   instr,
  mode,
  arm,
  lamp,
  recipe 
)
Value:
instr = xsh_instrument_new() ;\
xsh_instrument_set_mode( instr, mode) ;\
xsh_instrument_set_arm( instr, arm) ;\
xsh_instrument_set_lamp( instr, lamp) ;\
xsh_instrument_set_recipe_id( instr, recipe) ;\
xsh_msg( " recipe_id: %s", instr->recipe_id )
static char mode[32]
xsh_instrument * xsh_instrument_new(void)
create new instrument structure

Definition at line 115 of file tests.h.

◆ XSH_DRL_FUNC_RMS

#define XSH_DRL_FUNC_RMS   0.01

Definition at line 149 of file tests.h.

◆ XSH_FLOAT_PRECISION

#define XSH_FLOAT_PRECISION   0.000003

Definition at line 150 of file tests.h.