Commit 5d5f0e13 authored by Ari Trachtenberg's avatar Ari Trachtenberg
Browse files

Fixed tests

parent b073a4b3
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -23,7 +23,10 @@ compile_problem_4:
  stage: problem4
  script:
    - echo "Compiling problem4.cpp"
    - g++ -c problem4.cpp
    - git clone https://agile.bu.edu/gitlab/configs/ec327/hw-configs/hw3.git base_3
    - cp problem4.cpp base_3/tests
    - cd base_3/tests
    - make problem4
  rules:
    - if: '$CI_COMMIT_REF_NAME == "problem4"'
  tags: [c++-17]
+9 −3
Original line number Diff line number Diff line
@@ -7,19 +7,22 @@ CXXFLAGS = -Wall -std=c++17
# Source files
PROBLEM2_SRCS = testProblem2.cpp problem2.cpp
PROBLEM3_SRCS = testProblem3.cpp problem3.cpp
SRCS = $(PROBLEM2_SRCS) $(PROBLEM3_SRCS)
PROBLEM4_SRCS = testProblem4.cpp problem4.cpp
SRCS = $(PROBLEM2_SRCS) $(PROBLEM3_SRCS) $(PROBLEM4_SRCS)

# Object files
PROBLEM2_OBJS = testProblem2.o problem2.o
PROBLEM3_OBJS = testProblem3.o problem3.o
OBJS = $(PROBLEM2_OBJS) $(PROBLEM3_OBJS)
PROBLEM4_OBJS = testProblem4.o problem4.o
OBJS = $(PROBLEM2_OBJS) $(PROBLEM3_OBJS) $(PROBLEM4_OBJS)

# Executable names
PROBLEM2_EXEC = problem2
PROBLEM3_EXEC = problem3
PROBLEM4_EXEC = problem4

# Default target to build the executable
all: $(PROBLEM2_EXEC) $(PROBLEM3_EXEC)
all: $(PROBLEM2_EXEC) $(PROBLEM3_EXEC) $(PROBLEM4_EXEC)

# Rule to build the executable from object files
$(PROBLEM2_EXEC): $(PROBLEM2_OBJS) Makefile
@@ -28,6 +31,9 @@ $(PROBLEM2_EXEC): $(PROBLEM2_OBJS) Makefile
$(PROBLEM3_EXEC): $(PROBLEM3_OBJS) Makefile
	$(CXX) $(CXXFLAGS) -o $(PROBLEM3_EXEC) $(PROBLEM3_OBJS)

$(PROBLEM4_EXEC): $(PROBLEM4_OBJS) Makefile
	$(CXX) $(CXXFLAGS) -o $(PROBLEM4_EXEC) $(PROBLEM4_OBJS)

# Rules to build object files from source files, with dependency on the Common.h header
%.o: %.cpp %.h Makefile
	$(CXX) $(CXXFLAGS) -c $< -o $@
+1 −0
Original line number Diff line number Diff line
@@ -12,6 +12,7 @@ void playGame();

bool test_4a() {
  // no tests for now
  return true;
}

int main() {