fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
1.2 KiB32 linesraw
1include ../tools.mk
2
3OUTPUT_DIR := "$(TMPDIR)/rustdoc"
4TMP_OUTPUT_DIR := "$(TMPDIR)/tmp-rustdoc"
5
6all:
7	# Generate html docs
8	$(RUSTDOC) src/lib.rs --crate-name foobar --crate-type lib --out-dir $(OUTPUT_DIR)
9
10	# Copy first output for to check if it's exactly same after second compilation
11	cp -R $(OUTPUT_DIR) $(TMP_OUTPUT_DIR)
12
13	# Generate html docs once again on same output
14	$(RUSTDOC) src/lib.rs --crate-name foobar --crate-type lib --out-dir $(OUTPUT_DIR)
15
16	# Check if everything exactly same
17	$(DIFF) -r $(OUTPUT_DIR) $(TMP_OUTPUT_DIR)
18
19	# Generate json doc on the same output
20	$(RUSTDOC) src/lib.rs --crate-name foobar --crate-type lib --out-dir $(OUTPUT_DIR) -Z unstable-options --output-format json
21
22	# Check if expected json file is generated
23	[ -e $(OUTPUT_DIR)/foobar.json ]
24
25	# Copy first json output to check if it's exactly same after second compilation
26	cp -R $(OUTPUT_DIR)/foobar.json $(TMP_OUTPUT_DIR)/foobar.json
27
28	# Generate json doc on the same output
29	$(RUSTDOC) src/lib.rs --crate-name foobar --crate-type lib --out-dir $(OUTPUT_DIR) -Z unstable-options --output-format json
30
31	# Check if all docs(including both json and html formats) are still the same after multiple compilations
32	$(DIFF) -r $(OUTPUT_DIR) $(TMP_OUTPUT_DIR)