fast_excel 0.4.0 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (125) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/test.yml +28 -0
  3. data/.gitignore +2 -0
  4. data/CHANGELOG.md +18 -0
  5. data/Gemfile +10 -9
  6. data/Makefile +28 -1
  7. data/README.md +2 -2
  8. data/examples/example.rb +2 -0
  9. data/examples/example_date_time.rb +38 -0
  10. data/examples/example_filters.rb +2 -2
  11. data/fast_excel.gemspec +2 -2
  12. data/lib/fast_excel/binding/format.rb +17 -0
  13. data/lib/fast_excel/binding/workbook.rb +42 -20
  14. data/lib/fast_excel/binding/worksheet.rb +57 -13
  15. data/lib/fast_excel/binding.rb +12 -15
  16. data/lib/fast_excel.rb +38 -26
  17. data/libxlsxwriter/.github/FUNDING.yml +1 -0
  18. data/libxlsxwriter/.github/ISSUE_TEMPLATE.md +85 -0
  19. data/libxlsxwriter/.github/PULL_REQUEST_TEMPLATE.md +130 -0
  20. data/libxlsxwriter/.github/workflows/cmake_actions.yml +48 -0
  21. data/libxlsxwriter/.github/workflows/code_style.yml +23 -0
  22. data/libxlsxwriter/.github/workflows/coverity.yml +22 -0
  23. data/libxlsxwriter/.github/workflows/make_actions.yml +52 -0
  24. data/libxlsxwriter/.github/workflows/valgrind.yml +23 -0
  25. data/libxlsxwriter/.github/workflows/windows_build.yml +54 -0
  26. data/libxlsxwriter/.github/workflows/zig_build.yml +22 -0
  27. data/libxlsxwriter/.gitignore +16 -1
  28. data/libxlsxwriter/.indent.pro +24 -0
  29. data/libxlsxwriter/CMakeLists.txt +156 -56
  30. data/libxlsxwriter/CONTRIBUTING.md +2 -2
  31. data/libxlsxwriter/Changes.txt +344 -2
  32. data/libxlsxwriter/LICENSE.txt +66 -8
  33. data/libxlsxwriter/Makefile +151 -54
  34. data/libxlsxwriter/Package.swift +42 -0
  35. data/libxlsxwriter/Readme.md +4 -2
  36. data/libxlsxwriter/build.zig +324 -0
  37. data/libxlsxwriter/build.zig.zon +11 -0
  38. data/libxlsxwriter/cmake/FindMINIZIP.cmake +3 -3
  39. data/libxlsxwriter/cocoapods/libxlsxwriter-umbrella.h +6 -0
  40. data/libxlsxwriter/include/xlsxwriter/app.h +2 -1
  41. data/libxlsxwriter/include/xlsxwriter/chart.h +236 -32
  42. data/libxlsxwriter/include/xlsxwriter/chartsheet.h +7 -7
  43. data/libxlsxwriter/include/xlsxwriter/comment.h +76 -0
  44. data/libxlsxwriter/include/xlsxwriter/common.h +111 -50
  45. data/libxlsxwriter/include/xlsxwriter/content_types.h +8 -1
  46. data/libxlsxwriter/include/xlsxwriter/core.h +1 -1
  47. data/libxlsxwriter/include/xlsxwriter/custom.h +1 -1
  48. data/libxlsxwriter/include/xlsxwriter/drawing.h +11 -20
  49. data/libxlsxwriter/include/xlsxwriter/format.h +121 -8
  50. data/libxlsxwriter/include/xlsxwriter/hash_table.h +1 -1
  51. data/libxlsxwriter/include/xlsxwriter/metadata.h +49 -0
  52. data/libxlsxwriter/include/xlsxwriter/packager.h +27 -16
  53. data/libxlsxwriter/include/xlsxwriter/relationships.h +1 -1
  54. data/libxlsxwriter/include/xlsxwriter/shared_strings.h +1 -1
  55. data/libxlsxwriter/include/xlsxwriter/styles.h +13 -7
  56. data/libxlsxwriter/include/xlsxwriter/table.h +51 -0
  57. data/libxlsxwriter/include/xlsxwriter/theme.h +1 -1
  58. data/libxlsxwriter/include/xlsxwriter/third_party/emyg_dtoa.h +26 -0
  59. data/libxlsxwriter/include/xlsxwriter/third_party/ioapi.h +27 -25
  60. data/libxlsxwriter/include/xlsxwriter/third_party/md5.h +45 -0
  61. data/libxlsxwriter/include/xlsxwriter/third_party/zip.h +155 -153
  62. data/libxlsxwriter/include/xlsxwriter/utility.h +70 -8
  63. data/libxlsxwriter/include/xlsxwriter/vml.h +55 -0
  64. data/libxlsxwriter/include/xlsxwriter/workbook.h +218 -47
  65. data/libxlsxwriter/include/xlsxwriter/worksheet.h +2770 -241
  66. data/libxlsxwriter/include/xlsxwriter/xmlwriter.h +12 -8
  67. data/libxlsxwriter/include/xlsxwriter.h +4 -2
  68. data/libxlsxwriter/libxlsxwriter.podspec +8 -5
  69. data/libxlsxwriter/src/Makefile +58 -21
  70. data/libxlsxwriter/src/app.c +5 -2
  71. data/libxlsxwriter/src/chart.c +396 -81
  72. data/libxlsxwriter/src/chartsheet.c +22 -22
  73. data/libxlsxwriter/src/comment.c +443 -0
  74. data/libxlsxwriter/src/content_types.c +40 -1
  75. data/libxlsxwriter/src/core.c +2 -2
  76. data/libxlsxwriter/src/custom.c +1 -1
  77. data/libxlsxwriter/src/drawing.c +160 -40
  78. data/libxlsxwriter/src/format.c +109 -25
  79. data/libxlsxwriter/src/hash_table.c +1 -1
  80. data/libxlsxwriter/src/metadata.c +283 -0
  81. data/libxlsxwriter/src/packager.c +794 -94
  82. data/libxlsxwriter/src/relationships.c +1 -1
  83. data/libxlsxwriter/src/shared_strings.c +2 -4
  84. data/libxlsxwriter/src/styles.c +353 -58
  85. data/libxlsxwriter/src/table.c +304 -0
  86. data/libxlsxwriter/src/theme.c +1 -1
  87. data/libxlsxwriter/src/utility.c +143 -43
  88. data/libxlsxwriter/src/vml.c +1062 -0
  89. data/libxlsxwriter/src/workbook.c +567 -77
  90. data/libxlsxwriter/src/worksheet.c +6668 -1462
  91. data/libxlsxwriter/src/xmlwriter.c +95 -5
  92. data/libxlsxwriter/third_party/dtoa/Makefile +42 -0
  93. data/libxlsxwriter/third_party/dtoa/emyg_dtoa.c +461 -0
  94. data/libxlsxwriter/third_party/dtoa/emyg_dtoa.h +26 -0
  95. data/libxlsxwriter/third_party/md5/Makefile +42 -0
  96. data/libxlsxwriter/third_party/md5/md5.c +291 -0
  97. data/libxlsxwriter/third_party/md5/md5.h +45 -0
  98. data/libxlsxwriter/third_party/minizip/Makefile +3 -8
  99. data/libxlsxwriter/third_party/minizip/Makefile.orig +8 -4
  100. data/libxlsxwriter/third_party/minizip/MiniZip64_Changes.txt +1 -1
  101. data/libxlsxwriter/third_party/minizip/configure.ac +1 -1
  102. data/libxlsxwriter/third_party/minizip/crypt.h +13 -16
  103. data/libxlsxwriter/third_party/minizip/ioapi.c +31 -57
  104. data/libxlsxwriter/third_party/minizip/ioapi.h +31 -23
  105. data/libxlsxwriter/third_party/minizip/iowin32.c +29 -45
  106. data/libxlsxwriter/third_party/minizip/iowin32.h +4 -4
  107. data/libxlsxwriter/third_party/minizip/miniunz.c +29 -56
  108. data/libxlsxwriter/third_party/minizip/minizip.c +38 -49
  109. data/libxlsxwriter/third_party/minizip/mztools.c +1 -7
  110. data/libxlsxwriter/third_party/minizip/unzip.c +202 -342
  111. data/libxlsxwriter/third_party/minizip/unzip.h +74 -74
  112. data/libxlsxwriter/third_party/minizip/zip.c +165 -218
  113. data/libxlsxwriter/third_party/minizip/zip.h +164 -154
  114. data/libxlsxwriter/third_party/tmpfileplus/Makefile +3 -3
  115. data/libxlsxwriter/version.txt +1 -1
  116. data/test/auto_width_test.rb +20 -0
  117. data/test/default_format_test.rb +1 -1
  118. data/test/validations_test.rb +13 -2
  119. data/test/worksheet_test.rb +6 -1
  120. metadata +34 -11
  121. data/.travis.yml +0 -51
  122. data/Gemfile.lock +0 -79
  123. data/appveyor.yml +0 -25
  124. data/libxlsxwriter/.travis.yml +0 -37
  125. data/test/text_width_test.rb +0 -80
data/lib/fast_excel.rb CHANGED
@@ -36,13 +36,10 @@ module FastExcel
36
36
 
37
37
  filename = filename.to_s if defined?(Pathname) && filename.is_a?(Pathname)
38
38
 
39
- workbook = if constant_memory
40
- opt = Libxlsxwriter::WorkbookOptions.new
41
- opt[:constant_memory] = 1
42
- Libxlsxwriter.workbook_new_opt(filename, opt)
43
- else
44
- Libxlsxwriter.workbook_new(filename)
45
- end
39
+ opt = Libxlsxwriter::WorkbookOptions.new
40
+ opt[:constant_memory] = constant_memory ? 1 : 0
41
+ workbook = Libxlsxwriter.workbook_new_opt(filename, opt)
42
+
46
43
  result = Libxlsxwriter::Workbook.new(workbook)
47
44
 
48
45
  if default_format
@@ -91,8 +88,11 @@ module FastExcel
91
88
  # https://support.microsoft.com/en-us/help/214330/differences-between-the-1900-and-the-1904-date-system-in-excel
92
89
  def self.date_num(time, offset = nil)
93
90
  unless offset
94
- # Try use Rails' app timezone
95
- if Time.respond_to?(:zone)
91
+ # Try use value utc_offset
92
+ if time.respond_to?(:utc_offset)
93
+ offset = time.utc_offset
94
+ # Else try use Rails' app timezone
95
+ elsif Time.respond_to?(:zone) && !Time.zone.nil?
96
96
  offset = Time.zone.utc_offset
97
97
  else
98
98
  offset = 0 # rollback to UTC
@@ -102,26 +102,37 @@ module FastExcel
102
102
  time.to_f / XLSX_DATE_DAY + XLSX_DATE_EPOCH_DIFF + offset / XLSX_DATE_DAY
103
103
  end
104
104
 
105
- def self.print_ffi_obj(value)
106
- puts "#{value.class}"
105
+ def self.print_ffi_obj(value, do_print: true, offset: "", deep: false)
106
+ result = "#{value.class}"
107
+
107
108
  value.members.each do |key|
108
- field_val = if value[key].is_a?(FFI::Pointer) && value[key].null? || value[key].nil?
109
+ fval = value[key]
110
+ field_val = if fval.is_a?(FFI::Pointer) && fval.null? || fval.nil?
109
111
  "nil"
110
- elsif value[key].is_a?(FFI::StructLayout::CharArray)
111
- value[key].to_str.inspect
112
- elsif value[key].is_a?(String)
113
- value[key].inspect
114
- elsif value[key].is_a?(Symbol)
115
- value[key].inspect
112
+ elsif fval.is_a?(FFI::StructLayout::CharArray)
113
+ fval.to_str.inspect
114
+ elsif fval.is_a?(String)
115
+ fval.inspect
116
+ elsif fval.is_a?(Symbol)
117
+ fval.inspect
118
+ elsif fval.is_a?(FFI::Struct) && deep
119
+ print_ffi_obj(fval, do_print: false, offset: offset + " ", deep: deep)
116
120
  else
117
- value[key]
121
+ fval
118
122
  end
119
- puts "* #{key}: #{field_val}"
123
+
124
+ result += "\n#{offset}* #{key}: #{field_val}"
125
+ end
126
+
127
+ if do_print
128
+ puts result
129
+ else
130
+ return result
120
131
  end
121
- nil
122
132
  end
123
133
 
124
134
 
135
+ ERROR_ENUM = Libxlsxwriter.enum_type(:error)
125
136
  COLOR_ENUM = Libxlsxwriter.enum_type(:defined_colors)
126
137
  EXTRA_COLORS = {
127
138
  alice_blue: 0xF0F8FF,
@@ -363,10 +374,11 @@ module FastExcel
363
374
 
364
375
  def add_worksheet(sheetname = nil)
365
376
  if !sheetname.nil?
366
- if sheetname.length > Libxlsxwriter::SHEETNAME_MAX
367
- raise ArgumentError, "Worksheet name '#{sheetname}' exceeds Excel's limit of #{Libxlsxwriter::SHEETNAME_MAX} characters"
368
- elsif @sheet_names.include?(sheetname)
369
- raise ArgumentError, "Worksheet name '#{sheetname}' is already in use"
377
+ error = validate_worksheet_name(sheetname)
378
+ if error != :no_error
379
+ error_code = ERROR_ENUM.find(error)
380
+ error_str = error_code ? Libxlsxwriter.strerror(error_code) : ''
381
+ raise ArgumentError, "Invalid worksheet name '#{sheetname}': (#{error_code} - #{error}) #{error_str}"
370
382
  end
371
383
  end
372
384
 
@@ -536,7 +548,7 @@ module FastExcel
536
548
 
537
549
  def close
538
550
  if auto_width?
539
- @column_widths.each do |num, width|
551
+ @column_widths.transform_values!{ |width| width || DEF_COL_WIDTH }.each do |num, width|
540
552
  set_column_width(num, width + 0.2)
541
553
  end
542
554
  end
@@ -0,0 +1 @@
1
+ custom: ["paypal.me/xlsxwriter"]
@@ -0,0 +1,85 @@
1
+ # libxlsxwriter: Reporting Bugs
2
+
3
+ Here are some tips on reporting bugs in `libxlsxwriter`.
4
+
5
+ ### Upgrade to the latest version of the library
6
+
7
+ Upgrade to the latest version of the library since the bug you are reporting
8
+ may already be fixed.
9
+
10
+ Check the [Changes][changes] section of the documentation to see what has
11
+ changed in the latest versions.
12
+
13
+ [changes]: http://libxlsxwriter.github.io/changes.html
14
+
15
+ You can check which version of `libxlsxwriter` that you are using by checking
16
+ the `xlsxwriter.h` header file or by adding the following to your program:
17
+
18
+ ```C
19
+ #include <stdio.h>
20
+ #include "xlsxwriter.h"
21
+
22
+ int main() {
23
+
24
+ printf("Libxlsxwriter version = %s\n", lxw_version());
25
+
26
+ return 0;
27
+ }
28
+ ```
29
+
30
+ ### Read the documentation
31
+
32
+ Read or search the `libxlsxwriter` [documentation][docs] to see if the issue
33
+ you are encountering is already explained.
34
+
35
+ [docs]: http://libxlsxwriter.github.io/index.html
36
+
37
+ ### Look at the example programs
38
+
39
+ There are many [examples programs][examples] in the distribution. Try to
40
+ identify an example program that corresponds to your query and adapt it to use
41
+ as a bug report.
42
+
43
+ [examples]: http://libxlsxwriter.github.io/examples.html
44
+
45
+
46
+ ### Tips for submitting a bug report
47
+
48
+ 1. Describe the problem as clearly and as concisely as possible.
49
+ 2. Include a sample program. This is probably the most important step.
50
+ It is generally easier to describe a problem in code than in written
51
+ prose.
52
+ 3. The sample program should be as small as possible to demonstrate the
53
+ problem. Don't copy and paste large non-relevant sections of your
54
+ program.
55
+
56
+ A sample bug report is shown below. This format helps analyze and respond to
57
+ the bug report more quickly.
58
+
59
+
60
+ > Subject: Issue with SOMETHING
61
+ >
62
+ > Greetings,
63
+ >
64
+ > I am using libxlsxwriter to do SOMETHING but it appears to do SOMETHING ELSE.
65
+ >
66
+ > I am using CC version X.Y.Z, OS = uname and libxlsxwriter x.y.z.
67
+ >
68
+ > Here is some code that demonstrates the problem:
69
+ >
70
+ >
71
+ >```C
72
+ >#include "xlsxwriter.h"
73
+ >
74
+ >int main() {
75
+ >
76
+ > lxw_workbook *workbook = workbook_new("bug_report.xlsx");
77
+ > lxw_worksheet *worksheet = workbook_add_worksheet(workbook, NULL);
78
+ >
79
+ > worksheet_write_string(worksheet, 0, 0, "Hello", NULL);
80
+ > worksheet_write_number(worksheet, 1, 0, 123, NULL);
81
+ >
82
+ > return workbook_close(workbook);
83
+ >}
84
+ >```
85
+ >
@@ -0,0 +1,130 @@
1
+ # libxlsxwriter: Submitting Pull Requests
2
+
3
+ # Pull Requests and Contributing to Libxlsxwriter
4
+
5
+ All patches and pull requests are welcome but in general you should start with
6
+ an issue tracker to describe what you intend to do before you do it.
7
+
8
+
9
+ ### Getting Started
10
+
11
+ 1. Pull requests and new feature proposals must start with an [issue
12
+ tracker][issues]. This serves as the focal point for the design discussion.
13
+ 2. Describe what you plan to do. If there are API changes add some code
14
+ example to demonstrate them.
15
+ 3. Fork the repository.
16
+ 4. Run all the tests to make sure the current code works on your system using
17
+ `make test`. See the [Running the Test Suite][tests] section of the docs
18
+ for instructions.
19
+ 5. Create a feature branch for your new feature.
20
+
21
+
22
+ [tests]: http://libxlsxwriter.github.io/running_the_tests.html
23
+
24
+ ### Code Style
25
+
26
+ The code style is mainly K&R style with 4 space indents.
27
+
28
+ The author uses GNU indent (`gindent`) 2.2.10 with the following options:
29
+
30
+ ```
31
+ --braces-on-if-line
32
+ --braces-on-struct-decl-line
33
+ --case-indentation 4
34
+ --continue-at-parentheses
35
+ --declaration-comment-column 0
36
+ --format-first-column-comments
37
+ --honour-newlines
38
+ --ignore-profile
39
+ --indent-label 0
40
+ --indent-level 4
41
+ --no-space-after-function-call-names
42
+ --no-tabs
43
+ --swallow-optional-blank-lines
44
+ ```
45
+
46
+ The [indent configuration file][indentpro] is available in the repo. The code
47
+ can be indented automatically if the same version of `gindent` is used with
48
+ the following make command:
49
+
50
+ ```shell
51
+ make indent
52
+ ```
53
+
54
+ Note, make sure you have backed up your files or added them to the index
55
+ before running this command.
56
+
57
+ In general follow the existing style in the code.
58
+
59
+ [indentpro]: https://github.com/jmcnamara/libxlsxwriter/blob/master/.indent.pro
60
+
61
+ ### Writing and Running Tests
62
+
63
+ Any significant features should be accompanied by a test. See the `test`
64
+ directory and the [Running the Test Suite][tests] section of the docs for
65
+ details of the test setup.
66
+
67
+ The tests can be run as follows:
68
+
69
+ ```shell
70
+ make test
71
+ ```
72
+ Same as:
73
+
74
+ ```shell
75
+ make test_unit
76
+ make test_functional
77
+ ```
78
+
79
+ The functional tests require the Python module [pytest][pytest] as a test runner.
80
+
81
+ If you have `valgrind` installed you can use the test suite to check for memory leaks:
82
+
83
+ ```shell
84
+ make test_valgrind
85
+ ```
86
+
87
+ When you push your changes they will also be tested automatically using
88
+ [GitHub Actions][actions].
89
+
90
+ [actions]: https://github.com/jmcnamara/libxlsxwriter/actions
91
+ [pytest]: http://pytest.org/
92
+
93
+
94
+ ### Documentation
95
+
96
+ The `libxlsxwriter` documentation is written in Doxygen format in the header
97
+ files and in additional `.dox` files in the `docs/src` directory of the
98
+ repo. The documentation can be built as follows:
99
+
100
+ ```shell
101
+ make docs
102
+ open docs/html/index.html
103
+ ```
104
+
105
+
106
+ ### Example programs
107
+
108
+ If applicable add an example program to the `examples` directory. Example
109
+ files can be built using:
110
+
111
+ ```shell
112
+ make docs
113
+ ```
114
+
115
+ ### Copyright and License
116
+
117
+ Copyright remains with the original author. Do not include additional
118
+ copyright claims or Licensing requirements. GitHub and the `git` repository
119
+ will record your contribution and it will be acknowledged it in the Changes
120
+ file.
121
+
122
+
123
+ ### Submitting the Pull Request
124
+
125
+ If your change involves several incremental `git` commits then `rebase` or
126
+ `squash` them onto another branch so that the Pull Request is a single commit
127
+ or a small number of logical commits.
128
+
129
+ Push your changes to GitHub and submit the Pull Request with a hash link to
130
+ the to the Issue tracker that was opened above.
@@ -0,0 +1,48 @@
1
+ name: Test CMake build
2
+
3
+ on: [push, pull_request]
4
+
5
+ jobs:
6
+ build:
7
+ name:
8
+ Cmake
9
+ strategy:
10
+ fail-fast: false
11
+ matrix:
12
+ cc: [gcc, clang]
13
+ cmake_flags: ["",
14
+ "-DBUILD_EXAMPLES=ON -DBUILD_TESTS=ON",
15
+ "-DUSE_DTOA_LIBRARY=ON -DBUILD_TESTS=ON",
16
+ "-DUSE_MEM_FILE=ON -DBUILD_TESTS=ON",
17
+ "-DUSE_NO_MD5=ON -DBUILD_TESTS=ON",
18
+ "-DUSE_OPENSSL_MD5=ON -DBUILD_TESTS=ON",
19
+ "-DUSE_STANDARD_TMPFILE=ON -DBUILD_TESTS=ON",
20
+ "-DUSE_SYSTEM_MINIZIP=ON -DBUILD_TESTS=ON",
21
+ "-DUSE_SYSTEM_MINIZIP=ON -DUSE_OPENSSL_MD5=ON -DBUILD_TESTS=ON"]
22
+ runs-on: ubuntu-latest
23
+ env:
24
+ CC: ${{ matrix.cc }}
25
+
26
+ steps:
27
+ - uses: actions/checkout@v2
28
+
29
+ - name: Install dependencies
30
+ run: |
31
+ python -m pip install --upgrade pip
32
+ pip install pytest
33
+ sudo apt update
34
+ sudo apt-get -y install zlib1g-dev
35
+ sudo apt-get -y install libminizip-dev
36
+ sudo apt-get -y install libssl-dev
37
+
38
+ - name: Configure CMake
39
+ working-directory: ${{ github.workspace }}/cmake
40
+ run: cmake .. -DBUILD_TESTS=ON ${{ matrix.cmake_flags }} -DCMAKE_BUILD_TYPE=Release
41
+
42
+ - name: Build
43
+ working-directory: ${{ github.workspace }}/cmake
44
+ run: cmake --build . --config Release --parallel
45
+
46
+ - name: Test
47
+ working-directory: ${{ github.workspace }}/cmake
48
+ run: ctest -C Release -V
@@ -0,0 +1,23 @@
1
+ name: Check code style
2
+
3
+ on: [push, pull_request]
4
+
5
+ jobs:
6
+ build:
7
+ name:
8
+ Check code style
9
+
10
+ runs-on: ubuntu-latest
11
+
12
+ steps:
13
+ - uses: actions/checkout@v2
14
+
15
+ - name: Install dependencies
16
+ run: |
17
+ sudo apt-get -y install indent
18
+ sudo ln -s /usr/bin/indent /usr/bin/gindent
19
+
20
+ - name: Make indent
21
+ run: |
22
+ make indent
23
+ git status | grep 'nothing to commit'
@@ -0,0 +1,22 @@
1
+ name: Coverity Scan
2
+
3
+ on:
4
+ push:
5
+ branches: [coverity]
6
+
7
+ jobs:
8
+ coverity:
9
+ runs-on: ubuntu-latest
10
+ steps:
11
+
12
+ - uses: actions/checkout@v2
13
+
14
+ - name: Build third party libs to exclude them from scan
15
+ run: make third_party
16
+
17
+ - uses: vapier/coverity-scan-action@v1
18
+ with:
19
+ project: libxlsxwriter
20
+ email: ${{ secrets.COVERITY_SCAN_EMAIL }}
21
+ token: ${{ secrets.COVERITY_SCAN_TOKEN }}
22
+ command: make -C src libxlsxwriter.a
@@ -0,0 +1,52 @@
1
+ name: Test Make build
2
+
3
+ on: [push, pull_request]
4
+
5
+ jobs:
6
+ build:
7
+ name:
8
+ Make
9
+ strategy:
10
+ fail-fast: false
11
+ matrix:
12
+ cc: [gcc, clang]
13
+ make_flags: ["",
14
+ "USE_STANDARD_TMPFILE=1",
15
+ "USE_SYSTEM_MINIZIP=1",
16
+ "USE_DTOA_LIBRARY=1",
17
+ "USE_NO_MD5=1",
18
+ "USE_OPENSSL_MD5=1",
19
+ "USE_MEM_FILE=1"]
20
+ runs-on: ubuntu-latest
21
+ env:
22
+ CC: ${{ matrix.cc }}
23
+ CXX: ${{ matrix.cc }}
24
+ CFLAGS: '-Werror'
25
+
26
+ steps:
27
+ - uses: actions/checkout@v2
28
+
29
+ - name: Install dependencies
30
+ run: |
31
+ python -m pip install --upgrade pip
32
+ pip install pytest
33
+ sudo apt update
34
+ sudo apt-get -y install zlib1g-dev
35
+ sudo apt-get -y install libminizip-dev
36
+ sudo apt-get -y install libssl-dev
37
+ sudo apt-get -y install valgrind
38
+
39
+ - name: make
40
+ run: ${{ matrix.make_flags }} make V=1
41
+
42
+ - name: test unit
43
+ run: ${{ matrix.make_flags }} make test_unit V=1
44
+
45
+ - name: test functional
46
+ run: ${{ matrix.make_flags }} make test_functional V=1 -j
47
+
48
+ - name: test cpp
49
+ run: ${{ matrix.make_flags }} make test_cpp V=1
50
+
51
+ - name: test examples
52
+ run: ${{ matrix.make_flags }} make examples V=1
@@ -0,0 +1,23 @@
1
+ name: Test for memory leaks
2
+
3
+ on: [push, pull_request]
4
+
5
+ jobs:
6
+ build:
7
+ name:
8
+ Valgrind
9
+ runs-on: ubuntu-latest
10
+ env:
11
+ CC: gcc
12
+
13
+ steps:
14
+ - uses: actions/checkout@v2
15
+
16
+ - name: Install dependencies
17
+ run: |
18
+ sudo apt update
19
+ sudo apt-get -y install valgrind
20
+ sudo apt-get -y install zlib1g-dev
21
+
22
+ - name: test valgrind
23
+ run: make test_valgrind V=1 -j 2
@@ -0,0 +1,54 @@
1
+ name: Test Cmake build on Windows
2
+
3
+ on: [push, pull_request]
4
+
5
+ jobs:
6
+ build:
7
+ name: CMake on Windows
8
+
9
+ strategy:
10
+ fail-fast: false
11
+ matrix:
12
+ cmake_flags: ["-DBUILD_EXAMPLES=ON -DBUILD_TESTS=ON",
13
+ "-DUSE_DTOA_LIBRARY=ON -DBUILD_TESTS=ON",
14
+ #"-DUSE_SYSTEM_MINIZIP=ON -DBUILD_TESTS=ON",
15
+ #"-DUSE_SYSTEM_MINIZIP=ON -DUSE_OPENSSL_MD5=ON -DBUILD_TESTS=ON",
16
+ "-DUSE_OPENSSL_MD5=ON -DBUILD_TESTS=ON",
17
+ ]
18
+
19
+ runs-on: windows-latest
20
+
21
+ steps:
22
+ - uses: actions/checkout@v2
23
+
24
+ - name: Install dependencies
25
+ working-directory: ${{env.GITHUB_WORKSPACE}}
26
+ shell: cmd
27
+ run: |
28
+ vcpkg.exe install zlib:x64-windows minizip:x64-windows openssl:x64-windows
29
+ vcpkg.exe integrate install
30
+ pip install pytest
31
+
32
+ - name: Configure CMake
33
+ working-directory: ${{env.GITHUB_WORKSPACE}}
34
+ shell: cmd
35
+ run: |
36
+ cd cmake
37
+ call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
38
+ cmake .. -DCMAKE_BUILD_TYPE=Release ${{ matrix.cmake_flags }} -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake -A x64
39
+
40
+ - name: Build
41
+ working-directory: ${{env.GITHUB_WORKSPACE}}
42
+ shell: cmd
43
+ run: |
44
+ cd cmake
45
+ call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
46
+ cmake --build . --config Release
47
+
48
+ - name: Test
49
+ working-directory: ${{env.GITHUB_WORKSPACE}}
50
+ shell: cmd
51
+ run: |
52
+ cd cmake
53
+ copy test\functional\src\Release\*.exe test\functional\src
54
+ pytest -v test/functional
@@ -0,0 +1,22 @@
1
+ name: Zig Build
2
+
3
+ on: [push, pull_request]
4
+
5
+ jobs:
6
+ build:
7
+ strategy:
8
+ fail-fast: false
9
+ matrix:
10
+ runs-on: [ubuntu-latest, macos-latest, windows-latest]
11
+ runs-on: ${{ matrix.runs-on }}
12
+ steps:
13
+ - uses: actions/checkout@v4
14
+ with:
15
+ submodules: recursive
16
+ fetch-depth: 0
17
+ - uses: goto-bus-stop/setup-zig@v2
18
+ with:
19
+ version: 0.11.0
20
+
21
+ - name: Build Summary
22
+ run: zig build -DBUILD_TESTS -DBUILD_EXAMPLES -DUSE_SYSTEM_MINIZIP --summary all -freference-trace
@@ -1,11 +1,14 @@
1
1
  *.a
2
2
  *.o
3
3
  *.so
4
+ *.so.*
4
5
  *.to
5
6
  *.lo
6
7
  *.la
7
8
  *.dylib
8
9
  *.dll
10
+ *.gcno
11
+ *.gcda
9
12
  test_*
10
13
  !test_*.c
11
14
  !test_*.cpp
@@ -35,10 +38,12 @@ docs/latex
35
38
  _temp.c
36
39
  examples/*
37
40
  !examples/*.c
38
- !examples/logo.png
41
+ !examples/*.png
39
42
  !examples/Makefile
43
+ !examples/vbaProject.bin
40
44
  cov-int
41
45
  libxlsxwriter-coverity.tgz
46
+ build
42
47
 
43
48
  third_party/zlib-1.2.8/configure.log
44
49
  third_party/zlib-1.2.8/contrib/minizip/miniunz
@@ -48,3 +53,13 @@ third_party/zlib-1.2.8/examplesh
48
53
  third_party/zlib-1.2.8/minigzip
49
54
  third_party/zlib-1.2.8/minigzipsh
50
55
  third_party/zlib-1.2.8/zlib.pc
56
+
57
+ cmake
58
+ !cmake/FindMINIZIP.cmake
59
+ !cmake/FindPackage.cmake
60
+ !cmake/i686-toolchain.cmake
61
+
62
+ .vscode
63
+
64
+ zig-cache/
65
+ zig-out/