154 Commits

Author SHA1 Message Date
Ingy döt Net f6e09f829b Changes for 0.2.1 release 0.2.1 2018-06-26 14:43:59 -07:00
Éric Thiébaut 83d3d38838 Fix two typos in header comments. (#120) 2018-06-25 00:44:49 -04:00
Roger Peppe 01f3a87861 Remove need for PTRDIFF_MAX
It's just as easy to calculate the maximum value directly.
2018-01-11 09:36:31 -08:00
Marty E. Plummer d050fe3f30 Major cleanup of .gitignore
You don't need to specify full paths to files if you do it like this.
Wildcard away most of the stuff you can, and for stuff you can't easily
wildcard, be as generic as you can.

Signed-off-by: Marty E. Plummer <hanetzer@protonmail.com>
2018-01-09 22:36:33 -08:00
William Roberts 639981a546 Update libyaml homepage link in README
Update the link to point where libyaml is now maintained. Per the old
link, "LibYAML is now maintained at https://github.com/yaml/libyaml.
This page is left for historical purposes."
2018-01-09 21:03:41 -08:00
Marty E. Plummer d9c23d9197 Add mingw-w64 builds to appveyor.yml
Currently the cygwin autoconf builds only test builds of cygwin-native
binaries, and not mingw-w64 pure windows binaries. The resultant
cygyaml-0-2.dll has a runtime dep on the cygwin1.dll which is generally
not appropriate for the purpose of distribution. Building with mingw-w64
produces libraries with no dependency on the cygwin runtime.

Signed-off-by: Marty E. Plummer <hanetzer@protonmail.com>
2018-01-08 21:07:58 -08:00
Reini Urban fc2dd942fc Fixed most compiler warnings -Wall -Wextra
repro:
  CFLAGS="-Wall -Wextra -Wunused-parameter -Wc++-compat" ./configure && make

which we use for perl, and libyaml is now included in cperl.
Tested with gcc-5 and clang-3.7

There are still a tons of format warnings (%d on 64bit) in
example-deconstructor.c which I skipped.
2018-01-08 10:44:25 -08:00
Andy Grundman 2b8b563222 Compilation fix for Solaris
From https://github.com/ingydotnet/yaml-libyaml-pm/issues/24
2018-01-08 10:37:15 -08:00
Ingy döt Net a9a9b271fe Docker test file changes (added alpine testing)
Also reworked all the dockerfiles to be cleaner and consistent:

* Fixed some indentation
* Removed vim dependencies
* Collapsed RUN steps for less build layers
* Renamed dockerfiles/ to shorter and more adaptable docker/
2018-01-08 00:21:04 -08:00
Marty E. Plummer a70c7f36cb add -no-undefined to src/Makefile.am
Without this change building a dll with the mingw-w64 toolchain is
impossible. All tests from make test-all succeed on native linux
(Gentoo amd64 glibc default/linux/amd64/17.1/desktop gcc-7.2.0)

Signed-off-by: Marty E. Plummer <hanetzer@protonmail.com>
2018-01-06 22:43:18 -06:00
Ingy döt Net aa10f65706 Fix problems in CI failures (travis and semaphore)
In the Makefile.am, switched out the fetch (which can have auth problems
in certain envs) with a simple branch per @perlpunk++'s suggestion.

With the new test branches, travis had a problem in that it only clones
one branch and we need the other branch refs to be available. Fixed this
by fetching the other branch refs. I also cleaned up the travis YAML
file.

The Ubuntu 14.04 docker image (used by semaphoreci) had an older git,
without the worktree command, so I made it install the latest git from a
ppa.

Renamed tests/run-tests.sh to tests/run-all-tests.sh for tab completion
conflict reasons.
2018-01-06 14:39:12 -08:00
Ingy döt Net e4aee06ff4 Move tests/run-test-suite to branch run-test-suite
with the intent that `make test-suite` will use it as a branch.

This commit makes the libyaml and yaml-test-suite repos completely
independent. The only thing in master is a Makefile rule for
`make run-test-suite`.

The run-test-suite branch takes care of everything else.

This will keep the master branch history clean from any yaml-test-suite
activity, while keeping everything up to date.

Pinning will just work for whatever commit of master you run the tests
from. The pinning work will all be done in the `run-test-suite` branch.
2017-12-29 19:58:07 -08:00
Tina Müller 6a9e942e27 Replace Mercurial with Git in README 2017-12-26 02:37:51 +01:00
Tina Müller 61dd999bfe Update libyaml-{parser,emitter}.list
yaml-test-suite/data commit:
daf799e 2017-12-23 "Regenerated data from master 1eacbab"
2017-12-23 17:21:39 +01:00
Tina Müller 5672b16382 Define PTRDIFF_MAX if it's not in stdint.h
Seems to be the case on HP-UX
2017-12-23 01:48:59 +01:00
Tina Müller 6cc8b63ff7 Forbid escaped singlequote in doublequotes
See also issue #68
2017-12-02 22:26:25 +01:00
Tina Müller e5aadc7349 Rewrite make test-suite
No recursive make anymore

Remove MY_LD_LIBRARY_PATH and friends

This is now done by the wrapper script

Remove LIBYAML_DIR variable

not needed anymore

Merge ReadMe.md files to one
2017-12-02 22:23:23 +01:00
Tina Müller fd5bf68a30 Skip 5 tests in libyaml-emitter.list 2017-12-01 14:33:19 +01:00
Jean-Christophe Fillion-Robin fe3d086fa7 Improve CMake build system
New build options
-----------------

* Add option BUILD_TESTING by default ON
See https://cmake.org/cmake/help/v2.8.12/cmake.html#module:CTest

* Simplify library type selection using standard option BUILD_SHARED_LIBS
See https://cmake.org/cmake/help/v3.0/variable/BUILD_SHARED_LIBS.html

yamlConfig.cmake
----------------

* Generate and install yamlConfig.cmake, yamlConfigVersion.cmake and yamlTargets.cmake

* Bump CMake version and explicitly associate include dirs with targets
See https://cmake.org/cmake/help/v3.0/manual/cmake-buildsystem.7.html#include-directories-and-usage-requirements

* Ensure building against libyaml using "find_package(yaml)" uses expected compile options: Set HAVE_CONFIG_H
as private compile option, YAML_DECLARE_STATIC as public

Testing
-------

* Build all examples from "tests" directory

CMake Best practices
--------------------

* configure "config.h" based on version info found in CMakeLists.txt

* Ensure buildsystem re-generation listing sources (best-practice)

It is not recommended to use GLOB to collect a list of source files from
the source tree. If no CMakeLists.txt file changes when a source is added
or removed then the generated build system cannot know when to ask CMake
to regenerate.

See https://cmake.org/cmake/help/v3.8/command/file.html

Compilation warnings
--------------------

* Set _CRT_SECURE_NO_WARNINGS if building using VisualStudio

This will avoid warnings like this one:

```
C:\projects\libyaml\tests\run-emitter.c(268): warning C4996: 'fopen':
This function or variable may be unsafe. Consider using fopen_s instead.
To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for
details.
```

Continuous Integration
----------------------

* travis: Install CMake >= 3.x using scikit-ci-addons

* Add comments to appveyor.yml and run-tests.sh
2017-11-30 07:14:27 -06:00
Ingy döt Net 660242d6a4 Remove deleted test from parser test list. 2017-05-14 13:57:12 +02:00
Ian Cordasco 6bbc217fc7 Fix unitialized value crash found by OSS Fuzz
Google's OSS Fuzz project found input for libyaml that was capable of
triggering an uninitialized value crash.

Patch provided by Alex Gaynor
2017-05-13 18:27:08 -05:00
Anthony Hendrickson 119b7b6adf Updates defs for MingGW support on Windows
addresses issue #52
2017-03-10 16:12:57 -05:00
John Kirkham 300bd3f89e cmake: Provide support for building dynamic and static libraries. 2017-02-22 00:00:03 -05:00
Ingy döt Net c9878e19bd Switch test-suite run list from black to whitelist
This way as the test suite grows, new tests won't disturb/break our
testing.
2017-02-09 08:24:33 -08:00
Ingy döt Net 7b67c28a39 Skip edge case test M7A3 2017-01-18 18:02:04 +01:00
Ingy döt Net ed44fa2ddf Add reminder when user is using GNUmakefile 2017-01-02 10:46:29 -08:00
Ingy döt Net de19e70b6d Add a .makefile for immediate make targets
We can add various development activities to this alternate Makefile.

If you do this first:
```
ln {.,GNU}makefile
```

then you can use the new targets and the old ones without specifying the
`.makefile` in make commands and without worrying about bootstrap.

ie Before this, to use Makefile targets, you needed to run `./bootstrap`
and `./configure` first. This file will proxy all common Makefile
targets, first making sure that the Makefile exists.
2017-01-02 10:29:32 -08:00
Ingy döt Net 2fc6dc0885 Add fedora dockerfile from PR #43 2016-12-30 16:41:06 -06:00
Ingy döt Net 048095f030 Get tests passing on Docker
The Dockerfiles needed to set LD_LIBRARY_PATH.

For some bizarre reason I needed to build the parser and emitter twice.
Since I plan to redo the building of these binaries later, this is OK
for now, since all tests on all CICDs will pass.

The docker stuff was needed by the semaphoreci system.
2016-12-30 15:54:54 -06:00
Ingy döt Net a672b07109 Include libyaml-test and libyaml-parser-emitter
Before the `make test-suite` command would clone yaml/libyaml-test which
would in tuen clone yaml/libyaml-parser-emitter. Now they are part of
the repository since they are not really useful outside the repository.

They still clone the data branch of yaml/yaml-test-suite. That is where
all the actual test data resides. That belongs outside the repo because
it is intended for all yaml frameworks.
2016-12-30 11:09:58 -06:00
Ingy döt Net 52b6634fb3 Move Travis CI steps into a Bash script
This allows us to run the same Travis testing locally.

Examples:

    ./tests/run-tests.sh
2016-12-29 19:09:53 -06:00
Ingy döt Net 90d6ba3ca1 Update .gitignore with latest generated files 2016-12-29 19:06:10 -06:00
Ian Cordasco 70342132b4 Fix pointer and enum warnings in deconstructor-alt
This should cover the remainder of the warnings found on the Travis CI
OSX builder.
2016-12-29 15:55:41 -06:00
Ian Cordasco 49be466cb1 Fix pointer warnings in example-deconstructor
There were several places in our test deconstructor where we were
passing plain char[]s to functions expecting (yaml_char_t *)s. Since we
will soon be forcing warnings to become errors, it makes sense to clean
these up.
2016-12-29 15:55:41 -06:00
Ian Cordasco b6cc3a689d Add -Wall to list of compile flags
Let's start warning on everything and we'll clean the warnings up as we
go along.
2016-12-29 15:55:41 -06:00
Kevin Wojniak 6bc9e2466b Fix typo 2016-12-28 21:11:55 -08:00
Ingy döt Net c72cf5fde8 Add make test-all to travis
This runs `make test` and `make test-suite`.
2016-12-17 14:53:17 -08:00
Ingy döt Net 26b098f267 Add Makefile support for yaml-test-suite
Add `test-suite` rule to Makefile.  This test clones the libyaml-test
repo (which then clones the libyaml-parser and libyaml-emitter repos)
and calls `make test` in it.  That in turn clone yaml/yaml-test suite.

Normally the subtests will clone the latest libyaml, but this test
passes the current libyaml via an environment variable.

Also add `test-all` to run this together with normal `make test` rule.
2016-12-17 14:50:24 -08:00
Ian Cordasco d688ead5eb Utilize Travis CI's OSX builders
This should catch the problems Ingy saw locally
2016-12-17 13:27:18 -08:00
Ian Cordasco 44d49c9019 Fix -Wformat compilation errors in tests
There were several warnings generated by formatting errors in the tests,
this corrects the format strings and silences the warnings.
2016-12-17 13:27:18 -08:00
Ian Cordasco fd039be5f1 Use AM_CPPFLAGS since autotools deprecated INCLUDE
autoconf deprecated INCLUDE around version 2.69. No other automake file
in the project uses INCLUDE (instead they use AM_CPPFLAGS) and this
warning prevents the bootstrap-configure-make process from working on
OSX for me. Updating the variable name in the include/Makefile.am fixes
this and allows me to move along with development on OSX.
2016-12-10 11:14:56 -06:00
Alex Gaynor bc67233b54 Update bug report URL in README 2016-12-09 09:25:10 -05:00
Ian Cordasco d55b4f83bd Update bug report URL in LibYAML
Previously we pointed at BitBucket, but we're using GitHub now, so we
should update that.
2016-12-08 06:23:37 -06:00
Ian Cordasco 87a90e0b54 Add maintainer field to dockerfiles 2016-12-07 19:31:17 -06:00
Alex Gaynor e09a1ee23e Added an example of using a global tag
From the yaml spec
2016-12-07 18:46:17 -06:00
Alex Gaynor 989bfd7919 Include an example of a %YAML tag 2016-12-07 18:46:17 -06:00
Alex Gaynor ef55068d8e Include an example of a custom tag from Python 2016-12-07 18:46:17 -06:00
Ian Cordasco 80f22796f1 Start working with multiple Dockerfiles
As opposed to having a single Dockerfile with support for only one
distro.
2016-12-07 06:45:18 -06:00
Ingy döt Net d1de67e79c Dockerfile for creating a test environment
Uses ubuntu 16.04. `make test` is not yet working.
2016-12-07 06:45:18 -06:00
Stephen H. Gerstacker 3c80be99fb Added missing Cflags path in pkg-config file 2016-12-07 06:19:02 -06:00