source: trunk/IPs/systemC/processor/Morpheo/TopLevel/SelfTest/src/main.cpp @ 88

Last change on this file since 88 was 88, checked in by rosiere, 15 years ago

Almost complete design
with Test and test platform

  • Property svn:keywords set to Id
File size: 1.5 KB
Line 
1/*
2 * $Id: main.cpp 88 2008-12-10 18:31:39Z rosiere $
3 *
4 * [ Description ]
5 *
6 */
7
8#include "TopLevel/SelfTest/include/test.h"
9
10#define NB_PARAMS 3
11
12void usage (int argc, char * argv[])
13{
14  err (_("<Usage> %s name_instance list_params.\n"),argv[0]);
15  err (_("list_params is :\n"));
16  err (_(" * filename_simulator (string)\n"));
17  err (_(" * filename_generator (string)\n"));
18  err (_(" * filename_instance  (string)\n"));
19
20  exit (1);
21}
22
23#ifndef SYSTEMC
24int main    (int argc, char * argv[])
25#else
26int sc_main (int argc, char * argv[])
27#endif
28{
29  for (int32_t i=0; i<argc; ++i)
30    msg("%s ",argv[i]);
31  msg("\n");
32
33  if (argc != static_cast<int>(2+NB_PARAMS))
34    usage (argc, argv);
35
36  uint32_t x = 1;
37
38  string name               = argv[x++];
39  string filename_simulator = argv[x++];
40  string filename_generator = argv[x++];
41  string filename_instance  = argv[x++];
42
43  int _return = EXIT_SUCCESS;
44  try 
45    {
46      test (name,
47            filename_simulator,
48            filename_generator,
49            filename_instance,
50            NULL
51// &(morpheo::behavioural::custom::example_get_custom_information)
52            );
53    }
54  catch (morpheo::ErrorMorpheo & error)
55    {
56      msg (_("<%s> :\n%s"),name.c_str(), error.what ());
57      _return = EXIT_FAILURE;
58    }
59
60  try 
61    {
62      if (_return == EXIT_SUCCESS)
63        TEST_OK("Morpheo : no error");
64      else
65        TEST_KO("Morpheo : a lot of error");
66    }
67  catch (morpheo::ErrorMorpheo & error)
68    {
69//       msg (_("<%s> :\n%s"),name.c_str(), error.what ());
70      _return = EXIT_FAILURE;
71    }
72
73  return (_return);
74}
Note: See TracBrowser for help on using the repository browser.