コード例 #1
0
/* ****************************************************************************
*
* main - 
*/
int main(int argC, char** argV)
{
  paConfig("usage and exit on any warning", (void*) true);
  paConfig("log to screen",                 (void*) "only errors");
  paConfig("log file line format",          (void*) "TYPE:DATE:EXEC-AUX/FILE[LINE](p.PID)(t.TID) FUNC: TEXT");
  paConfig("screen line format",            (void*) "TYPE@TIME  EXEC: TEXT");
  paConfig("log to file",                   (void*) true);
  paConfig("default value", "-logDir",      (void*) "/tmp");
  paConfig("man author",                    "Fermín Galán and Ken Zangelin");

  if (argC > 1)
  {
     if (strcmp(argV[1], "-t") == 0)
       paParse(paArgs, 3, argV, 3, false);
     else
       paParse(paArgs, 1, argV, 1, false);
  }
  else
    paParse(paArgs, 1, argV, 1, false);

  LM_M(("Init tests"));
  orionInit(exitFunction, orionUnitTestVersion, SemReadWriteOp, false);
  setupDatabase();

  LM_M(("Run all tests"));
  ::testing::InitGoogleMock(&argC, argV);
  return RUN_ALL_TESTS();
}
コード例 #2
0
/* ****************************************************************************
*
* main -
*/
int main(int argC, char* argV[])
{
  char* fName = "main";

  paConfig("trace levels", "0-255");
  paConfig("help file",     "/users/kzangeli/systems/parseArgs/parseTest3.help");
  paConfig("log to file",   (void*) TRUE);

  paParse(NULL, argC, argV, 1, FALSE);

  lmVerbose = true;
  LM_V(("line with newlines ...\n 1\n2\n3\n4\n"));

  return 0;
}
コード例 #3
0
ファイル: lmTest.cpp プロジェクト: jmmovilla/fiware-orion
/* ****************************************************************************
*
* main - 
*/
int main(int argC, char* argV[])
{
  paConfig("prefix", "LT_");

  paConfig("log to file", "/tmp/");
  paConfig("log file line format", "DEF");
  paConfig("log file time format", "DEF");
  paConfig("usage and exit on any warning", (void*) 1);

  paConfig("log to screen", "only errors");
  paConfig("screen line format", "TYPE:FUNC: TEXT");

  paParse(paArgs, argC, argV, 1, 0);

  pthread_t pid[10];
  for (int cIx = 0; cIx < 10; ++cIx)
    pthread_create(&pid[cIx], NULL, child, &cIx);

  for (int cIx = 0; cIx < 10; ++cIx)
    pthread_join(pid[cIx], NULL);

  //
  // FIXME P4: This test program should be a unit test
  //
  // Now, lets see if we have 10000 lines in the logfile
  // Actually, 4 lines is the header, so the total should be 1004 lines
  //
  int lines = lmLogLinesGet();

  if (lines == 10004)
    printf("OK\n");
  else
    printf("Error - log file has %d lines. Should have 1004\n", lines);

  return 0;
}
コード例 #4
0
int main(int argC, char* argV[])
{
	char* fName = "main";

	paConfig("prefix", "P2_");
	paConfig("log to file", "/tmp/");
	paConfig("msgs to stdout", (void*) FALSE);
	paParse(NULL, argC, argV, 1, FALSE);

	LM_V(("verbose message"));
	if (paResultString[0] != 0)
		printf("Got a paResultString:\n%s", paResultString);
	else if (paWarnings != 0)
	{
		int ix;

		printf("Got warnings:\n");
		for (ix = 0; ix < paWarnings; ix++)
			printf("Severity %02d: %s\n", paWarning[ix].severity, paWarning[ix].string);
		printf("\n");
	}

	return 0;
}