Minimum Viable Architecture
  • Book
  • Big Ideas
  • Chief Analytics Officer
  • Contact
  • Book
  • Big Ideas
  • Chief Analytics Officer
  • Contact

​Things under the covers

Bits and pieces of the big ideas

Simple makefile tests

9/10/2021

0 Comments

 
Getting a handle on testing requires you become comfortable writing test. The place to start is with the simplest test you can think of. Even though Make will notify you if a file is missing, learning how to write these simple test and to format useful output is a valuable skill to practice.
Helper variable for a timestamp:
​DTS = $(shell date +%Y-%m-%dT%H:%M:%S-%Z)
Test for a directory:
define test_dir
    # tests the directory in the <first dependency>
    if ! test -d $<; \
    then echo $(DTS)    [FAIL] - $< does not exist; \
    else true; fi
endef

ROOTDIR := $(shell pwd)
​
ROOTDIR: $(ROOTDIR)
    @$(test_dir)

Read More
0 Comments
    Picture

    Brian McMillan

    Sweating the details and still looking at the big picture.

    Archives

    September 2021
    November 2015

    Categories

    All
    Policies

    RSS Feed

© COPYRIGHT 2015-2022. ALL RIGHTS RESERVED.