Fix build, logging and added some coverage report (I should do more commits)
All checks were successful
Build ptprnt / build (push) Successful in 1m50s
All checks were successful
Build ptprnt / build (push) Successful in 1m50s
This commit is contained in:
8
.gitignore
vendored
8
.gitignore
vendored
@@ -1,9 +1,13 @@
|
||||
# Folder
|
||||
builddir/
|
||||
ptouch-print/
|
||||
subprojects/*
|
||||
!subprojects/*.wrap
|
||||
.cache/
|
||||
coverageReport/
|
||||
|
||||
# Files
|
||||
!subprojects/*.wrap
|
||||
.vscode/*
|
||||
!.vscode/c_cpp_properties.json
|
||||
!.vscode/settings.json
|
||||
!.vscode/launch.json
|
||||
ptouch-print/
|
21
generate_coverage.sh
Executable file
21
generate_coverage.sh
Executable file
@@ -0,0 +1,21 @@
|
||||
#!/bin/bash
|
||||
|
||||
SCRIPT_PATH="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
|
||||
HTML_COV_PATH="coverageReport/html"
|
||||
HTML_START_FILE="index.html"
|
||||
|
||||
echo "Generating Coverage report for ptouch-prnt"
|
||||
|
||||
ninja -C builddir
|
||||
ninja -C builddir test
|
||||
|
||||
mkdir -p ${HTML_COV_PATH}
|
||||
gcovr --html --html-details --html-syntax-highlighting --filter src --output ${HTML_COV_PATH}/${HTML_START_FILE}
|
||||
|
||||
if [ $? ]
|
||||
then
|
||||
echo "Coverage report successful generated!"
|
||||
echo "Open: file://${SCRIPT_PATH}/${HTML_COV_PATH}/${HTML_START_FILE}"
|
||||
else
|
||||
echo "Error generating coverage report!"
|
||||
fi
|
38
meson.build
38
meson.build
@@ -17,45 +17,15 @@ endif
|
||||
|
||||
incdir = include_directories('src')
|
||||
|
||||
ptprnt_hpps = [
|
||||
'src/libusbwrap/interface/IUsbDeviceFactory.hpp',
|
||||
'src/libusbwrap/interface/IUsbDevice.hpp',
|
||||
'src/libusbwrap/UsbDeviceFactory.hpp',
|
||||
'src/libusbwrap/LibUsbTypes.hpp',
|
||||
'src/libusbwrap/UsbDevice.hpp',
|
||||
'src/interface/IPrinterDriver.hpp',
|
||||
'src/interface/IPrinterTypes.hpp',
|
||||
'src/P700Printer.hpp',
|
||||
'src/PtouchPrint.hpp',
|
||||
'src/graphics/Bitmap.hpp',
|
||||
'src/graphics/Image.hpp',
|
||||
'src/graphics/Monochrome.hpp'
|
||||
]
|
||||
|
||||
ptprnt_srcs = [
|
||||
'src/PtouchPrint.cpp',
|
||||
'src/P700Printer.cpp',
|
||||
'src/graphics/Image.cpp',
|
||||
'src/graphics/Bitmap.cpp',
|
||||
'src/graphics/Monochrome.cpp',
|
||||
'src/libusbwrap/UsbDeviceFactory.cpp',
|
||||
'src/libusbwrap/UsbDevice.cpp',
|
||||
]
|
||||
|
||||
ptprnt_lib = library('ptprnt',
|
||||
include_directories: incdir,
|
||||
install: true,
|
||||
dependencies: [usb_dep, log_dep, pangocairo_dep, cli11_dep],
|
||||
sources: [ptprnt_hpps, ptprnt_srcs])
|
||||
|
||||
ptprnt_dep = declare_dependency(include_directories: incdir,
|
||||
link_with: ptprnt_lib)
|
||||
subdir('src')
|
||||
|
||||
ptprnt_exe = executable(
|
||||
'ptprnt',
|
||||
'src/main.cpp',
|
||||
install: true,
|
||||
dependencies : [usb_dep, log_dep, cli11_dep, ptprnt_dep],
|
||||
dependencies : [usb_dep, log_dep, pangocairo_dep, cli11_dep],
|
||||
include_directories: incdir,
|
||||
sources: [ptprnt_srcs],
|
||||
cpp_args : ['-DPROJ_VERSION="'+meson.project_version()+'"'],
|
||||
)
|
||||
|
||||
|
@@ -16,10 +16,6 @@
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
*/
|
||||
|
||||
#include <spdlog/common.h>
|
||||
#include <spdlog/spdlog.h>
|
||||
|
||||
#include "PtouchPrint.hpp"
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
|
24
src/meson.build
Normal file
24
src/meson.build
Normal file
@@ -0,0 +1,24 @@
|
||||
ptprnt_hpps = files (
|
||||
'libusbwrap/interface/IUsbDeviceFactory.hpp',
|
||||
'libusbwrap/interface/IUsbDevice.hpp',
|
||||
'libusbwrap/UsbDeviceFactory.hpp',
|
||||
'libusbwrap/LibUsbTypes.hpp',
|
||||
'libusbwrap/UsbDevice.hpp',
|
||||
'interface/IPrinterDriver.hpp',
|
||||
'interface/IPrinterTypes.hpp',
|
||||
'P700Printer.hpp',
|
||||
'PtouchPrint.hpp',
|
||||
'graphics/Bitmap.hpp',
|
||||
'graphics/Image.hpp',
|
||||
'graphics/Monochrome.hpp'
|
||||
)
|
||||
|
||||
ptprnt_srcs = files (
|
||||
'PtouchPrint.cpp',
|
||||
'P700Printer.cpp',
|
||||
'graphics/Image.cpp',
|
||||
'graphics/Bitmap.cpp',
|
||||
'graphics/Monochrome.cpp',
|
||||
'libusbwrap/UsbDeviceFactory.cpp',
|
||||
'libusbwrap/UsbDevice.cpp',
|
||||
)
|
@@ -1,6 +1,6 @@
|
||||
tests = [['bitmap_test', 'bitmap_test_exe', ['bitmap_test/bitmap_test.cpp']],
|
||||
['image_test', 'image_test_exe', ['image_test/image_test.cpp']],
|
||||
['monochrome_test', 'monochrome_test_exe', ['monochrome_test/monochrome_test.cpp']]
|
||||
tests = [['bitmap_test', 'bitmap_test_exe', ptprnt_srcs + ['bitmap_test/bitmap_test.cpp']],
|
||||
['image_test', 'image_test_exe', ptprnt_srcs +['image_test/image_test.cpp']],
|
||||
['monochrome_test', 'monochrome_test_exe', ptprnt_srcs +['monochrome_test/monochrome_test.cpp']]
|
||||
]
|
||||
|
||||
foreach test : tests
|
||||
@@ -8,8 +8,7 @@ foreach test : tests
|
||||
executable(test.get(1),
|
||||
sources: test.get(2),
|
||||
include_directories: incdir,
|
||||
link_with:[ptprnt_lib],
|
||||
dependencies: [gtest_dep, pangocairo_dep]
|
||||
dependencies: [gtest_dep, usb_dep, log_dep, pangocairo_dep, cli11_dep]
|
||||
)
|
||||
)
|
||||
endforeach
|
Reference in New Issue
Block a user