diff --git a/all.sas b/all.sas index f36957a..0f36f30 100644 --- a/all.sas +++ b/all.sas @@ -352,6 +352,7 @@ https://github.com/yabwon/SAS_PACKAGES/blob/main/packages/baseplus.md#functionex @li /data @li /jobs @li /services + @li /tests @li /tests/jobs @li /tests/services @li /tests/macros @@ -383,9 +384,13 @@ https://github.com/yabwon/SAS_PACKAGES/blob/main/packages/baseplus.md#functionex /** * First check we are not in the tests/macros folder (which has no subfolders) + * or specifically in the testsetup or testteardown services */ -%if %index(&pgm,/tests/macros/) %then %do; - %let root=%substr(&pgm,1,%index(&pgm,/tests/macros)-1); +%if %index(&pgm,/tests/macros/) +or %index(&pgm,/tests/testsetup) +or %index(&pgm,/tests/testteardown) +%then %do; + %let root=%substr(&pgm,1,%index(&pgm,/tests)-1); &root %return; %end; diff --git a/base/mf_getapploc.sas b/base/mf_getapploc.sas index 1f3cbcf..101b3a1 100644 --- a/base/mf_getapploc.sas +++ b/base/mf_getapploc.sas @@ -15,6 +15,7 @@ @li /data @li /jobs @li /services + @li /tests @li /tests/jobs @li /tests/services @li /tests/macros @@ -46,9 +47,13 @@ /** * First check we are not in the tests/macros folder (which has no subfolders) + * or specifically in the testsetup or testteardown services */ -%if %index(&pgm,/tests/macros/) %then %do; - %let root=%substr(&pgm,1,%index(&pgm,/tests/macros)-1); +%if %index(&pgm,/tests/macros/) +or %index(&pgm,/tests/testsetup) +or %index(&pgm,/tests/testteardown) +%then %do; + %let root=%substr(&pgm,1,%index(&pgm,/tests)-1); &root %return; %end; diff --git a/tests/crossplatform/mf_getapploc.test.sas b/tests/crossplatform/mf_getapploc.test.sas index 4dbd598..4bd479f 100644 --- a/tests/crossplatform/mf_getapploc.test.sas +++ b/tests/crossplatform/mf_getapploc.test.sas @@ -46,4 +46,20 @@ ), desc=Checking tests/macros appLoc matches (which has no subfolder), outds=work.test_results +) + +%mp_assert( + iftrue=( + "%mf_getapploc(/some/area/tests/testsetup)"="/some/area" + ), + desc=Checking tests/testsetup operation, + outds=work.test_results +) + +%mp_assert( + iftrue=( + "%mf_getapploc(/some/area/tests/testteardown)"="/some/area" + ), + desc=Checking tests/teardown operation, + outds=work.test_results ) \ No newline at end of file