1
0
mirror of https://github.com/sasjs/core.git synced 2025-12-11 06:24:35 +00:00

fix: adding support for testsetup and testteardown in mf_getapploc.sas

This commit is contained in:
munja
2022-02-05 21:19:26 +01:00
parent e40234ee29
commit 2fe7fba79b
3 changed files with 30 additions and 4 deletions

View File

@@ -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;

View File

@@ -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;

View File

@@ -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
)