This test module is part of matlab2tikz.
Its use is mainly of interest to the matlab2tikz developers to assert that the produced output is good.
Ideally, the tests should be run on every supported environment, i.e.:
* MATLAB R2014a/8.3 (or an older version)
* MATLAB R2014b/8.4 (or a newer version)
* Octave 3.8
Preparing your environment
==========================
Before you can run the tests, you need to make sure that you have all relevant
functions available on your path. From within the `/test` directory run the
following code in your MATLAB/Octave console:
```matlab
addpath(pwd); % for the test harness
addpath(fullfile(pwd,'..','src')); % for matlab2tikz
addpath(fullfile(pwd,'suites')); % for the test suites
```
Running the tests
=================
We have two kinds of tests runners available that each serve a slightly different
purpose.
* "Graphical" tests produce an output report that graphically shows test
figures as generated by MATLAB/Octave and our TikZ output.
* "Headless" tests do not produce graphical output, but instead check the MD5
hash of the generated TikZ files to make sure that the same output
as before is generated.
It is recommended to run the headless tests first and check the problems in
the graphical tests afterwards.
Headless tests
--------------
These tests check that the TikZ output file produced by `matlab2tikz` matches
a reference output. The actual checking is done by hashing the file and the
corresponding hashes are stored in `.md5` files next to the test suites.
For each environment, different reference hashes can be stored.
The headless tests can be invoked using
```matlab
testHeadless;
```
, or, equivalently,
```matlab
makeTravisReport(testHeadless)
```
There are some caveats for this method of testing:
* The MD5 hash is extremely brittle to small details in the output: e.g.
extra whitespace or some other characters will change the hash.
* This automated test does NOT test whether the output is desirable or not.
It only checks whether the previous output is not altered!
* Hence, when structural changes are made, the reference hash should be changed.
This SHOULD be motivated in the pull request (e.g. with a picture)!
Graphical tests
---------------
These tests allow easy comparison of a native PDF `print` output and the
output produced by `matlab2tikz`. For the large amount of cases, however,
this comparison has become somewhat unwieldy.
You can execute the tests using
```matlab
testGraphical;
```
or, equivalently,
```matlab
makeLatexReport(testGraphical)
```
This generates a LaTeX report in `test/output/current/acid.tex` which can then be compiled.
Compilation of this file can be done using the Makefile `test/output/current/Makefile` if you are on a Unix-like system (OS X, Linux) or have [Cygwin](https://www.cygwin.com) installed on Windows.
If all goes well, the result will be the file `test/output/current/acid.pdf` that contains
a list of the test figures, exported as PDF and right next to it the matlab2tikz generated plot.
Advanced Use
------------
Both `testHeadless` and `testGraphical` can take multiple arguments, those are documented in the raw test runner `testMatlab2tikz` that is used behind the scenes. Note that this file sits in a private directory, so `help testMatlab2tikz` will not work!
Also, both can be called with a single output argument, for programmatical
access to the test results as
```matlab
status = testHeadless()
```
These test results in `status` can be passed to `saveHashTable` for updating the hash tables.
Obviously, this should be done with the due diligence!
Automated Tests
===============
The automated tests run on [Travis-CI](https://travis-ci.org) for Octave and on a [personal Jenkins server](https://github.com/matlab2tikz/matlab2tikz/wiki/Jenkins) for MATLAB.
These are effectively the "headless" tests that get called by the `runMatlab2TikzTests` function.
Without verification of those automated tests, a pull request is unlikely to get merged.
没有合适的资源?快使用搜索试试~ 我知道了~
基于matlab2tikz项目基于matlab2tikz项目基于matlab2tikz项目基于matlab2tikz项目.zip
共88个文件
m:65个
md:6个
md5:5个
需积分: 1 0 下载量 26 浏览量
2024-05-07
12:42:13
上传
评论
收藏 216KB ZIP 举报
温馨提示
基于matlab2tikz项目基于matlab2tikz项目基于matlab2tikz项目基于matlab2tikz项目基于matlab2tikz项目基于matlab2tikz项目基于matlab2tikz项目基于matlab2tikz项目基于matlab2tikz项目
资源推荐
资源详情
资源评论
收起资源包目录
基于matlab2tikz项目.zip (88个子文件)
matlab2tikz-master
runtests.sh 2KB
logos
matlab2tikz.svg 6KB
LICENSE.md 1KB
.travis.yml 704B
src
cleanfigure.m 46KB
m2tInputParser.m 8KB
m2tcustom.m 9KB
matlab2tikz.m 288KB
figure2dot.m 4KB
dev
formatWhitespace.m 3KB
private
versionArray.m 550B
isAxis3D.m 179B
m2tstrjoin.m 1KB
m2tUpdater.m 13KB
guitypes.m 635B
errorUnknownEnvironment.m 246B
versionString.m 220B
getEnvironment.m 668B
isVersionBelow.m 443B
matlab2tikz.sublime-project 1KB
CONTRIBUTING.md 5KB
CHANGELOG.md 15KB
test
codeReport.m 9KB
template
Makefile 590B
data
converted
Makefile 387B
.gitignore 76B
reference
Makefile 279B
.gitignore 64B
saveHashTable.m 7KB
makeTravisReport.m 13KB
examples
example_quivers.m 2KB
example_bar_plot.m 1KB
output
.gitignore 146B
makeLatexReport.m 9KB
compareTimings.m 8KB
testGraphical.m 1KB
suites
testSurfshader.m 3KB
testPatches.m 4KB
ACID.MATLAB.8.3.md5 5KB
issues.m 1KB
ACID.MATLAB.8.4.md5 5KB
ACID.Octave.4.2.0.md5 4KB
ACID.Octave.4.2.2.md5 4KB
ACID.Octave.3.8.0.md5 4KB
ACID.m 95KB
private
versionCompare.m 735B
isMATLAB.m 189B
getEnvironment.m 668B
herrorbar.m 4KB
isEnvironment.m 2KB
isOctave.m 191B
isVersionBelow.m 1KB
runMatlab2TikzTests.m 1KB
testHeadless.m 2KB
makeTapReport.m 2KB
README.md 4KB
private
emptyStatus.m 1KB
m2troot.m 937B
loadHashTable.m 717B
VersionControlIdentifier.m 2KB
execute_save_stage.m 2KB
execute_plot_stage.m 1KB
StreamMaker.m 2KB
m2tstrjoin.m 747B
restoreGlobalState.m 327B
calculateMD5Hash.m 1KB
execute_type_stage.m 564B
countNumberOfErrors.m 146B
getStagesFromStatus.m 220B
initializeGlobalState.m 4KB
errorHandler.m 2KB
emptyStage.m 133B
getEnvironment.m 668B
fillStruct.m 327B
testMatlab2tikz.m 5KB
cleanFiles.m 706B
errorHasOccurred.m 554B
splitUnreliableTests.m 274B
hasTestFailed.m 410B
hashTableName.m 2KB
OSVersion.m 1KB
execute_hash_stage.m 1KB
splitPassFailSkippedTests.m 420B
execute_tikz_stage.m 2KB
.gitignore 68B
README.md 4KB
AUTHORS.md 3KB
随机森林.txt 7KB
共 88 条
- 1
资源评论
Yuki-^_^
- 粉丝: 2341
- 资源: 161
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功