aboutsummaryrefslogtreecommitdiffstats
path: root/libtests/CMakeLists.txt
blob: ea4dc7cd7102c9d976fe52e03b7a1acd65084725 (plain) (blame)
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
56
57
58
59
60
61
62
63
64
set(TEST_PROGRAMS
  cxx11
  aes
  arg_parser
  ascii85
  base64
  bits
  buffer
  closed_file_input_source
  concatenate
  dct_compress
  dct_uncompress
  flate
  hex
  input_source
  json
  json_handler
  json_parse
  logger
  lzw
  main_from_wmain
  matrix
  md5
  nntree
  numrange
  pdf_version
  pl_function
  pointer_holder
  predictors
  qintc
  qutil
  random
  rc4
  runlength
  sha2
  sparse_array)
set(TEST_C_PROGRAMS
  logger_c)

foreach(PROG ${TEST_PROGRAMS})
  add_executable(${PROG} ${PROG}.cc)
  target_link_libraries(${PROG} libqpdf_object)
endforeach()
foreach(PROG ${TEST_C_PROGRAMS})
  add_executable(${PROG} ${PROG}.c)
  target_link_libraries(${PROG} libqpdf_object)
  set_property(TARGET ${PROG} PROPERTY LINKER_LANGUAGE CXX)
endforeach()

# Since libtests link with the object library and don't use the DLL,
# we don't need to (and shouldn't) add the libqpdf target directory to
# the path for libtests.
add_test(
  NAME libtests
  COMMAND ${RUN_QTEST}
  --top ${qpdf_SOURCE_DIR}
  --bin $<TARGET_FILE_DIR:qutil>
  --bin $<TARGET_FILE_DIR:qpdf>
  --code ${qpdf_SOURCE_DIR}/libtests
  --color ${QTEST_COLOR}
  --show-on-failure ${SHOW_FAILED_TEST_OUTPUT}
  --tc "${qpdf_SOURCE_DIR}/libtests/*.cc"
  --tc "${qpdf_SOURCE_DIR}/libqpdf/*.cc"
  --tc "${qpdf_SOURCE_DIR}/libqpdf/qpdf/bits_functions.hh")