mirror of
https://github.com/allankoechke/cparse.git
synced 2026-11-30 17:11:31 +00:00
Move catch main to separated file so tests compile a lot faster
This commit is contained in:
2
Makefile
2
Makefile
@@ -1,5 +1,5 @@
|
||||
EXE=test-shunting-yard
|
||||
SRC=$(EXE).cpp shunting-yard.cpp packToken.cpp
|
||||
SRC=$(EXE).cpp shunting-yard.cpp packToken.cpp catch.cpp
|
||||
OBJ=$(SRC:.cpp=.o)
|
||||
|
||||
CXX=g++
|
||||
|
||||
10
catch.cpp
Normal file
10
catch.cpp
Normal file
@@ -0,0 +1,10 @@
|
||||
#define CATCH_CONFIG_RUNNER
|
||||
#include "catch.hpp"
|
||||
|
||||
// Defined on test-shunting-yard.cpp
|
||||
void PREPARE_ENVIRONMENT();
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
PREPARE_ENVIRONMENT();
|
||||
return Catch::Session().run(argc, argv);
|
||||
}
|
||||
@@ -1,10 +1,10 @@
|
||||
#define CATCH_CONFIG_RUNNER
|
||||
#include "catch.hpp"
|
||||
|
||||
#include "./shunting-yard.h"
|
||||
|
||||
TokenMap_t vars, tmap, emap, key3;
|
||||
int main(int argc, char** argv) {
|
||||
TokenMap_t vars, tmap, key3, emap;
|
||||
|
||||
void PREPARE_ENVIRONMENT() {
|
||||
vars["pi"] = 3.14;
|
||||
vars["b1"] = 0.0;
|
||||
vars["b2"] = 0.86;
|
||||
@@ -24,9 +24,6 @@ int main(int argc, char** argv) {
|
||||
|
||||
emap["a"] = 10;
|
||||
emap["b"] = 20;
|
||||
|
||||
int result = Catch::Session().run(argc, argv);
|
||||
return result;
|
||||
}
|
||||
|
||||
TEST_CASE("Static calculate::calculate()") {
|
||||
|
||||
Reference in New Issue
Block a user