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 | |
---|
12 | void 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 |
---|
24 | int main (int argc, char * argv[]) |
---|
25 | #else |
---|
26 | int 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 | } |
---|