#[macro_use]
extern crate lazy_static;
extern crate colored;
extern crate curl;
extern crate regex;
extern crate serde;
extern crate serde_json;
use colored::Colorize;
use crate::static_vars::has_err;
use crate::tester::file::run_testfile;
use std::process;
mod json_test;
mod parser;
mod static_vars;
mod tester;
mod traversal;
fn main() {
let files = traversal::all_rrt_files_in_dir("rest_tests".to_string());
let url = "http://localhost:8080".to_string();
for f in files {
run_testfile(f, url.clone());
}
if has_err() {
println!("{}", "Some of the tests failed!".red().bold());
process::exit(1);
} else {
println!("{}", "All tests passed".green().bold());
}
}