Commit 4533be5c authored by Paul Asmuth's avatar Paul Asmuth
Browse files

improved tests/ folder structure

parent 0b37292e
Loading
Loading
Loading
Loading
+14 −14
Original line number Diff line number Diff line
@@ -74,26 +74,26 @@ add_executable(plotfx common/platform/plotfx_cli.cc)
target_link_libraries(plotfx ${PLOTFX_LDFLAGS})
install(TARGETS plotfx DESTINATION bin)

#file(GLOB unit_test_files "tests/**/test_*.cc")
#foreach(unit_test_path ${unit_test_files})
#  get_filename_component(unit_test_name ${unit_test_path} NAME_WE)
#  get_filename_component(unit_test_srcdir ${unit_test_path} DIRECTORY)
#
#  add_executable(${unit_test_name} ${unit_test_path})
#  target_link_libraries(${unit_test_name} ${PLOTFX_LDFLAGS})
#
#  add_test(
#      NAME ${unit_test_name}
#      COMMAND ${CMAKE_CURRENT_BINARY_DIR}/${unit_test_name})
#endforeach()
file(GLOB unit_test_files "tests/unit/**/test_*.cc")
foreach(unit_test_path ${unit_test_files})
  get_filename_component(unit_test_name ${unit_test_path} NAME_WE)
  get_filename_component(unit_test_srcdir ${unit_test_path} DIRECTORY)

file(GLOB spec_test_files "tests/**/test_*.plot")
  add_executable(${unit_test_name} ${unit_test_path})
  target_link_libraries(${unit_test_name} ${PLOTFX_LDFLAGS})

  add_test(
      NAME ${unit_test_name}
      COMMAND ${CMAKE_CURRENT_BINARY_DIR}/${unit_test_name})
endforeach()

file(GLOB spec_test_files "tests/spec/**/test_*.plot")
foreach(spec_test_path ${spec_test_files})
  get_filename_component(spec_test_name ${spec_test_path} NAME_WE)
  get_filename_component(spec_test_srcdir ${spec_test_path} DIRECTORY)
  add_test(
      NAME ${spec_test_name}_svg
      WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
      COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/tests/test_runner.sh ${CMAKE_CURRENT_BINARY_DIR}/plotfx ${spec_test_path} ${CMAKE_CURRENT_BINARY_DIR}/${spec_test_name}.svg ${spec_test_srcdir}/${spec_test_name}.svg)
      COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/tests/spec/test_runner.sh ${CMAKE_CURRENT_BINARY_DIR}/plotfx ${spec_test_path} ${CMAKE_CURRENT_BINARY_DIR}/${spec_test_name}.svg ${spec_test_srcdir}/${spec_test_name}.svg)
endforeach()

tests/image/test_image_new.png

deleted100644 → 0
−408 B
Loading image diff...

tests/image/test_image_new.sh

deleted100755 → 0
+0 −3
Original line number Diff line number Diff line
#!/bin/bash

plotfx img new --out ${TEST_OUTFILE} --width 200 --height 120 --clear '#ccc'

tests/plot/.gitignore

deleted100644 → 0
+0 −2
Original line number Diff line number Diff line
chart_test
*.actual.svg

tests/plot/CMakeLists.txt

deleted100644 → 0
+0 −10
Original line number Diff line number Diff line
# * This file is part of the "plotfx" project
#   Copyright (c) 2014 Paul Asmuth, Google Inc.
#
# libstx is free software: you can redistribute it and/or modify it under
# the terms of the GNU General Public License v3.0. You should have received a
# copy of the GNU General Public License along with this program. If not, see
# <http://www.gnu.org/licenses/>.

add_executable(chart_test chart_test.cc)
target_link_libraries(chart_test plotfx-plot plotfx-graphics plotfx-util ${CAIRO_LIBRARIES})
Loading