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