-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathCMakeLists.txt
56 lines (43 loc) · 1.52 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
cmake_minimum_required(VERSION 3.5.1)
project(chirc C)
set(CMAKE_C_STANDARD 11)
set(CMAKE_BUILD_TYPE Debug)
include_directories(src lib/uthash/include lib/sds)
add_executable(chirc
src/channel.c
src/channeluser.c
src/connection.c
src/ctx.c
src/handlers.c
src/log.c
src/main.c
src/message.c
src/server.c
src/user.c
src/utils.c
lib/sds/sds.c)
target_link_libraries(chirc pthread)
set(ASSIGNMENTS
1 2 3 4 5 2+3 2+3+5 4+5)
foreach(AID ${ASSIGNMENTS})
add_custom_target(categories-assignment-${AID}
COMMAND ../tests/print-categories.py ../tests/rubrics/assignment-${AID}.json)
# Plus sign found, split the assignment ID into parts
string(REPLACE "+" ";" ASSIGN_LIST ${AID})
# Generate a string of rubrics to pass to the command
set(RUBRIC_ARGS "")
set(PYTEST_ARGS "")
foreach(ID IN LISTS ASSIGN_LIST)
list(APPEND RUBRIC_ARGS ../tests/rubrics/assignment-${ID}.json)
list(APPEND PYTEST_ARGS --chirc-rubric ../tests/rubrics/assignment-${ID}.json)
endforeach()
add_custom_target(tests-assignment-${AID}
COMMAND pytest ${PYTEST_ARGS} ../tests/
DEPENDS chirc)
add_custom_target(assignment-${AID}
COMMAND /bin/sh -c 'pytest ${PYTEST_ARGS} ../tests/\; exit 0'
COMMAND ../tests/grade.py ${RUBRIC_ARGS}
DEPENDS chirc)
add_custom_target(grade-assignment-${AID}
COMMAND ../tests/grade.py ${RUBRIC_ARGS})
endforeach()