Publishing multiple html files in org: https://orgmode.org/manual/Publishing.html#Publishing
If we assume that your org files reside in ~/tmp, then you can export them in one go with C-c C-e P p after evaluating below definition
(setq org-publish-project-alist
'(
("org-files"
:base-directory "~/tmp"
:base-extension "org"
:publishing-directory "~/tmp/html"
:publishing-function org-html-publish-to-html
)
("example" :components ("org-files"))
)
)
They will be exported to the directory ~/tmp/html.
Alternatively - maybe rethinking your approach - you could importing the content of "test.org" directly into your "example.org" html export with an #+include
directive: https://orgmode.org/manual/Include-files.html.
#+INCLUDE: "test.org"