Page Menu
Home
Xreate
Search
Configure Global Search
Log In
Docs
Questions
Repository
Issues
Patches
Internal API
Files
F2730032
main.cpp
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Fri, Mar 13, 7:44 PM
Size
3 KB
Mime Type
text/x-c++
Expires
Sun, Mar 15, 7:44 PM (1 d, 22 h)
Engine
blob
Format
Raw Data
Handle
243304
Attached To
rXR Xreate
main.cpp
View Options
#include "utils.h"
#include <gtest/gtest.h>
using namespace std;
using namespace xreate;
int main(int argc, char **argv) {
testing::GTEST_FLAG(color) = "yes";
string testsTemplate = Config::get("tests.template");
string testsFilter = Config::get(string("tests.templates.") + testsTemplate);
testing::GTEST_FLAG(filter) = testsFilter;
testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}
//TODO adopt useful tests
//void testParser_1()
//{
// shared_ptr<Scanner> scanner(new Scanner(L"scripts/input.xreate"));
// shared_ptr<Parser> parser(new Parser(scanner.get()));
// parser->Parse();
// flush(cout);
// AST& root = parser->root;
// LLVMLayer l(&root);
// root.compile(l);
// root.run(l);
//}
//void testClasp2()
//{
// shared_ptr<Scanner> scanner(new Scanner(L"scripts/input.xreate"));
// shared_ptr<Parser> parser(new Parser(scanner.get()));
// parser->Parse();
// flush(cout);
// if (parser->errors->count)
// {
// cout << "Found " << parser->errors->count << " errors. Stop" << endl;
// exit(1);
// }
// AST& root = parser->root;
// ClaspLayer clasp;
// /*
// FunctionTagsPass(root).run(clasp);
// RulesPass(root).run(clasp);
// CFGPass(&clasp).run();
// clasp.1
// run();
// */
//}
//void testUnsafeCode1()
//{
// shared_ptr<Scanner> scanner(new Scanner(L"scripts/cases/bugs-code.xreate"));
// shared_ptr<Parser> parser(new Parser(scanner.get()));
// parser->Parse();
// flush(cout);
// if (parser->errors->count)
// {
// cout << "Found " << parser->errors->count << " errors. Stop" << endl;
// exit(1);
// }
// AST& root = parser->root;
// ClaspLayer clasp;
// /*
// FunctionTagsPass(root).run(clasp);
// RulesPass(root).run(clasp);
// CFGPass(&clasp).run();
// //clasp.addRule(":- call(X, Y), tag(Y, unsafe), not tag(X, unsafe), function(X), function(Y).");
// clasp.run();
// */
//}
//void test_DFG_1()
//{
// shared_ptr<Scanner> scanner(new Scanner(L"scripts/input.xreate"));
// shared_ptr<Parser> parser(new Parser(scanner.get()));
// parser->Parse();
// flush(cout);
// if (parser->errors->count)
// {
// cout << "Found " << parser->errors->count << " errors. Stop" << endl;
// exit(1);
// }
// PassManager m;
// m.clasp = new ClaspLayer();
// m.llvm = new LLVMLayer(&parser->root);
// m.root = & parser->root;
// m.clasp->ast = m.root;
// m.registerPass(new DFAPass(&m));
// m.run();
// m.clasp->run();
// m.root->compile(*m.llvm);
// m.root->run(*m.llvm);
//}
//void test_Xml_1()
//{
// shared_ptr<Scanner> scanner(new Scanner(L"scripts/input.xreate"));
// shared_ptr<Parser> parser(new Parser(scanner.get()));
// parser->Parse();
// flush(cout);
// if (parser->errors->count)
// {
// cout << "Found " << parser->errors->count << " errors. Stop" << endl;
// exit(1);
// }
// PassManager m;
// m.root = & parser->root;
// m.clasp = new ClaspLayer();
// m.clasp->ast = m.root;
// m.llvm = new LLVMLayer(&parser->root);
// m.registerPass(new DFAPass(&m));
// m.run();
//}
Event Timeline
Log In to Comment