Skip to content

Commit

Permalink
Add CI step to verify global names
Browse files Browse the repository at this point in the history
  • Loading branch information
dspinellis committed Mar 31, 2024
1 parent 5482eb7 commit 92348ec
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,8 @@ jobs:
- name: Unit test
run: make -C src unit-test

- name: Global name verification
run: make -C src verify-global-defs

- name: End-to-end test
run: make -C src e2e-test
6 changes: 6 additions & 0 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,12 @@ rl_driver: rl_driver.c
$(SHARED_LIB): $(RL_SRC)
$(CC) $(SHARED_FLAGS) $(CFLAGS) $(LDFLAGS) $(RL_SRC) -o $@ -ldl $(SHARED_LIB_LIB)

verify-global-defs: # Help: Verify prefix of globally visible definitions
$(CC) $(SHARED_FLAGS) $(CFLAGS) $(LDFLAGS) $(RL_SRC) -c
# Check that global not undefined (U) definitions are prefixed
# The output (grep success) signifies unprefixed global defs
! nm *.o | sed 's/^ /x/' | awk '$$2 ~ /[A-TVZ]/ {print $$3}' | grep -Ev '^(acl|ini|curl)'

e2e-run: $(PROGS) # Help: Invoke the library with a readline read/print loop
$(PRELOAD_VAR)=`pwd`/$(SHARED_LIB) $(SET_ADD_LIB) ./rl_driver

Expand Down

0 comments on commit 92348ec

Please sign in to comment.