From 8214efdfcb9f921c6db9e422af62cdaa73f03ded Mon Sep 17 00:00:00 2001 From: Tom Alexander Date: Wed, 19 Apr 2023 16:15:58 -0400 Subject: [PATCH] Make the integration test script work from anywhere. --- org_mode_samples/property_drawer/Makefile | 23 +++++++++++++++++++ .../property_drawer/zeroth_section.org | 8 +++++++ .../zeroth_section_spaces_after_comment.org | 12 ++++++++++ scripts/run_integration_test.bash | 6 ++--- 4 files changed, 45 insertions(+), 4 deletions(-) create mode 100644 org_mode_samples/property_drawer/Makefile create mode 100644 org_mode_samples/property_drawer/zeroth_section.org create mode 100644 org_mode_samples/property_drawer/zeroth_section_spaces_after_comment.org diff --git a/org_mode_samples/property_drawer/Makefile b/org_mode_samples/property_drawer/Makefile new file mode 100644 index 00000000..c47a86c1 --- /dev/null +++ b/org_mode_samples/property_drawer/Makefile @@ -0,0 +1,23 @@ +SHELL := bash +.ONESHELL: +.SHELLFLAGS := -eu -o pipefail -c +.DELETE_ON_ERROR: +MAKEFLAGS += --warn-undefined-variables +MAKEFLAGS += --no-builtin-rules +SRCFILES := $(wildcard *.org) +OUTFILES := $(patsubst %.org,%.tree.txt,$(SRCFILES)) + +ifeq ($(origin .RECIPEPREFIX), undefined) + $(error This Make does not support .RECIPEPREFIX. Please use GNU Make 4.0 or later) +endif +.RECIPEPREFIX = > + +.PHONY: all +all: $(OUTFILES) + +.PHONY: clean +clean: +> rm -rf $(OUTFILES) + +%.tree.txt: %.org ../common.el ../dump_org_ast.bash +> ../dump_org_ast.bash $< $@ diff --git a/org_mode_samples/property_drawer/zeroth_section.org b/org_mode_samples/property_drawer/zeroth_section.org new file mode 100644 index 00000000..ccdae6fa --- /dev/null +++ b/org_mode_samples/property_drawer/zeroth_section.org @@ -0,0 +1,8 @@ + + + + +# Blank lines and comments can come before property drawers in the zeroth section +:PROPERTIES: +:FOO: bar +:END: diff --git a/org_mode_samples/property_drawer/zeroth_section_spaces_after_comment.org b/org_mode_samples/property_drawer/zeroth_section_spaces_after_comment.org new file mode 100644 index 00000000..e432ad0b --- /dev/null +++ b/org_mode_samples/property_drawer/zeroth_section_spaces_after_comment.org @@ -0,0 +1,12 @@ + + + + +# Blank lines and comments can come before property drawers in the zeroth section + + + + +:PROPERTIES: +:FOO: bar +:END: diff --git a/scripts/run_integration_test.bash b/scripts/run_integration_test.bash index 9b19ecc3..f1feb0f1 100755 --- a/scripts/run_integration_test.bash +++ b/scripts/run_integration_test.bash @@ -4,9 +4,7 @@ set -euo pipefail IFS=$'\n\t' DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -cd "$DIR/../" - -samples_dir=$(readlink -f "org_mode_samples") +samples_dir=$(readlink -f "$DIR/../org_mode_samples") function get_test_names { for test_file in "$@" @@ -23,5 +21,5 @@ function get_test_names { } get_test_names "$@" | while read test; do - cargo test --no-fail-fast --test test_loader "$test" + (cd "$DIR/../" && cargo test --no-fail-fast --test test_loader "$test") done