Skip to content
Snippets Groups Projects
Commit 1596bfac authored by Jason Hiser's avatar Jason Hiser :tractor:
Browse files

added tests, fixed missing (pure virtual destructor?)

parent 1aec2aaa
No related branches found
No related tags found
No related merge requests found
......@@ -5,6 +5,7 @@
#include <map>
#include <memory>
#include <set>
#include <vector>
namespace EHP
......@@ -19,7 +20,7 @@ class EHProgramInstruction_t
EHProgramInstruction_t() {}
EHProgramInstruction_t(const EHProgramInstruction_t&) {}
public:
virtual ~EHProgramInstruction_t() =0;
virtual ~EHProgramInstruction_t() {}
virtual void print(uint64_t &pc, int64_t caf=1) const=0;
virtual bool isNop() const =0;
virtual bool isRestoreState() const =0;
......
File added
import os
Import('env')
myenv=env.Clone()
files="test.cpp"
cpppath='''
../include
'''
LIBPATH='''
../lib
'''
LIBS='''
ehp
'''
myenv=myenv.Clone(CPPPATH=Split(cpppath))
myenv.Append(CXXFLAGS = " -std=c++11 -Wall -Werror -fmax-errors=1 -g ")
lib=myenv.Program("test.exe", Split(files), LIBPATH=Split(LIBPATH), LIBS=Split(LIBS))
install=myenv.Install("../lib/", lib)
Default(install)
Return('install')
env=Environment()
Export('env')
lib=SConscript("SConscript")
Return('lib')
#include <ehp.hpp>
#include <iostream>
using namespace std;
using namespace EHP;
void usage(int argc, char* argv[])
{
cout<<"Usage: "<<argv[0]<<" <program to print eh info>"<<endl;
exit(1);
}
int main(int argc, char* argv[])
{
if(argc!=2)
{
usage(argc,argv);
}
auto ehp = EHFrameParser_t::factory(argv[1]);
ehp->print();
return 0;
}
#!/bin/bash
cleanup()
{
echo "Test failed"
exit 1
}
scons || cleanup
./test.exe ./test.exe || cleanup
./test.exe /bin/ls || cleanup
./test.exe /bin/bash || cleanup
echo "test passed"
exit 0
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment