Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

How would the rules in the below Makefile be written for the below c++ test case? fill the section that says # Need a rule

How would the rules in the below Makefile be written for the below c++ test case? fill the section that says "# Need a rule to build objects"

//Test case
#define CATCH_CONFIG_MAIN
#include
#include "catch/catch.hpp"
#include "../foo.hpp"
#include "../bar.hpp"
#include "../baz.hpp"
TEST_CASE("Test Classes. PASS.")
{
REQUIRE (Foo.GetMagicNumber() == 12);
Bar b = Bar("Hello");
REQUIRE (b.GetString() == "Hello");
Baz *baz = new Baz(90.0 / 9);
REQUIRE (baz->GetValue() > 9.999 && baz->GetValue() < 10.0001);
}
// Compile & run:
// make clean test

//Makefile
CXX = g++
CXXFLAGS = -std=c++11 -Wall
OBJECTS = # list of .o files. One for each class
# Need a rule to build objects
testBuild: main
$(CXX) $(CXXFLAGS) -Itest/catch/catch.hpp -o test/TestCase $(OBJECTS) test/TestCase.cpp
test: clean testBuild
test/TestCase --success
clean:
$(RM) *.o *.gch main test/TestCase

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database And Expert Systems Applications 33rd International Conference Dexa 2022 Vienna Austria August 22 24 2022 Proceedings Part 1 Lncs 13426

Authors: Christine Strauss ,Alfredo Cuzzocrea ,Gabriele Kotsis ,A Min Tjoa ,Ismail Khalil

1st Edition

3031124227, 978-3031124228

More Books

Students also viewed these Databases questions