From 94de4dd0c46483477706002e128a61f74278c0f6 Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Mon, 9 Sep 2019 12:48:25 +0200 Subject: [PATCH] Split test programs to benchmarking and unit tests They have very different purpose, so make things easier to work with by having multiple directories. --- tests/CMakeLists.txt | 49 ++---------------- tests/perf/CMakeLists.txt | 40 ++++++++++++++ tests/{ => perf}/convperf.cxx | 0 tests/{ => perf}/decperf.cxx | 0 tests/{ => perf}/encperf.cxx | 0 tests/{ => perf}/fbperf.cxx | 0 tests/{ => perf}/results/multicore/README | 0 .../results/multicore/multicore.ods | Bin tests/{ => perf}/results/notrans/README | 0 tests/{ => perf}/results/notrans/armhf.csv | 0 tests/{ => perf}/results/notrans/i386.csv | 0 tests/{ => perf}/results/notrans/x86_64.csv | 0 tests/{ => perf}/util.cxx | 0 tests/{ => perf}/util.h | 0 tests/unit/CMakeLists.txt | 7 +++ tests/{ => unit}/conv.cxx | 0 tests/{ => unit}/hostport.cxx | 0 17 files changed, 51 insertions(+), 45 deletions(-) create mode 100644 tests/perf/CMakeLists.txt rename tests/{ => perf}/convperf.cxx (100%) rename tests/{ => perf}/decperf.cxx (100%) rename tests/{ => perf}/encperf.cxx (100%) rename tests/{ => perf}/fbperf.cxx (100%) rename tests/{ => perf}/results/multicore/README (100%) rename tests/{ => perf}/results/multicore/multicore.ods (100%) rename tests/{ => perf}/results/notrans/README (100%) rename tests/{ => perf}/results/notrans/armhf.csv (100%) rename tests/{ => perf}/results/notrans/i386.csv (100%) rename tests/{ => perf}/results/notrans/x86_64.csv (100%) rename tests/{ => perf}/util.cxx (100%) rename tests/{ => perf}/util.h (100%) create mode 100644 tests/unit/CMakeLists.txt rename tests/{ => unit}/conv.cxx (100%) rename tests/{ => unit}/hostport.cxx (100%) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 7e006815..4399dad0 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -1,46 +1,5 @@ -include_directories(${FLTK_INCLUDE_DIR}) -include_directories(${GETTEXT_INCLUDE_DIR}) +# Benchmarking tools +add_subdirectory(perf) -include_directories(${CMAKE_SOURCE_DIR}/common) - -add_library(test_util STATIC util.cxx) - -add_executable(convperf convperf.cxx) -target_link_libraries(convperf test_util rfb) - -add_executable(conv conv.cxx) -target_link_libraries(conv rfb) - -add_executable(decperf decperf.cxx) -target_link_libraries(decperf test_util rfb) - -add_executable(encperf encperf.cxx) -target_link_libraries(encperf test_util rfb) - -add_executable(hostport hostport.cxx) -target_link_libraries(hostport rfb) - -set(FBPERF_SOURCES - fbperf.cxx - ../vncviewer/PlatformPixelBuffer.cxx - ../vncviewer/Surface.cxx) -if(WIN32) - set(FBPERF_SOURCES ${FBPERF_SOURCES} ../vncviewer/Surface_Win32.cxx) -elseif(APPLE) - set(FBPERF_SOURCES - ${FBPERF_SOURCES} ../vncviewer/Surface_OSX.cxx - ${FBPERF_SOURCES} ../vncviewer/keysym2ucs.c - ${FBPERF_SOURCES} ../vncviewer/cocoa.mm) -else() - set(FBPERF_SOURCES ${FBPERF_SOURCES} ../vncviewer/Surface_X11.cxx) -endif() -add_executable(fbperf ${FBPERF_SOURCES}) -target_link_libraries(fbperf test_util rfb ${FLTK_LIBRARIES} ${GETTEXT_LIBRARIES}) -if(WIN32) - target_link_libraries(fbperf msimg32) -endif() -if(APPLE) - target_link_libraries(fbperf "-framework Cocoa") - target_link_libraries(fbperf "-framework Carbon") - target_link_libraries(fbperf "-framework IOKit") -endif() +# Unit tests +add_subdirectory(unit) diff --git a/tests/perf/CMakeLists.txt b/tests/perf/CMakeLists.txt new file mode 100644 index 00000000..053bfaae --- /dev/null +++ b/tests/perf/CMakeLists.txt @@ -0,0 +1,40 @@ +include_directories(${FLTK_INCLUDE_DIR}) +include_directories(${GETTEXT_INCLUDE_DIR}) + +include_directories(${CMAKE_SOURCE_DIR}/common) + +add_library(test_util STATIC util.cxx) + +add_executable(convperf convperf.cxx) +target_link_libraries(convperf test_util rfb) + +add_executable(decperf decperf.cxx) +target_link_libraries(decperf test_util rfb) + +add_executable(encperf encperf.cxx) +target_link_libraries(encperf test_util rfb) + +set(FBPERF_SOURCES + fbperf.cxx + ${CMAKE_SOURCE_DIR}/vncviewer/PlatformPixelBuffer.cxx + ${CMAKE_SOURCE_DIR}/vncviewer/Surface.cxx) +if(WIN32) + set(FBPERF_SOURCES ${FBPERF_SOURCES} ${CMAKE_SOURCE_DIR}/vncviewer/Surface_Win32.cxx) +elseif(APPLE) + set(FBPERF_SOURCES + ${FBPERF_SOURCES} ${CMAKE_SOURCE_DIR}/vncviewer/Surface_OSX.cxx + ${FBPERF_SOURCES} ${CMAKE_SOURCE_DIR}/vncviewer/keysym2ucs.c + ${FBPERF_SOURCES} ${CMAKE_SOURCE_DIR}/vncviewer/cocoa.mm) +else() + set(FBPERF_SOURCES ${FBPERF_SOURCES} ${CMAKE_SOURCE_DIR}/vncviewer/Surface_X11.cxx) +endif() +add_executable(fbperf ${FBPERF_SOURCES}) +target_link_libraries(fbperf test_util rfb ${FLTK_LIBRARIES} ${GETTEXT_LIBRARIES}) +if(WIN32) + target_link_libraries(fbperf msimg32) +endif() +if(APPLE) + target_link_libraries(fbperf "-framework Cocoa") + target_link_libraries(fbperf "-framework Carbon") + target_link_libraries(fbperf "-framework IOKit") +endif() diff --git a/tests/convperf.cxx b/tests/perf/convperf.cxx similarity index 100% rename from tests/convperf.cxx rename to tests/perf/convperf.cxx diff --git a/tests/decperf.cxx b/tests/perf/decperf.cxx similarity index 100% rename from tests/decperf.cxx rename to tests/perf/decperf.cxx diff --git a/tests/encperf.cxx b/tests/perf/encperf.cxx similarity index 100% rename from tests/encperf.cxx rename to tests/perf/encperf.cxx diff --git a/tests/fbperf.cxx b/tests/perf/fbperf.cxx similarity index 100% rename from tests/fbperf.cxx rename to tests/perf/fbperf.cxx diff --git a/tests/results/multicore/README b/tests/perf/results/multicore/README similarity index 100% rename from tests/results/multicore/README rename to tests/perf/results/multicore/README diff --git a/tests/results/multicore/multicore.ods b/tests/perf/results/multicore/multicore.ods similarity index 100% rename from tests/results/multicore/multicore.ods rename to tests/perf/results/multicore/multicore.ods diff --git a/tests/results/notrans/README b/tests/perf/results/notrans/README similarity index 100% rename from tests/results/notrans/README rename to tests/perf/results/notrans/README diff --git a/tests/results/notrans/armhf.csv b/tests/perf/results/notrans/armhf.csv similarity index 100% rename from tests/results/notrans/armhf.csv rename to tests/perf/results/notrans/armhf.csv diff --git a/tests/results/notrans/i386.csv b/tests/perf/results/notrans/i386.csv similarity index 100% rename from tests/results/notrans/i386.csv rename to tests/perf/results/notrans/i386.csv diff --git a/tests/results/notrans/x86_64.csv b/tests/perf/results/notrans/x86_64.csv similarity index 100% rename from tests/results/notrans/x86_64.csv rename to tests/perf/results/notrans/x86_64.csv diff --git a/tests/util.cxx b/tests/perf/util.cxx similarity index 100% rename from tests/util.cxx rename to tests/perf/util.cxx diff --git a/tests/util.h b/tests/perf/util.h similarity index 100% rename from tests/util.h rename to tests/perf/util.h diff --git a/tests/unit/CMakeLists.txt b/tests/unit/CMakeLists.txt new file mode 100644 index 00000000..656c8a75 --- /dev/null +++ b/tests/unit/CMakeLists.txt @@ -0,0 +1,7 @@ +include_directories(${CMAKE_SOURCE_DIR}/common) + +add_executable(conv conv.cxx) +target_link_libraries(conv rfb) + +add_executable(hostport hostport.cxx) +target_link_libraries(hostport rfb) diff --git a/tests/conv.cxx b/tests/unit/conv.cxx similarity index 100% rename from tests/conv.cxx rename to tests/unit/conv.cxx diff --git a/tests/hostport.cxx b/tests/unit/hostport.cxx similarity index 100% rename from tests/hostport.cxx rename to tests/unit/hostport.cxx -- 2.39.5