Commit 07a72c9c authored by Ari Trachtenberg's avatar Ari Trachtenberg
Browse files

Merge branch 'autograder' into 'master'

implement automatic sanity check

See merge request !1
parents 3e2ee13f 3f3122f6
Loading
Loading
Loading
Loading

ci_cd/.gitlab-ci.yml

0 → 100644
+11 −0
Original line number Diff line number Diff line
stages:
  - prebuild
  - compile
  - test
  - extra

include:
  - local: 'ci_cd/problem3a.yml'

default:
  timeout: 5m

ci_cd/problem3a.yml

0 → 100644
+47 −0
Original line number Diff line number Diff line
prebuild_problem_3a:
  stage: prebuild
  script:
    - |
      # Check if source files exist
      if [ ! -f "impl/Rubk.cpp" ]; then
        echo "Rubk.cpp does not exist under impl directory";
        exit 1;
      fi
    - git clone https://agile.bu.edu/gitlab/configs/ec330/homeworks/homeworktwo.git hw2
  artifacts:
    paths:
      - hw2/
  rules:
    - if: '$CI_COMMIT_REF_NAME == "problem3a"'
  tags: [c++-17]

compile_problem_3a:
  stage: compile
  needs:
    - job: prebuild_problem_3a
      artifacts: true
  script:
    - cp impl/Rubk.cpp hw2/tests/
    - cd hw2/tests
    - make problem3a
  artifacts:
    paths:
      - hw2/
  rules:
    - if: '$CI_COMMIT_REF_NAME == "problem3a"'
  tags: [c++-17]

exec_problem_3a:
  stage: test
  needs:
    - job: compile_problem_3a
      artifacts: true
  script:
    - cd hw2/tests
    - ./problem3a
  artifacts:
    paths:
      - hw2/
  rules:
    - if: '$CI_COMMIT_REF_NAME == "problem3a"'
  tags: [c++-17]
 No newline at end of file

ci_cd/problem3c.yml

0 → 100644
+51 −0
Original line number Diff line number Diff line
prebuild_problem_3c:
  stage: prebuild
  script:
    - |
      # Check if source files exist
      if [ ! -f "main.cpp" ]; then
        echo "main.cpp does not exist";
        exit 1;
      fi
      if [ ! -f "impl/Rubk.cpp" ]; then
              echo "Rubk.cpp does not exist under impl directory";
              exit 1;
            fi
    - git clone https://agile.bu.edu/gitlab/configs/ec330/homeworks/homeworktwo.git hw2
  artifacts:
    paths:
      - hw2/
  rules:
    - if: '$CI_COMMIT_REF_NAME == "problem3c"'
  tags: [c++-17]

compile_problem_3c:
  stage: compile
  needs:
    - job: prebuild_problem_3c
      artifacts: true
  script:
    - cp impl/Rubk.cpp main.cpp hw2/tests/
    - cd hw2/tests
    - make problem3c
  artifacts:
    paths:
      - hw2/
  rules:
    - if: '$CI_COMMIT_REF_NAME == "problem3c"'
  tags: [c++-17]

exec_problem_3c:
  stage: test
  needs:
    - job: compile_problem_3c
      artifacts: true
  script:
    - cd hw2/tests
    - ./problem3c
  artifacts:
    paths:
      - hw2/
  rules:
    - if: '$CI_COMMIT_REF_NAME == "problem3c"'
  tags: [c++-17]
 No newline at end of file
+3 −2
Original line number Diff line number Diff line
@@ -3,12 +3,13 @@
//

#include "../include/Rubk.h"
#include "../include/Enums.h"

#include <algorithm>
#include <cctype>
#include <iostream>
#include <stdexcept>

#include "../include/Enums.h"

// HELPER FUNCTIONS
/**
 * @param line The line to examine
+1 −0
Original line number Diff line number Diff line
@@ -3,6 +3,7 @@
//
#ifndef ENUM_H
#define ENUM_H
#include <array>
#include <ostream>

/**
Loading