👷 add test for documentation

This commit is contained in:
Niels Lohmann 2022-07-29 07:40:39 +02:00
parent 0e25bfde65
commit 50b891e009
No known key found for this signature in database
GPG Key ID: 7F3CEA63AE251B69
2 changed files with 4 additions and 4 deletions

View File

@ -11,13 +11,13 @@ EXAMPLES = $(wildcard examples/*.cpp)
# create output from a stand-alone example file
%.output: %.cpp
make $(<:.cpp=) CPPFLAGS="-I $(SRCDIR)" CXXFLAGS="-std=c++11"
$(MAKE) $(<:.cpp=) CPPFLAGS="-I $(SRCDIR)" CXXFLAGS="-std=c++11"
./$(<:.cpp=) > $@
rm $(<:.cpp=)
# compare created output with current output of the example files
%.test: %.cpp
make $(<:.cpp=) CPPFLAGS="-I $(SRCDIR)" CXXFLAGS="-std=c++11"
$(MAKE) $(<:.cpp=) CPPFLAGS="-I $(SRCDIR)" CXXFLAGS="-std=c++11"
./$(<:.cpp=) > $@
diff $@ $(<:.cpp=.output)
rm $(<:.cpp=) $@
@ -29,7 +29,7 @@ create_output: $(EXAMPLES:.cpp=.output)
check_output: $(EXAMPLES:.cpp=.test)
# check output of all stand-alone example files (exclude meta which is dependent on the current compiler)
check_output_portable: $(filter-out examples/meta.test,$(EXAMPLES:.cpp=.test))
check_output_portable: $(filter-out examples/meta.test examples/max_size.test examples/std_hash.test,$(EXAMPLES:.cpp=.test))
clean:
rm -fr $(EXAMPLES:.cpp=)

View File

@ -30,5 +30,5 @@ int main()
doc.patch_inplace(patch);
// output patched document
std::cout << "After\n" << std::setw(4) << doc << std::endl;
std::cout << "\nAfter\n" << std::setw(4) << doc << std::endl;
}