diff mbox series

[v3,7/7] docparse: Split into metadata and docparse

Message ID 20211103120233.20728-8-chrubis@suse.cz
State Accepted
Headers show
Series docparse improvements | expand

Commit Message

Cyril Hrubis Nov. 3, 2021, 12:02 p.m. UTC
That way the metadata are build and installed unconditionally as they
are going to be integral part of the test execution framework.

The metadata file is also renamed to ltp.json and installed into
$DESTDIR/metadata/ltp.json.

The docparse build is triggered from the metadata Makefile since it has
to be done once the ltp.json is fully generated.

Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
---
 Makefile                                      |  5 +---
 docparse/.gitignore                           |  2 --
 docparse/Makefile                             | 12 ++-------
 metadata/.gitignore                           |  2 ++
 metadata/Makefile                             | 27 +++++++++++++++++++
 {docparse => metadata}/data_storage.h         |  0
 docparse/docparse.c => metadata/metaparse.c   |  0
 {docparse => metadata}/parse.sh               |  2 +-
 {docparse => metadata}/tests/Makefile         |  0
 {docparse => metadata}/tests/array_size01.c   |  0
 .../tests/array_size01.c.json                 |  0
 {docparse => metadata}/tests/array_size02.c   |  0
 .../tests/array_size02.c.json                 |  0
 {docparse => metadata}/tests/array_size03.c   |  0
 .../tests/array_size03.c.json                 |  0
 {docparse => metadata}/tests/array_size04.c   |  0
 .../tests/array_size04.c.json                 |  0
 {docparse => metadata}/tests/empty_struct.c   |  0
 .../tests/empty_struct.c.json                 |  0
 {docparse => metadata}/tests/expand_flags.c   |  0
 .../tests/expand_flags.c.json                 |  0
 {docparse => metadata}/tests/include.c        |  0
 {docparse => metadata}/tests/include.c.json   |  0
 {docparse => metadata}/tests/include.h        |  0
 {docparse => metadata}/tests/macro.c          |  0
 {docparse => metadata}/tests/macro.c.json     |  0
 {docparse => metadata}/tests/macro_str.c      |  0
 {docparse => metadata}/tests/macro_str.c.json |  0
 .../tests/multiline_macro.c                   |  0
 .../tests/multiline_macro.c.json              |  0
 {docparse => metadata}/tests/tags.c           |  0
 {docparse => metadata}/tests/tags.c.json      |  0
 {docparse => metadata}/tests/test.sh          |  2 +-
 33 files changed, 34 insertions(+), 18 deletions(-)
 create mode 100644 metadata/.gitignore
 create mode 100644 metadata/Makefile
 rename {docparse => metadata}/data_storage.h (100%)
 rename docparse/docparse.c => metadata/metaparse.c (100%)
 rename {docparse => metadata}/parse.sh (91%)
 rename {docparse => metadata}/tests/Makefile (100%)
 rename {docparse => metadata}/tests/array_size01.c (100%)
 rename {docparse => metadata}/tests/array_size01.c.json (100%)
 rename {docparse => metadata}/tests/array_size02.c (100%)
 rename {docparse => metadata}/tests/array_size02.c.json (100%)
 rename {docparse => metadata}/tests/array_size03.c (100%)
 rename {docparse => metadata}/tests/array_size03.c.json (100%)
 rename {docparse => metadata}/tests/array_size04.c (100%)
 rename {docparse => metadata}/tests/array_size04.c.json (100%)
 rename {docparse => metadata}/tests/empty_struct.c (100%)
 rename {docparse => metadata}/tests/empty_struct.c.json (100%)
 rename {docparse => metadata}/tests/expand_flags.c (100%)
 rename {docparse => metadata}/tests/expand_flags.c.json (100%)
 rename {docparse => metadata}/tests/include.c (100%)
 rename {docparse => metadata}/tests/include.c.json (100%)
 rename {docparse => metadata}/tests/include.h (100%)
 rename {docparse => metadata}/tests/macro.c (100%)
 rename {docparse => metadata}/tests/macro.c.json (100%)
 rename {docparse => metadata}/tests/macro_str.c (100%)
 rename {docparse => metadata}/tests/macro_str.c.json (100%)
 rename {docparse => metadata}/tests/multiline_macro.c (100%)
 rename {docparse => metadata}/tests/multiline_macro.c.json (100%)
 rename {docparse => metadata}/tests/tags.c (100%)
 rename {docparse => metadata}/tests/tags.c.json (100%)
 rename {docparse => metadata}/tests/test.sh (88%)

Comments

Petr Vorel Nov. 3, 2021, 1:04 p.m. UTC | #1
Hi Cyril,

there are still some failures
https://github.com/pevik/ltp/actions/runs/1416702471

make install has wrong path (it's on jobs with out-of-tree build and with
Fedora; it's visible in .github/workflows/ci.yml - MAKE_INSTALL but unfortunately GitHub Actions hide these variables):

https://github.com/pevik/ltp/runs/4092384478?check_suite_focus=true
install -m 00775   "/__w/ltp/ltp-build/metadata/ltp.json" /github/home/ltp-install/opt/ltp/metadata/ltp.json
install -m 00775   "/__w/ltp/ltp-build/metadata/docparse" /github/home/ltp-install/opt/ltp/metadata/docparse
install: cannot stat '/__w/ltp/ltp-build/metadata/docparse': No such file or directory
make[1]: *** [/__w/ltp/ltp/include/mk/env_post.mk:85: /github/home/ltp-install/opt/ltp/metadata/docparse] Error 1

Obviously path should be '/__w/ltp/ltp-build/metadata/../docparse'

Reproducing locally:
$ ./configure CC=clang
$ cd metadata
$ make
$ make install
mkdir -p "/opt/ltp/metadata"
install -m 00775   "ltp.git/metadata/ltp.json" /opt/ltp/metadata/ltp.json
install -m 00775   "ltp.git/metadata/docparse" /opt/ltp/metadata/docparse
install: cannot stat 'ltp.git/metadata/docparse': No such file or directory
make: *** [../include/mk/env_post.mk:85: /opt/ltp/metadata/docparse] Error 1

Kind regards,
Petr
Petr Vorel Nov. 3, 2021, 1:06 p.m. UTC | #2
Hi Cyril,

> Obviously path should be '/__w/ltp/ltp-build/metadata/../docparse'
Actually
'/__w/ltp/ltp-build/metadata/../docparse/docparse'

Or we might want to disable installing docparse.

Kind regards,
Petr
Cyril Hrubis Nov. 3, 2021, 1:16 p.m. UTC | #3
Hi!
> make install has wrong path (it's on jobs with out-of-tree build and with
> Fedora; it's visible in .github/workflows/ci.yml - MAKE_INSTALL but unfortunately GitHub Actions hide these variables):
> 
> https://github.com/pevik/ltp/runs/4092384478?check_suite_focus=true
> install -m 00775   "/__w/ltp/ltp-build/metadata/ltp.json" /github/home/ltp-install/opt/ltp/metadata/ltp.json
> install -m 00775   "/__w/ltp/ltp-build/metadata/docparse" /github/home/ltp-install/opt/ltp/metadata/docparse
> install: cannot stat '/__w/ltp/ltp-build/metadata/docparse': No such file or directory
> make[1]: *** [/__w/ltp/ltp/include/mk/env_post.mk:85: /github/home/ltp-install/opt/ltp/metadata/docparse] Error 1
> 
> Obviously path should be '/__w/ltp/ltp-build/metadata/../docparse'
> 
> Reproducing locally:
> $ ./configure CC=clang
> $ cd metadata
> $ make
> $ make install
> mkdir -p "/opt/ltp/metadata"
> install -m 00775   "ltp.git/metadata/ltp.json" /opt/ltp/metadata/ltp.json
> install -m 00775   "ltp.git/metadata/docparse" /opt/ltp/metadata/docparse
> install: cannot stat 'ltp.git/metadata/docparse': No such file or directory
> make: *** [../include/mk/env_post.mk:85: /opt/ltp/metadata/docparse] Error 1

Actually it's the

MAKE_TARGETS := ltp.json docparse

which treats the docparse as a actuall file.

So I guess that we need this:

diff --git a/metadata/Makefile b/metadata/Makefile
index 6c36cd210..522af4270 100644
--- a/metadata/Makefile
+++ b/metadata/Makefile
@@ -6,7 +6,7 @@ top_srcdir              ?= ..
 include $(top_srcdir)/include/mk/env_pre.mk
 include $(top_srcdir)/include/mk/functions.mk

-MAKE_TARGETS           := ltp.json docparse
+MAKE_TARGETS           := ltp.json
 HOST_MAKE_TARGETS      := metaparse
 INSTALL_DIR            = metadata

@@ -14,13 +14,16 @@ INSTALL_DIR         = metadata

 ltp.json: metaparse
        $(abs_srcdir)/parse.sh > ltp.json
-
-docparse: ltp.json
 ifeq ($(WITH_METADATA),yes)
        mkdir -p $(abs_top_builddir)/docparse
        $(MAKE) -C $(abs_top_builddir)/docparse/ -f $(abs_top_srcdir)/docparse/Makefile
 endif

+ifeq ($(WITH_METADATA),yes)
+install:
+       $(MAKE) -C $(abs_top_builddir)/docparse/ -f $(abs_top_srcdir)/docparse/Makefile install
+endif
+
 test:
        $(MAKE) -C $(abs_srcdir)/tests/ test
Cyril Hrubis Nov. 3, 2021, 1:18 p.m. UTC | #4
Hi!
> Actually it's the
> 
> MAKE_TARGETS := ltp.json docparse
> 
> which treats the docparse as a actuall file.
> 
> So I guess that we need this:
> 
> diff --git a/metadata/Makefile b/metadata/Makefile
> index 6c36cd210..522af4270 100644
> --- a/metadata/Makefile
> +++ b/metadata/Makefile
> @@ -6,7 +6,7 @@ top_srcdir              ?= ..
>  include $(top_srcdir)/include/mk/env_pre.mk
>  include $(top_srcdir)/include/mk/functions.mk
> 
> -MAKE_TARGETS           := ltp.json docparse
> +MAKE_TARGETS           := ltp.json
>  HOST_MAKE_TARGETS      := metaparse
>  INSTALL_DIR            = metadata
> 
> @@ -14,13 +14,16 @@ INSTALL_DIR         = metadata
> 
>  ltp.json: metaparse
>         $(abs_srcdir)/parse.sh > ltp.json
> -
> -docparse: ltp.json
>  ifeq ($(WITH_METADATA),yes)
>         mkdir -p $(abs_top_builddir)/docparse
>         $(MAKE) -C $(abs_top_builddir)/docparse/ -f $(abs_top_srcdir)/docparse/Makefile
>  endif

And obviously if we do not want to install the html pages we can remove
this part:

> +ifeq ($(WITH_METADATA),yes)
> +install:
> +       $(MAKE) -C $(abs_top_builddir)/docparse/ -f $(abs_top_srcdir)/docparse/Makefile install
> +endif
Petr Vorel Nov. 3, 2021, 2:38 p.m. UTC | #5
Hi Cyril,

Changes LGTM (works locally, testing it in CI:
https://github.com/pevik/ltp/actions/runs/1417208983

> And obviously if we do not want to install the html pages we can remove
> this part:

I'd keep installing html/pdf. Also nice json is also installed.

Kind regards,
Petr
Petr Vorel Nov. 3, 2021, 3:11 p.m. UTC | #6
> Hi Cyril,

> Changes LGTM (works locally, testing it in CI:
> https://github.com/pevik/ltp/actions/runs/1417208983
Failed :(.

Reproducible locally:
make -C "metadata" \
	-f "/home/pvorel/install/src/ltp.git/metadata/Makefile" install
make[1]: Entering directory '/home/pvorel/install/src/ltp.git/metadata'
make -C /home/pvorel/install/src/ltp.git/docparse/ -f /home/pvorel/install/src/ltp.git/docparse/Makefile install
make[2]: Entering directory '/home/pvorel/install/src/ltp.git/docparse'
install -m 00775   "/home/pvorel/install/src/ltp.git/docparse/metadata.html" /opt/ltp/metadata/metadata.html
install: cannot stat '/home/pvorel/install/src/ltp.git/docparse/metadata.html': No such file or directory
make[2]: *** [../include/mk/env_post.mk:85: /opt/ltp/metadata/metadata.html] Error 1
make[2]: Leaving directory '/home/pvorel/install/src/ltp.git/docparse'
make[1]: *** [/home/pvorel/install/src/ltp.git/metadata/Makefile:26: install] Error 2
make[1]: Leaving directory '/home/pvorel/install/src/ltp.git/metadata'
make: *** [Makefile:138: metadata-install] Error 2

Maybe I wrongly applied your patch, could you please have a look?

Kind regards,
Petr

diff --git metadata/Makefile metadata/Makefile
index f1d99b243..6c36cd210 100644
--- metadata/Makefile
+++ metadata/Makefile
@@ -6,7 +6,7 @@ top_srcdir		?= ..
 include $(top_srcdir)/include/mk/env_pre.mk
 include $(top_srcdir)/include/mk/functions.mk
 
-MAKE_TARGETS		:= ltp.json
+MAKE_TARGETS		:= ltp.json docparse
 HOST_MAKE_TARGETS	:= metaparse
 INSTALL_DIR		= metadata
 
@@ -21,11 +21,6 @@ ifeq ($(WITH_METADATA),yes)
 	$(MAKE) -C $(abs_top_builddir)/docparse/ -f $(abs_top_srcdir)/docparse/Makefile
 endif
 
-ifeq ($(WITH_METADATA),yes)
-install:
-	$(MAKE) -C $(abs_top_builddir)/docparse/ -f $(abs_top_srcdir)/docparse/Makefile install
-endif
-
 test:
 	$(MAKE) -C $(abs_srcdir)/tests/ test
Cyril Hrubis Nov. 3, 2021, 3:30 p.m. UTC | #7
Hi!
> Changes LGTM (works locally, testing it in CI:
> https://github.com/pevik/ltp/actions/runs/1417208983

And it looks like there is still a mistake, it fails to build the html
and pdf on debian stable and fedora lastest. It looks like the docparse
build wasn't triggered from the metadata directory and I have no idea
why.
Cyril Hrubis Nov. 3, 2021, 3:35 p.m. UTC | #8
Hi!
> > Changes LGTM (works locally, testing it in CI:
> > https://github.com/pevik/ltp/actions/runs/1417208983
> Failed :(.
> 
> Reproducible locally:
> make -C "metadata" \
> 	-f "/home/pvorel/install/src/ltp.git/metadata/Makefile" install
> make[1]: Entering directory '/home/pvorel/install/src/ltp.git/metadata'
> make -C /home/pvorel/install/src/ltp.git/docparse/ -f /home/pvorel/install/src/ltp.git/docparse/Makefile install
> make[2]: Entering directory '/home/pvorel/install/src/ltp.git/docparse'
> install -m 00775   "/home/pvorel/install/src/ltp.git/docparse/metadata.html" /opt/ltp/metadata/metadata.html
> install: cannot stat '/home/pvorel/install/src/ltp.git/docparse/metadata.html': No such file or directory
> make[2]: *** [../include/mk/env_post.mk:85: /opt/ltp/metadata/metadata.html] Error 1
> make[2]: Leaving directory '/home/pvorel/install/src/ltp.git/docparse'
> make[1]: *** [/home/pvorel/install/src/ltp.git/metadata/Makefile:26: install] Error 2
> make[1]: Leaving directory '/home/pvorel/install/src/ltp.git/metadata'
> make: *** [Makefile:138: metadata-install] Error 2
> 
> Maybe I wrongly applied your patch, could you please have a look?

As far as I can tell this just means that the html wasn't build at all,
at least that's what was shown by the CI.

> Kind regards,
> Petr
> 
> diff --git metadata/Makefile metadata/Makefile
> index f1d99b243..6c36cd210 100644
> --- metadata/Makefile
> +++ metadata/Makefile
> @@ -6,7 +6,7 @@ top_srcdir		?= ..
>  include $(top_srcdir)/include/mk/env_pre.mk
>  include $(top_srcdir)/include/mk/functions.mk
>  
> -MAKE_TARGETS		:= ltp.json
> +MAKE_TARGETS		:= ltp.json docparse
>  HOST_MAKE_TARGETS	:= metaparse
>  INSTALL_DIR		= metadata

I guess that this is the revese diff.

> @@ -21,11 +21,6 @@ ifeq ($(WITH_METADATA),yes)
>  	$(MAKE) -C $(abs_top_builddir)/docparse/ -f $(abs_top_srcdir)/docparse/Makefile
>  endif

This part is likely wrong, it should look like:

ltp.json: metaparse
        $(abs_srcdir)/parse.sh > ltp.json
ifeq ($(WITH_METADATA),yes)
        mkdir -p $(abs_top_builddir)/docparse
        $(MAKE) -C $(abs_top_builddir)/docparse/ -f $(abs_top_srcdir)/docparse/Makefile
endif

So that in the case that WITH_METADATA is set the rule has three lines
not one.

And that would explain why the html wasn't build since there was a
docparse rule but nothing refrenced it.
Cyril Hrubis Nov. 4, 2021, 1:10 p.m. UTC | #9
Hi!
And I did a CI run with the correct version at:

https://github.com/metan-ucw/ltp/actions/runs/1421302973
Petr Vorel Nov. 4, 2021, 7:40 p.m. UTC | #10
> Hi!
> And I did a CI run with the correct version at:

> https://github.com/metan-ucw/ltp/actions/runs/1421302973
Thanks!

Reviewed-by: Petr Vorel <pvorel@suse.cz>

I'd still appreciate make in docparse/ directory could somehow resolve missing
dependency, but I can live without it as it's obviously meant to run make only
in metadata/ directory.

$ cd docparse/
$ make
make: *** No rule to make target 'ltp/metadata/ltp.json', needed by 'txt'.  Stop.
[2] Čt lis 04 20:34 W ltp/docparse (metan/docparse-improvements.v4.fixes) $ cd ../metadata/

$ make
HOSTCC metadata/metaparse
ltp/metadata/parse.sh > ltp.json
mkdir -p ltp/docparse
make -C ltp/docparse/ -f ltp/docparse/Makefile
make[1]: Entering directory 'ltp/docparse'
ltp/docparse/testinfo.pl ltp/metadata/ltp.json
INFO: using '../linux' as LINUX_GIT repository
WARN: $LINUX_STABLE_GIT does not exit ('../linux-stable')
INFO: using '../glibc' as GLIBC_GIT repository
asciidoctor -d book metadata.txt -b xhtml
make[1]: Leaving directory 'ltp/docparse'

Kind regards,
Petr
Cyril Hrubis Nov. 5, 2021, 10:19 a.m. UTC | #11
Hi!
> I'd still appreciate make in docparse/ directory could somehow resolve missing
> dependency, but I can live without it as it's obviously meant to run make only
> in metadata/ directory.

The problem is that if we add any way how to trigger the ltp.json build
from the metadata directory it will crash and burn when parallel build
is invoked from the top level directory.

We would have to explain the dependency in the top level Makefile as
well as in the docparse/Makefile. Which would be complicated and error
prone.
Petr Vorel Nov. 5, 2021, 11:09 a.m. UTC | #12
> Hi!
> > I'd still appreciate make in docparse/ directory could somehow resolve missing
> > dependency, but I can live without it as it's obviously meant to run make only
> > in metadata/ directory.

> The problem is that if we add any way how to trigger the ltp.json build
> from the metadata directory it will crash and burn when parallel build
> is invoked from the top level directory.

> We would have to explain the dependency in the top level Makefile as
> well as in the docparse/Makefile. Which would be complicated and error
> prone.

Thanks for info, agree to avoid it.

Kind regards,
Petr
diff mbox series

Patch

diff --git a/Makefile b/Makefile
index 4e37362f9..63010d531 100644
--- a/Makefile
+++ b/Makefile
@@ -62,10 +62,7 @@  $(1):: | $$(abs_top_builddir)/$$(basename $$(subst -,.,$(1)))
 endif
 endef
 
-COMMON_TARGETS		+= testcases tools
-ifeq ($(WITH_METADATA),yes)
-COMMON_TARGETS		+= docparse
-endif
+COMMON_TARGETS		+= testcases tools metadata
 
 # Don't want to nuke the original files if we're installing in-build-tree.
 ifneq ($(BUILD_TREE_STATE),$(BUILD_TREE_SRCDIR_INSTALL))
diff --git a/docparse/.gitignore b/docparse/.gitignore
index 7a87b4234..d786a4762 100644
--- a/docparse/.gitignore
+++ b/docparse/.gitignore
@@ -1,7 +1,5 @@ 
 /*.txt
 /docbook-xsl.css
-/docparse
-/metadata.json
 /metadata.html
 /metadata.pdf
 /metadata.chunked/
diff --git a/docparse/Makefile b/docparse/Makefile
index e2defad38..e6e9f05ba 100644
--- a/docparse/Makefile
+++ b/docparse/Makefile
@@ -29,7 +29,6 @@  METADATA_GENERATOR_PARAMS += -v
 endif
 
 CLEAN_TARGETS		:= *.css *.js *.txt
-MAKE_TARGETS		:= metadata.json
 
 ifeq ($(WITH_METADATA_HTML),yes)
 MAKE_TARGETS		+= metadata.html
@@ -42,8 +41,6 @@  ifeq ($(WITH_METADATA_PDF),yes)
 MAKE_TARGETS		+= metadata.pdf
 endif
 
-HOST_MAKE_TARGETS	:= docparse
-
 INSTALL_DIR = metadata
 INSTALL_TARGETS = *.css *.js
 
@@ -51,13 +48,8 @@  ifndef METADATA_GENERATOR
 METADATA_GENERATOR := asciidoctor
 endif
 
-.PHONY: metadata.json
-
-metadata.json: docparse
-	$(abs_srcdir)/parse.sh > metadata.json
-
-txt: metadata.json
-	$(abs_srcdir)/testinfo.pl metadata.json
+txt: ${abs_top_builddir}/metadata/ltp.json
+	$(abs_srcdir)/testinfo.pl $<
 
 ifeq ($(WITH_METADATA_HTML),yes)
 metadata.html: txt
diff --git a/metadata/.gitignore b/metadata/.gitignore
new file mode 100644
index 000000000..07d2fd6ff
--- /dev/null
+++ b/metadata/.gitignore
@@ -0,0 +1,2 @@ 
+metaparse
+ltp.json
diff --git a/metadata/Makefile b/metadata/Makefile
new file mode 100644
index 000000000..6c36cd210
--- /dev/null
+++ b/metadata/Makefile
@@ -0,0 +1,27 @@ 
+# SPDX-License-Identifier: GPL-2.0-or-later
+# Copyright (c) 2020 Cyril Hrubis <chrubis@suse.cz>
+
+top_srcdir		?= ..
+
+include $(top_srcdir)/include/mk/env_pre.mk
+include $(top_srcdir)/include/mk/functions.mk
+
+MAKE_TARGETS		:= ltp.json docparse
+HOST_MAKE_TARGETS	:= metaparse
+INSTALL_DIR		= metadata
+
+.PHONY: ltp.json
+
+ltp.json: metaparse
+	$(abs_srcdir)/parse.sh > ltp.json
+
+docparse: ltp.json
+ifeq ($(WITH_METADATA),yes)
+	mkdir -p $(abs_top_builddir)/docparse
+	$(MAKE) -C $(abs_top_builddir)/docparse/ -f $(abs_top_srcdir)/docparse/Makefile
+endif
+
+test:
+	$(MAKE) -C $(abs_srcdir)/tests/ test
+
+include $(top_srcdir)/include/mk/generic_leaf_target.mk
diff --git a/docparse/data_storage.h b/metadata/data_storage.h
similarity index 100%
rename from docparse/data_storage.h
rename to metadata/data_storage.h
diff --git a/docparse/docparse.c b/metadata/metaparse.c
similarity index 100%
rename from docparse/docparse.c
rename to metadata/metaparse.c
diff --git a/docparse/parse.sh b/metadata/parse.sh
similarity index 91%
rename from docparse/parse.sh
rename to metadata/parse.sh
index 52d9a5cbf..b43d024c6 100755
--- a/docparse/parse.sh
+++ b/metadata/parse.sh
@@ -30,7 +30,7 @@  echo ' "tests": {'
 first=1
 
 for test in `find testcases/ -name '*.c'`; do
-	a=$($top_builddir/docparse/docparse -Iinclude -Itestcases/kernel/syscalls/utils/ "$test")
+	a=$($top_builddir/metadata/metaparse -Iinclude -Itestcases/kernel/syscalls/utils/ "$test")
 	if [ -n "$a" ]; then
 		if [ -z "$first" ]; then
 			echo ','
diff --git a/docparse/tests/Makefile b/metadata/tests/Makefile
similarity index 100%
rename from docparse/tests/Makefile
rename to metadata/tests/Makefile
diff --git a/docparse/tests/array_size01.c b/metadata/tests/array_size01.c
similarity index 100%
rename from docparse/tests/array_size01.c
rename to metadata/tests/array_size01.c
diff --git a/docparse/tests/array_size01.c.json b/metadata/tests/array_size01.c.json
similarity index 100%
rename from docparse/tests/array_size01.c.json
rename to metadata/tests/array_size01.c.json
diff --git a/docparse/tests/array_size02.c b/metadata/tests/array_size02.c
similarity index 100%
rename from docparse/tests/array_size02.c
rename to metadata/tests/array_size02.c
diff --git a/docparse/tests/array_size02.c.json b/metadata/tests/array_size02.c.json
similarity index 100%
rename from docparse/tests/array_size02.c.json
rename to metadata/tests/array_size02.c.json
diff --git a/docparse/tests/array_size03.c b/metadata/tests/array_size03.c
similarity index 100%
rename from docparse/tests/array_size03.c
rename to metadata/tests/array_size03.c
diff --git a/docparse/tests/array_size03.c.json b/metadata/tests/array_size03.c.json
similarity index 100%
rename from docparse/tests/array_size03.c.json
rename to metadata/tests/array_size03.c.json
diff --git a/docparse/tests/array_size04.c b/metadata/tests/array_size04.c
similarity index 100%
rename from docparse/tests/array_size04.c
rename to metadata/tests/array_size04.c
diff --git a/docparse/tests/array_size04.c.json b/metadata/tests/array_size04.c.json
similarity index 100%
rename from docparse/tests/array_size04.c.json
rename to metadata/tests/array_size04.c.json
diff --git a/docparse/tests/empty_struct.c b/metadata/tests/empty_struct.c
similarity index 100%
rename from docparse/tests/empty_struct.c
rename to metadata/tests/empty_struct.c
diff --git a/docparse/tests/empty_struct.c.json b/metadata/tests/empty_struct.c.json
similarity index 100%
rename from docparse/tests/empty_struct.c.json
rename to metadata/tests/empty_struct.c.json
diff --git a/docparse/tests/expand_flags.c b/metadata/tests/expand_flags.c
similarity index 100%
rename from docparse/tests/expand_flags.c
rename to metadata/tests/expand_flags.c
diff --git a/docparse/tests/expand_flags.c.json b/metadata/tests/expand_flags.c.json
similarity index 100%
rename from docparse/tests/expand_flags.c.json
rename to metadata/tests/expand_flags.c.json
diff --git a/docparse/tests/include.c b/metadata/tests/include.c
similarity index 100%
rename from docparse/tests/include.c
rename to metadata/tests/include.c
diff --git a/docparse/tests/include.c.json b/metadata/tests/include.c.json
similarity index 100%
rename from docparse/tests/include.c.json
rename to metadata/tests/include.c.json
diff --git a/docparse/tests/include.h b/metadata/tests/include.h
similarity index 100%
rename from docparse/tests/include.h
rename to metadata/tests/include.h
diff --git a/docparse/tests/macro.c b/metadata/tests/macro.c
similarity index 100%
rename from docparse/tests/macro.c
rename to metadata/tests/macro.c
diff --git a/docparse/tests/macro.c.json b/metadata/tests/macro.c.json
similarity index 100%
rename from docparse/tests/macro.c.json
rename to metadata/tests/macro.c.json
diff --git a/docparse/tests/macro_str.c b/metadata/tests/macro_str.c
similarity index 100%
rename from docparse/tests/macro_str.c
rename to metadata/tests/macro_str.c
diff --git a/docparse/tests/macro_str.c.json b/metadata/tests/macro_str.c.json
similarity index 100%
rename from docparse/tests/macro_str.c.json
rename to metadata/tests/macro_str.c.json
diff --git a/docparse/tests/multiline_macro.c b/metadata/tests/multiline_macro.c
similarity index 100%
rename from docparse/tests/multiline_macro.c
rename to metadata/tests/multiline_macro.c
diff --git a/docparse/tests/multiline_macro.c.json b/metadata/tests/multiline_macro.c.json
similarity index 100%
rename from docparse/tests/multiline_macro.c.json
rename to metadata/tests/multiline_macro.c.json
diff --git a/docparse/tests/tags.c b/metadata/tests/tags.c
similarity index 100%
rename from docparse/tests/tags.c
rename to metadata/tests/tags.c
diff --git a/docparse/tests/tags.c.json b/metadata/tests/tags.c.json
similarity index 100%
rename from docparse/tests/tags.c.json
rename to metadata/tests/tags.c.json
diff --git a/docparse/tests/test.sh b/metadata/tests/test.sh
similarity index 88%
rename from docparse/tests/test.sh
rename to metadata/tests/test.sh
index 767cc464c..c11f0e496 100755
--- a/docparse/tests/test.sh
+++ b/metadata/tests/test.sh
@@ -3,7 +3,7 @@ 
 fail=0
 
 for i in *.c; do
-	../docparse $i > tmp.json
+	../metaparse $i > tmp.json
 	if ! diff tmp.json $i.json &> /dev/null; then
 		echo "***"
 		echo "$i output differs!"