blob: 83c5af9ed8ad00a6396eb6a01869b679f0ce5057 [file] [log] [blame]
Christophe Favergeon3b2a0ee2019-06-12 13:29:14 +02001#include <cstdlib>
2#include <cstdio>
3#include <iostream>
4#include "TestDesc.h"
5#include "Semihosting.h"
6#include "FPGA.h"
7#include "IORunner.h"
8#include "ArrayMemory.h"
9#include <stdlib.h>
10using namespace std;
11
Christophe Favergeond3e4eb92019-10-22 12:12:22 +010012#define MEMSIZE 230000
Christophe Favergeon3b2a0ee2019-06-12 13:29:14 +020013
14// Dummy (will be generated by python scripts)
15// char* array describing the tests and the input patterns.
16// Reference patterns are ignored in this case.
17#include "TestDrive.h"
18#include "Patterns.h"
19
20
Christophe Favergeon74a31ba2019-09-09 09:14:18 +010021
Christophe Favergeon3b2a0ee2019-06-12 13:29:14 +020022int testmain()
23{
24 char *memoryBuf=NULL;
Christophe Favergeon74a31ba2019-09-09 09:14:18 +010025
26
27
Christophe Favergeon3b2a0ee2019-06-12 13:29:14 +020028
29 memoryBuf = (char*)malloc(MEMSIZE);
30 if (memoryBuf !=NULL)
31 {
32 try
33 {
34 // Choice of a memory manager.
35 // Here we choose the Array one (only implemented one)
36 Client::ArrayMemory memory(memoryBuf,MEMSIZE);
37
38 // There is also possibility of using "FPGA" io
39 //Client::Semihosting io("../TestDesc.txt","../Patterns","../Output","../Parameters");
40 Client::FPGA io(testDesc,patterns);
41
42
43 // Pattern Manager making the link between IO and Memory
44 Client::PatternMgr mgr(&io,&memory);
45
46
47 // A Runner to run the test.
48 // An IO runner is driven by some IO
49 // In future one may have a client/server runner driven
50 // by a server running on a host.
51 Client::IORunner runner(&io,&mgr,Testing::kTestAndDump);
52
53
54 // Root object containing all the tests
55 Root d(1);
56
57 // Runner applied to the tree of tests
58 d.accept(&runner);
59
60 }
61 catch(...)
62 {
63 printf("Exception\n");
64 }
65
66
67 free(memoryBuf);
68 }
69 else
70 {
71 printf("NOT ENOUGH MEMORY\n");
72 }
73
74 /* code */
75 return 0;
76}