Last change
on this file since 99 was
88,
checked in by rosiere, 16 years ago
|
Almost complete design
with Test and test platform
|
File size:
1.2 KB
|
Rev | Line | |
---|
[2] | 1 | /* |
---|
| 2 | * $Id$ |
---|
| 3 | * |
---|
[73] | 4 | * [ Description ] |
---|
[2] | 5 | * |
---|
| 6 | */ |
---|
| 7 | |
---|
| 8 | #include "Behavioural/@DIRECTORY/SelfTest/include/test.h" |
---|
| 9 | |
---|
| 10 | #define NB_PARAMS 0 |
---|
| 11 | |
---|
[15] | 12 | void usage (int argc, char * argv[]) |
---|
[2] | 13 | { |
---|
[71] | 14 | err (_("<Usage> %s name_instance list_params.\n"),argv[0]); |
---|
| 15 | err (_("list_params is :\n")); |
---|
[83] | 16 | err (_(" * ()\n")); |
---|
[2] | 17 | |
---|
| 18 | exit (1); |
---|
| 19 | } |
---|
| 20 | |
---|
| 21 | #ifndef SYSTEMC |
---|
| 22 | int main (int argc, char * argv[]) |
---|
| 23 | #else |
---|
| 24 | int sc_main (int argc, char * argv[]) |
---|
| 25 | #endif |
---|
| 26 | { |
---|
[78] | 27 | if (argc != static_cast<int>(2+NB_PARAMS)) |
---|
[15] | 28 | usage (argc, argv); |
---|
[2] | 29 | |
---|
[78] | 30 | uint32_t x = 1; |
---|
[2] | 31 | |
---|
[78] | 32 | string name = argv[x++]; |
---|
[62] | 33 | |
---|
[78] | 34 | int _return = EXIT_SUCCESS; |
---|
[2] | 35 | try |
---|
| 36 | { |
---|
[50] | 37 | morpheo::behavioural::@NAMESPACE_USE::Parameters * param = new morpheo::behavioural::@NAMESPACE_USE::Parameters |
---|
[83] | 38 | ( |
---|
[88] | 39 | true //is_toplevel |
---|
[50] | 40 | ); |
---|
[2] | 41 | |
---|
[88] | 42 | msg(_("%s"),param->print(0).c_str()); |
---|
[2] | 43 | |
---|
| 44 | test (name,param); |
---|
| 45 | } |
---|
| 46 | catch (morpheo::ErrorMorpheo & error) |
---|
| 47 | { |
---|
[78] | 48 | msg (_("<%s> :\n%s"),name.c_str(), error.what ()); |
---|
| 49 | _return = EXIT_FAILURE; |
---|
[2] | 50 | } |
---|
[83] | 51 | |
---|
| 52 | try |
---|
[2] | 53 | { |
---|
[83] | 54 | if (_return == EXIT_SUCCESS) |
---|
| 55 | TEST_OK("@COMPONENT : no error"); |
---|
| 56 | else |
---|
| 57 | TEST_KO("@COMPONENT : a lot of error"); |
---|
| 58 | } |
---|
| 59 | catch (morpheo::ErrorMorpheo & error) |
---|
| 60 | { |
---|
[88] | 61 | // msg (_("<%s> :\n%s"),name.c_str(), error.what ()); |
---|
[78] | 62 | _return = EXIT_FAILURE; |
---|
[2] | 63 | } |
---|
| 64 | |
---|
[78] | 65 | return (_return); |
---|
[2] | 66 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.