refile test build.

This commit is contained in:
wangjiacai 2022-01-14 16:48:43 +08:00
parent 8070c241b5
commit 747574948a
2 changed files with 14 additions and 20 deletions

View File

@ -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}
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}

View File

@ -1,22 +1,16 @@
#ifdef TEST
#else
#include <boost/test/unit_test.hpp>
using namespace boost::unit_test;
#endif
#include <iostream>
#include <fstream>
#include <sstream>
#include <script_parser.h>
using namespace std;
using namespace boost::unit_test;
int parseScript(const char* path) {
ifstream script(path, ios::in);
if (!script.is_open()) {
perror(path);
return ENOENT;
} else {
BOOST_TEST_REQUIRE(script.is_open(), "open script file failed!");
string line;
while(getline(script, line, '\n')) {
// cout << line <<endl;
@ -28,7 +22,7 @@ int parseScript(const char* path) {
cout << endl;
}
script.close();
}
BOOST_TEST(true);
return 0;
}