448
448
##########################################################################
450
# BOM_MD comparison routines
453
# used to remove things like creation date from BOM_MD files
458
/^Date:/ {print "Date: today"; next}
459
/^Author:/ {print "Author: PCB"; next}
464
# top level function to compare BOM_MD output
468
compare_check "compare_bom_md" "$f1" "$f2" || return 1
470
# an example BOM_MD file is:
472
# # PCB Bill Of Materials MarkDown Version 1.0
474
# Date: zo 28 feb 2021 12:13:41 GMT UTC
476
# Author: Bert Timmerman
478
# Title: Basic BOM/XY Test
480
# | Quantity | Description | Value | RefDes |
481
# |----------|-------------|-------|--------|
482
# | 8 | Standard SMT resistor, capacitor etc | RESC3216N | R0_BOT R90_BOT R180_BOT R270_BOT R0_TOP R270_TOP R180_TOP R90_TOP |
483
# | 8 | Small outline package, narrow (150mil) | SO8 | USO0_BOT USO90_BOT USO180_BOT USO270_BOT USO0_TOP USO270_TOP USO180_TOP USO90_TOP |
484
# | 8 | Dual in-line package, narrow (300 mil) | DIP8 | UDIP0_BOT UDIP90_BOT UDIP180_BOT UDIP270_BOT UDIP0_TOP UDIP270_TOP UDIP180_TOP UDIP90_TOP |
486
# For comparison, we need to ignore changes in the Date and Author lines.
487
local cf1=${tmpd}/`basename $f1`-ref
488
local cf2=${tmpd}/`basename $f2`-out
490
normalize_bom_md $f1 $cf1
491
normalize_bom_md $f2 $cf2
492
run_diff $cf1 $cf2 || test_failed=yes
495
##########################################################################
450
497
# GCODE comparison routines