refile test build.
This commit is contained in:
parent
8070c241b5
commit
747574948a
2
Makefile
2
Makefile
@ -12,4 +12,4 @@ obj/script_parser.o: src/script_parser.cpp include/script_parser.h
|
|||||||
g++ -o obj/script_parser.o src/script_parser.cpp -c ${INC}
|
g++ -o obj/script_parser.o src/script_parser.cpp -c ${INC}
|
||||||
|
|
||||||
test.exe: src/script_parser.cpp
|
test.exe: src/script_parser.cpp
|
||||||
g++ -DTEST src/script_parser.cpp -o test.exe ${INC}
|
g++ -DTEST src/script_parser.cpp -o test.exe ${INC} ${LIB}
|
@ -1,22 +1,16 @@
|
|||||||
#ifdef TEST
|
|
||||||
#else
|
|
||||||
#include <boost/test/unit_test.hpp>
|
#include <boost/test/unit_test.hpp>
|
||||||
using namespace boost::unit_test;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <script_parser.h>
|
#include <script_parser.h>
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
using namespace boost::unit_test;
|
||||||
|
|
||||||
int parseScript(const char* path) {
|
int parseScript(const char* path) {
|
||||||
ifstream script(path, ios::in);
|
ifstream script(path, ios::in);
|
||||||
if (!script.is_open()) {
|
BOOST_TEST_REQUIRE(script.is_open(), "open script file failed!");
|
||||||
perror(path);
|
|
||||||
return ENOENT;
|
|
||||||
} else {
|
|
||||||
string line;
|
string line;
|
||||||
while(getline(script, line, '\n')) {
|
while(getline(script, line, '\n')) {
|
||||||
// cout << line <<endl;
|
// cout << line <<endl;
|
||||||
@ -28,7 +22,7 @@ int parseScript(const char* path) {
|
|||||||
cout << endl;
|
cout << endl;
|
||||||
}
|
}
|
||||||
script.close();
|
script.close();
|
||||||
}
|
BOOST_TEST(true);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user