another directory rename: failstar -> fail
"failstar" sounds like a name for a cruise liner from the 80s. As "*" isn't a desirable part of directory names, just name the whole thing "fail/", the core parts being stored in "fail/core/". Additionally fixing two build system dependency issues: - missing jobserver -> protomessages dependency - broken bochs -> fail dependency (add_custom_target DEPENDS only allows plain file dependencies ... cmake for the win) git-svn-id: https://www4.informatik.uni-erlangen.de/i4svn/danceos/trunk/devel/fail@956 8c4709b5-6ec9-48aa-a5cd-a96041d1645a
This commit is contained in:
19
core/experiments/attic/ExperimentDataExample/CMakeLists.txt
Normal file
19
core/experiments/attic/ExperimentDataExample/CMakeLists.txt
Normal file
@ -0,0 +1,19 @@
|
||||
## Setup desired protobuf descriptions HERE ##
|
||||
set(MY_PROTOS
|
||||
FaultCoverageExperiment.proto
|
||||
)
|
||||
|
||||
set(SRCS
|
||||
example.cc
|
||||
)
|
||||
|
||||
#### PROTOBUFS ####
|
||||
find_package(Protobuf REQUIRED)
|
||||
include_directories(${PROTOBUF_INCLUDE_DIRS})
|
||||
include_directories(${CMAKE_CURRNET_BINARY_DIR})
|
||||
|
||||
PROTOBUF_GENERATE_CPP(PROTO_SRCS PROTO_HDRS ${MY_PROTOS} )
|
||||
|
||||
## Build library
|
||||
add_library(fcexperimentmessage ${PROTO_SRCS} ${SRCS} )
|
||||
|
||||
@ -0,0 +1,7 @@
|
||||
message FaultCoverageExperimentData{
|
||||
|
||||
optional string data_name = 1;
|
||||
required int64 m_InstrPtr1 = 2;
|
||||
required int64 m_InstrPtr2 = 3;
|
||||
|
||||
}
|
||||
3
core/experiments/attic/ExperimentDataExample/build_example.sh
Executable file
3
core/experiments/attic/ExperimentDataExample/build_example.sh
Executable file
@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
cd $(dirname $0)
|
||||
g++ ../../controller/JobServer.cc ../../controller/ExperimentDataQueue.cc example.cc FaultCoverageExperiment.pb.cc -o ./ExperimentData_example -l protobuf -pthread
|
||||
89
core/experiments/attic/ExperimentDataExample/example.cc
Normal file
89
core/experiments/attic/ExperimentDataExample/example.cc
Normal file
@ -0,0 +1,89 @@
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include "controller/ExperimentData.hpp"
|
||||
#include "controller/ExperimentDataQueue.hpp"
|
||||
#include "jobserver/JobServer.hpp"
|
||||
#include "FaultCoverageExperiment.pb.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
int main(int argc, char* argv[]){
|
||||
|
||||
|
||||
fi::ExperimentDataQueue exDaQu;
|
||||
fi::ExperimentData* readFromQueue;
|
||||
|
||||
|
||||
//Daten in Struktur schreiben und in Datei speichern
|
||||
|
||||
ofstream fileWrite;
|
||||
fileWrite.open("test.txt");
|
||||
|
||||
|
||||
FaultCoverageExperimentData faultCovExWrite;
|
||||
|
||||
//Namen setzen
|
||||
faultCovExWrite.set_data_name("Testfall 42");
|
||||
|
||||
//Instruktionpointer 1
|
||||
faultCovExWrite.set_m_instrptr1(0x4711);
|
||||
|
||||
|
||||
//Instruktionpointer 2
|
||||
faultCovExWrite.set_m_instrptr2(0x1122);
|
||||
|
||||
|
||||
//In ExperimentData verpacken
|
||||
fi::ExperimentData exDaWrite(&faultCovExWrite);
|
||||
|
||||
//In Queue einbinden
|
||||
exDaQu.addData(&exDaWrite);
|
||||
|
||||
//Aus Queue holen
|
||||
if(exDaQu.size() != 0)
|
||||
readFromQueue = exDaQu.getData();
|
||||
|
||||
//Serialisierung ueber Wrapper-Methode in ExperimentData
|
||||
readFromQueue->serialize(&fileWrite);
|
||||
|
||||
//cout << "Ausgabe: " << out << endl;
|
||||
|
||||
fileWrite.close();
|
||||
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
|
||||
//Daten aus Datei lesen und in Struktur schreiben
|
||||
|
||||
|
||||
ifstream fileRead;
|
||||
fileRead.open("test.txt");
|
||||
|
||||
|
||||
FaultCoverageExperimentData faultCovExRead;
|
||||
|
||||
fi::ExperimentData exDaRead(&faultCovExRead);
|
||||
|
||||
exDaRead.unserialize( &fileRead);
|
||||
|
||||
|
||||
//Wenn Name, dann ausgeben
|
||||
if(faultCovExRead.has_data_name()){
|
||||
cout << "Name: "<< faultCovExRead.data_name() << endl;
|
||||
}
|
||||
|
||||
//m_instrptr1 augeben
|
||||
cout << "m_instrptr1: " << faultCovExRead.m_instrptr1() << endl;
|
||||
|
||||
//m_instrptr2 augeben
|
||||
cout << "m_instrptr2: " << faultCovExRead.m_instrptr2() << endl;
|
||||
|
||||
fileRead.close();
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user