Lhogho  0.0.028
 All Data Structures Files Functions Variables Typedefs Macros Pages
TestMaker.h File Reference

Go to the source code of this file.

Data Structures

struct  program_parameters_tag
 

Macros

#define __TEST_MAKER_H_07D957DB_2718_48C7_9981_03F095B9F7F9_INCLUDED
 

Helper macro definitions

#define TEXT(a)   a
 
#define SAFE_FREE(X)
 

Fixed width and sign data types

#define BYTE   unsigned char
 
#define UINT8   unsigned char
 
#define INT8   signed char
 
#define UINT16   unsigned short
 
#define INT16   signed short
 
#define UINT32   unsigned int
 
#define INT32   signed int
 
#define UINT64   unsigned long long
 
#define INT364   signed long long
 
#define NULL   (void *)0
 
#define BOOL   UINT32
 
#define TRUE   ((BOOL)1)
 
#define FALSE   ((BOOL)0)
 
#define TCHAR   char
 

Basic program defines

Defines of constants used in the main ptrogram

#define ARG_DIR   "dir"
 
#define ARG_STRICT_MODE   "strict"
 
#define ARG_PARAM   "param"
 
#define ARG_OUT   "out"
 
#define ARG_EXEC_MODE   "exec"
 
#define ARG_BUILD_MODE   "build"
 
#define ARG_COMPLIER   "compiler"
 
#define ARG_VERBOSE   "verbose"
 
#define ARG_INTEST   "intest"
 
#define ARG_HELP   "help"
 
#define MODE_TEST   0x01
 
#define MODE_BUILD   0x02
 
#define MODE_EXECUTE   0x04
 

Basic data struct definitions

typedef struct
program_parameters_tag 
program_parameters
 

Global variable definitions

program_parameters g_parameters
 

extern function definitions

RESULT process_directory ()
 Process all files in input directory. More...
 

Macro Definition Documentation

#define __TEST_MAKER_H_07D957DB_2718_48C7_9981_03F095B9F7F9_INCLUDED

Definition at line 23 of file TestMaker.h.

#define TEXT (   a)    a

Definition at line 32 of file TestMaker.h.

#define SAFE_FREE (   X)
Value:
{ \
if (X){ free(X); X = NULL; } \
}

Definition at line 35 of file TestMaker.h.

#define BYTE   unsigned char

Definition at line 46 of file TestMaker.h.

#define UINT8   unsigned char

Definition at line 47 of file TestMaker.h.

#define INT8   signed char

Definition at line 48 of file TestMaker.h.

#define UINT16   unsigned short

Definition at line 49 of file TestMaker.h.

#define INT16   signed short

Definition at line 50 of file TestMaker.h.

#define UINT32   unsigned int

Definition at line 51 of file TestMaker.h.

#define INT32   signed int

Definition at line 52 of file TestMaker.h.

#define UINT64   unsigned long long

Definition at line 53 of file TestMaker.h.

#define INT364   signed long long

Definition at line 54 of file TestMaker.h.

#define NULL   (void *)0

Definition at line 70 of file TestMaker.h.

#define BOOL   UINT32

Definition at line 74 of file TestMaker.h.

#define TRUE   ((BOOL)1)

Definition at line 78 of file TestMaker.h.

#define FALSE   ((BOOL)0)

Definition at line 82 of file TestMaker.h.

#define TCHAR   char

Definition at line 88 of file TestMaker.h.

#define ARG_DIR   "dir"

Definition at line 98 of file TestMaker.h.

#define ARG_STRICT_MODE   "strict"

Definition at line 99 of file TestMaker.h.

#define ARG_PARAM   "param"

Definition at line 100 of file TestMaker.h.

#define ARG_OUT   "out"

Definition at line 101 of file TestMaker.h.

#define ARG_EXEC_MODE   "exec"

Definition at line 102 of file TestMaker.h.

#define ARG_BUILD_MODE   "build"

Definition at line 103 of file TestMaker.h.

#define ARG_COMPLIER   "compiler"

Definition at line 104 of file TestMaker.h.

#define ARG_VERBOSE   "verbose"

Definition at line 105 of file TestMaker.h.

#define ARG_INTEST   "intest"

Definition at line 106 of file TestMaker.h.

#define ARG_HELP   "help"

Definition at line 107 of file TestMaker.h.

#define MODE_TEST   0x01

Definition at line 109 of file TestMaker.h.

#define MODE_BUILD   0x02

Definition at line 110 of file TestMaker.h.

#define MODE_EXECUTE   0x04

Definition at line 111 of file TestMaker.h.

Typedef Documentation

Function Documentation

RESULT process_directory ( )
Returns
RESULT code (see error.h)

Scan specified directory and for all test case files call process_one_file function.

Definition at line 356 of file process_file.c.

357 {
358  RESULT res = SUCCESS_FULL;
359 #if defined (_MSC_VER)
360  struct _finddata_t info;
361  char mask[1024];
362  intptr_t handle;
363 #elif defined (__GNUC__)
364  DIR * dirPtr = 0;
365  struct dirent * dirStruct = 0;
366 #endif
367 
368 
369 
370 #if defined (_MSC_VER)
371 
373  {
374  strcpy(mask, g_parameters.input_directory);
375  if (mask[strlen(mask)-1] != '\\')
376  {
377  strcat(mask, "\\");
378  }
379  }
380  else
381  {
382  mask[0] = 0;
383  }
384  strcat(mask, "*.");
385  strcat(mask, TARGET_FILE_EXTENSION);
386 
387  handle = _findfirst(mask, &info);
388  if (handle == -1)
389  {
390  return SUCCESS_EMPTY;
391  }
392 
393  do
394  {
395  res = process_one_file(info.name);
396  } while(_findnext(handle, &info) != -1);
397 
398  _findclose(handle);
399 
400 #elif defined (__GNUC__)
401 
403  {
404  dirPtr = opendir(g_parameters.input_directory);
405  }
406  else
407  {
408  dirPtr = opendir(".");
409  }
410 
411  if (dirPtr == 0)
412  {
413  return ERR_FILE;
414  }
415 
416  while ((dirStruct = readdir(dirPtr)) != 0)
417  {
418  size_t len = strlen(dirStruct->d_name);
419  if (!strcmp(dirStruct->d_name + len - strlen(TARGET_FILE_EXTENSION), TARGET_FILE_EXTENSION)
420  && dirStruct->d_name[len - strlen(TARGET_FILE_EXTENSION) - 1] == '.')
421  {
422  res = process_one_file(dirStruct->d_name);
423  }
424  }
425  closedir(dirPtr);
426 
427 #endif
428  return res;
429 }

Variable Documentation

program_parameters g_parameters

Definition at line 138 of file TestMaker.h.


[ HOME | INDEX | ATOMS | VARS | REFERENCE ]
Lhogho Developer's Documentation
Wed Jul 10 2013