@abaplint/transpiler-cli 2.7.7 → 2.7.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/bundle.js +283 -52
- package/package.json +4 -4
package/build/bundle.js
CHANGED
|
@@ -17769,7 +17769,7 @@ exports.With = With;
|
|
|
17769
17769
|
"use strict";
|
|
17770
17770
|
|
|
17771
17771
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
17772
|
-
exports.MethodParameterDirection = exports.AttributeLevel = void 0;
|
|
17772
|
+
exports.RiskLevel = exports.Duration = exports.MethodParameterDirection = exports.AttributeLevel = void 0;
|
|
17773
17773
|
// Only helper functions to get data from single file, no type information
|
|
17774
17774
|
var AttributeLevel;
|
|
17775
17775
|
(function (AttributeLevel) {
|
|
@@ -17784,6 +17784,18 @@ var MethodParameterDirection;
|
|
|
17784
17784
|
MethodParameterDirection["Changing"] = "changing";
|
|
17785
17785
|
MethodParameterDirection["Returning"] = "returning";
|
|
17786
17786
|
})(MethodParameterDirection = exports.MethodParameterDirection || (exports.MethodParameterDirection = {}));
|
|
17787
|
+
var Duration;
|
|
17788
|
+
(function (Duration) {
|
|
17789
|
+
Duration["short"] = "SHORT";
|
|
17790
|
+
Duration["medium"] = "MEDIUM";
|
|
17791
|
+
Duration["long"] = "LONG";
|
|
17792
|
+
})(Duration = exports.Duration || (exports.Duration = {}));
|
|
17793
|
+
var RiskLevel;
|
|
17794
|
+
(function (RiskLevel) {
|
|
17795
|
+
RiskLevel["harmless"] = "HARMLESS";
|
|
17796
|
+
RiskLevel["critical"] = "CRITICAL";
|
|
17797
|
+
RiskLevel["dangerous"] = "DANGEROUS";
|
|
17798
|
+
})(RiskLevel = exports.RiskLevel || (exports.RiskLevel = {}));
|
|
17787
17799
|
//# sourceMappingURL=_abap_file_information.js.map
|
|
17788
17800
|
|
|
17789
17801
|
/***/ }),
|
|
@@ -17959,7 +17971,7 @@ class ABAPFileInformation {
|
|
|
17959
17971
|
}
|
|
17960
17972
|
}
|
|
17961
17973
|
parseClasses(structure) {
|
|
17962
|
-
var _a;
|
|
17974
|
+
var _a, _b, _c;
|
|
17963
17975
|
for (const found of structure.findAllStructures(Structures.ClassDefinition)) {
|
|
17964
17976
|
const className = found.findFirstStatement(Statements.ClassDefinition).findFirstExpression(Expressions.ClassName).getFirstToken();
|
|
17965
17977
|
const methods = this.parseMethodDefinition(found.findFirstStructure(Structures.PublicSection), visibility_1.Visibility.Public);
|
|
@@ -17978,6 +17990,8 @@ class ABAPFileInformation {
|
|
|
17978
17990
|
const containsGlobal = found.findFirstExpression(Expressions.ClassGlobal);
|
|
17979
17991
|
const cdef = found.findFirstStatement(Statements.ClassDefinition);
|
|
17980
17992
|
const concat = (cdef === null || cdef === void 0 ? void 0 : cdef.concatTokens().toUpperCase()) || "";
|
|
17993
|
+
const duration = (_b = cdef === null || cdef === void 0 ? void 0 : cdef.findExpressionAfterToken("DURATION")) === null || _b === void 0 ? void 0 : _b.concatTokens().toUpperCase();
|
|
17994
|
+
const riskLevel = (_c = cdef === null || cdef === void 0 ? void 0 : cdef.findExpressionAfterToken("LEVEL")) === null || _c === void 0 ? void 0 : _c.concatTokens().toUpperCase();
|
|
17981
17995
|
this.classes.push({
|
|
17982
17996
|
name: className.getStr(),
|
|
17983
17997
|
identifier: new _identifier_1.Identifier(className, this.filename),
|
|
@@ -17987,6 +18001,8 @@ class ABAPFileInformation {
|
|
|
17987
18001
|
superClassName,
|
|
17988
18002
|
interfaces: this.getImplementing(found),
|
|
17989
18003
|
isForTesting: concat.includes(" FOR TESTING"),
|
|
18004
|
+
duration,
|
|
18005
|
+
riskLevel,
|
|
17990
18006
|
isAbstract: (cdef === null || cdef === void 0 ? void 0 : cdef.findDirectTokenByText("ABSTRACT")) !== undefined,
|
|
17991
18007
|
isSharedMemory: concat.includes(" SHARED MEMORY ENABLED"),
|
|
17992
18008
|
isFinal: found.findFirstExpression(Expressions.ClassFinal) !== undefined,
|
|
@@ -40754,6 +40770,99 @@ exports.AssignmentServiceToAuthorizationGroup = AssignmentServiceToAuthorization
|
|
|
40754
40770
|
|
|
40755
40771
|
/***/ }),
|
|
40756
40772
|
|
|
40773
|
+
/***/ "./node_modules/@abaplint/core/build/src/objects/atc_check_category.js":
|
|
40774
|
+
/*!*****************************************************************************!*\
|
|
40775
|
+
!*** ./node_modules/@abaplint/core/build/src/objects/atc_check_category.js ***!
|
|
40776
|
+
\*****************************************************************************/
|
|
40777
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
40778
|
+
|
|
40779
|
+
"use strict";
|
|
40780
|
+
|
|
40781
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
40782
|
+
exports.ATCCheckCategory = void 0;
|
|
40783
|
+
const _abstract_object_1 = __webpack_require__(/*! ./_abstract_object */ "./node_modules/@abaplint/core/build/src/objects/_abstract_object.js");
|
|
40784
|
+
class ATCCheckCategory extends _abstract_object_1.AbstractObject {
|
|
40785
|
+
getType() {
|
|
40786
|
+
return "CHKC";
|
|
40787
|
+
}
|
|
40788
|
+
getAllowedNaming() {
|
|
40789
|
+
return {
|
|
40790
|
+
maxLength: 30,
|
|
40791
|
+
allowNamespace: true,
|
|
40792
|
+
};
|
|
40793
|
+
}
|
|
40794
|
+
getDescription() {
|
|
40795
|
+
// todo
|
|
40796
|
+
return undefined;
|
|
40797
|
+
}
|
|
40798
|
+
}
|
|
40799
|
+
exports.ATCCheckCategory = ATCCheckCategory;
|
|
40800
|
+
//# sourceMappingURL=atc_check_category.js.map
|
|
40801
|
+
|
|
40802
|
+
/***/ }),
|
|
40803
|
+
|
|
40804
|
+
/***/ "./node_modules/@abaplint/core/build/src/objects/atc_check_object.js":
|
|
40805
|
+
/*!***************************************************************************!*\
|
|
40806
|
+
!*** ./node_modules/@abaplint/core/build/src/objects/atc_check_object.js ***!
|
|
40807
|
+
\***************************************************************************/
|
|
40808
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
40809
|
+
|
|
40810
|
+
"use strict";
|
|
40811
|
+
|
|
40812
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
40813
|
+
exports.ATCCheckObject = void 0;
|
|
40814
|
+
const _abstract_object_1 = __webpack_require__(/*! ./_abstract_object */ "./node_modules/@abaplint/core/build/src/objects/_abstract_object.js");
|
|
40815
|
+
class ATCCheckObject extends _abstract_object_1.AbstractObject {
|
|
40816
|
+
getType() {
|
|
40817
|
+
return "CHKO";
|
|
40818
|
+
}
|
|
40819
|
+
getAllowedNaming() {
|
|
40820
|
+
return {
|
|
40821
|
+
maxLength: 30,
|
|
40822
|
+
allowNamespace: true,
|
|
40823
|
+
};
|
|
40824
|
+
}
|
|
40825
|
+
getDescription() {
|
|
40826
|
+
// todo
|
|
40827
|
+
return undefined;
|
|
40828
|
+
}
|
|
40829
|
+
}
|
|
40830
|
+
exports.ATCCheckObject = ATCCheckObject;
|
|
40831
|
+
//# sourceMappingURL=atc_check_object.js.map
|
|
40832
|
+
|
|
40833
|
+
/***/ }),
|
|
40834
|
+
|
|
40835
|
+
/***/ "./node_modules/@abaplint/core/build/src/objects/atc_check_variant.js":
|
|
40836
|
+
/*!****************************************************************************!*\
|
|
40837
|
+
!*** ./node_modules/@abaplint/core/build/src/objects/atc_check_variant.js ***!
|
|
40838
|
+
\****************************************************************************/
|
|
40839
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
40840
|
+
|
|
40841
|
+
"use strict";
|
|
40842
|
+
|
|
40843
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
40844
|
+
exports.ATCCheckVariant = void 0;
|
|
40845
|
+
const _abstract_object_1 = __webpack_require__(/*! ./_abstract_object */ "./node_modules/@abaplint/core/build/src/objects/_abstract_object.js");
|
|
40846
|
+
class ATCCheckVariant extends _abstract_object_1.AbstractObject {
|
|
40847
|
+
getType() {
|
|
40848
|
+
return "CHKV";
|
|
40849
|
+
}
|
|
40850
|
+
getAllowedNaming() {
|
|
40851
|
+
return {
|
|
40852
|
+
maxLength: 30,
|
|
40853
|
+
allowNamespace: true,
|
|
40854
|
+
};
|
|
40855
|
+
}
|
|
40856
|
+
getDescription() {
|
|
40857
|
+
// todo
|
|
40858
|
+
return undefined;
|
|
40859
|
+
}
|
|
40860
|
+
}
|
|
40861
|
+
exports.ATCCheckVariant = ATCCheckVariant;
|
|
40862
|
+
//# sourceMappingURL=atc_check_variant.js.map
|
|
40863
|
+
|
|
40864
|
+
/***/ }),
|
|
40865
|
+
|
|
40757
40866
|
/***/ "./node_modules/@abaplint/core/build/src/objects/authorization_check_field.js":
|
|
40758
40867
|
/*!************************************************************************************!*\
|
|
40759
40868
|
!*** ./node_modules/@abaplint/core/build/src/objects/authorization_check_field.js ***!
|
|
@@ -43456,6 +43565,9 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
43456
43565
|
__exportStar(__webpack_require__(/*! ./activation_variant */ "./node_modules/@abaplint/core/build/src/objects/activation_variant.js"), exports);
|
|
43457
43566
|
__exportStar(__webpack_require__(/*! ./api_release_state */ "./node_modules/@abaplint/core/build/src/objects/api_release_state.js"), exports);
|
|
43458
43567
|
__exportStar(__webpack_require__(/*! ./assignment_service_to_authorization_group */ "./node_modules/@abaplint/core/build/src/objects/assignment_service_to_authorization_group.js"), exports);
|
|
43568
|
+
__exportStar(__webpack_require__(/*! ./atc_check_category */ "./node_modules/@abaplint/core/build/src/objects/atc_check_category.js"), exports);
|
|
43569
|
+
__exportStar(__webpack_require__(/*! ./atc_check_object */ "./node_modules/@abaplint/core/build/src/objects/atc_check_object.js"), exports);
|
|
43570
|
+
__exportStar(__webpack_require__(/*! ./atc_check_variant */ "./node_modules/@abaplint/core/build/src/objects/atc_check_variant.js"), exports);
|
|
43459
43571
|
__exportStar(__webpack_require__(/*! ./authorization_check_field */ "./node_modules/@abaplint/core/build/src/objects/authorization_check_field.js"), exports);
|
|
43460
43572
|
__exportStar(__webpack_require__(/*! ./authorization_group */ "./node_modules/@abaplint/core/build/src/objects/authorization_group.js"), exports);
|
|
43461
43573
|
__exportStar(__webpack_require__(/*! ./authorization_object_class */ "./node_modules/@abaplint/core/build/src/objects/authorization_object_class.js"), exports);
|
|
@@ -46933,7 +47045,7 @@ class Registry {
|
|
|
46933
47045
|
}
|
|
46934
47046
|
static abaplintVersion() {
|
|
46935
47047
|
// magic, see build script "version.sh"
|
|
46936
|
-
return "2.101.
|
|
47048
|
+
return "2.101.2";
|
|
46937
47049
|
}
|
|
46938
47050
|
getDDICReferences() {
|
|
46939
47051
|
return this.ddicReferences;
|
|
@@ -50127,6 +50239,9 @@ class CloudTypes {
|
|
|
50127
50239
|
|| obj instanceof Objects.InboundService
|
|
50128
50240
|
|| obj instanceof Objects.Interface
|
|
50129
50241
|
|| obj instanceof Objects.LockObject
|
|
50242
|
+
|| obj instanceof Objects.ATCCheckCategory
|
|
50243
|
+
|| obj instanceof Objects.ATCCheckObject
|
|
50244
|
+
|| obj instanceof Objects.ATCCheckVariant
|
|
50130
50245
|
|| obj instanceof Objects.MessageClass
|
|
50131
50246
|
|| obj instanceof Objects.Package
|
|
50132
50247
|
|| obj instanceof Objects.RestrictionType
|
|
@@ -71862,17 +71977,17 @@ class Transpiler {
|
|
|
71862
71977
|
return new Transpiler().run(reg);
|
|
71863
71978
|
}
|
|
71864
71979
|
async run(reg, progress) {
|
|
71865
|
-
var _a, _b, _c, _d, _e
|
|
71980
|
+
var _a, _b, _c, _d, _e;
|
|
71866
71981
|
reg.parse();
|
|
71867
71982
|
new keywords_1.Keywords((_a = this.options) === null || _a === void 0 ? void 0 : _a.keywords).handle(reg);
|
|
71868
71983
|
this.validate(reg);
|
|
71869
71984
|
const dbSetup = new db_1.DatabaseSetup(reg).run(this.options);
|
|
71870
71985
|
const output = {
|
|
71871
71986
|
objects: [],
|
|
71872
|
-
unitTestScript: new unit_test_1.UnitTest().unitTestScript(reg, (_b = this.options) === null || _b === void 0 ? void 0 : _b.skip
|
|
71873
|
-
unitTestScriptOpen: new unit_test_1.UnitTest().unitTestScriptOpen(reg, (
|
|
71874
|
-
initializationScript: new unit_test_1.UnitTest().initializationScript(reg, dbSetup, (
|
|
71875
|
-
initializationScript2: new unit_test_1.UnitTest().initializationScript(reg, dbSetup, (
|
|
71987
|
+
unitTestScript: new unit_test_1.UnitTest().unitTestScript(reg, (_b = this.options) === null || _b === void 0 ? void 0 : _b.skip),
|
|
71988
|
+
unitTestScriptOpen: new unit_test_1.UnitTest().unitTestScriptOpen(reg, (_c = this.options) === null || _c === void 0 ? void 0 : _c.skip),
|
|
71989
|
+
initializationScript: new unit_test_1.UnitTest().initializationScript(reg, dbSetup, (_d = this.options) === null || _d === void 0 ? void 0 : _d.extraSetup),
|
|
71990
|
+
initializationScript2: new unit_test_1.UnitTest().initializationScript(reg, dbSetup, (_e = this.options) === null || _e === void 0 ? void 0 : _e.extraSetup, true),
|
|
71876
71991
|
databaseSetup: dbSetup,
|
|
71877
71992
|
reg: reg,
|
|
71878
71993
|
};
|
|
@@ -79506,7 +79621,7 @@ export async function initializeABAP() {\n`;
|
|
|
79506
79621
|
// ES modules are resolved and cached as URLs. This means that special characters must be percent-encoded, such as # with %23 and ? with %3F.
|
|
79507
79622
|
return filename.replace(/\//g, "%23");
|
|
79508
79623
|
}
|
|
79509
|
-
unitTestScriptOpen(reg, _skip
|
|
79624
|
+
unitTestScriptOpen(reg, _skip) {
|
|
79510
79625
|
let ret = `/* eslint-disable curly */
|
|
79511
79626
|
import fs from "fs";
|
|
79512
79627
|
import path from "path";
|
|
@@ -79561,7 +79676,91 @@ run().then(() => {
|
|
|
79561
79676
|
});`;
|
|
79562
79677
|
return ret;
|
|
79563
79678
|
}
|
|
79564
|
-
|
|
79679
|
+
getSortedTests(reg) {
|
|
79680
|
+
const tests = [];
|
|
79681
|
+
for (const obj of reg.getObjects()) {
|
|
79682
|
+
if (reg.isDependency(obj) || !(obj instanceof abaplint.Objects.Class)) {
|
|
79683
|
+
continue;
|
|
79684
|
+
}
|
|
79685
|
+
const hasTestFile = obj.getFiles().some(f => { return f.getFilename().includes(".testclasses."); });
|
|
79686
|
+
if (hasTestFile === false) {
|
|
79687
|
+
continue;
|
|
79688
|
+
}
|
|
79689
|
+
for (const file of obj.getABAPFiles()) {
|
|
79690
|
+
for (const def of file.getInfo().listClassDefinitions()) {
|
|
79691
|
+
if (def.isForTesting === false
|
|
79692
|
+
|| def.isGlobal === true
|
|
79693
|
+
|| def.methods.length === 0
|
|
79694
|
+
|| def.isAbstract === true) {
|
|
79695
|
+
// todo, fix, there might be global test methods
|
|
79696
|
+
continue;
|
|
79697
|
+
}
|
|
79698
|
+
const methods = [];
|
|
79699
|
+
for (const m of def.methods) {
|
|
79700
|
+
if (m.isForTesting === false) {
|
|
79701
|
+
continue;
|
|
79702
|
+
}
|
|
79703
|
+
methods.push(m.name);
|
|
79704
|
+
}
|
|
79705
|
+
tests.push({
|
|
79706
|
+
obj,
|
|
79707
|
+
localClass: def.name,
|
|
79708
|
+
riskLevel: def.riskLevel,
|
|
79709
|
+
duration: def.duration,
|
|
79710
|
+
methods: methods,
|
|
79711
|
+
});
|
|
79712
|
+
}
|
|
79713
|
+
}
|
|
79714
|
+
}
|
|
79715
|
+
const toNumber = (riskLevel, duration) => {
|
|
79716
|
+
let int = 0;
|
|
79717
|
+
switch (riskLevel) {
|
|
79718
|
+
case abaplint.Info.RiskLevel.harmless:
|
|
79719
|
+
int = 10;
|
|
79720
|
+
break;
|
|
79721
|
+
case abaplint.Info.RiskLevel.critical:
|
|
79722
|
+
int = 20;
|
|
79723
|
+
break;
|
|
79724
|
+
case abaplint.Info.RiskLevel.dangerous:
|
|
79725
|
+
int = 30;
|
|
79726
|
+
break;
|
|
79727
|
+
default:
|
|
79728
|
+
break;
|
|
79729
|
+
}
|
|
79730
|
+
switch (duration) {
|
|
79731
|
+
case abaplint.Info.Duration.short:
|
|
79732
|
+
int += 1;
|
|
79733
|
+
break;
|
|
79734
|
+
case abaplint.Info.Duration.medium:
|
|
79735
|
+
int += 2;
|
|
79736
|
+
break;
|
|
79737
|
+
case abaplint.Info.Duration.long:
|
|
79738
|
+
int += 3;
|
|
79739
|
+
break;
|
|
79740
|
+
default:
|
|
79741
|
+
break;
|
|
79742
|
+
}
|
|
79743
|
+
return int;
|
|
79744
|
+
};
|
|
79745
|
+
tests.sort((a, b) => {
|
|
79746
|
+
const ai = toNumber(a.riskLevel, a.duration);
|
|
79747
|
+
const bi = toNumber(b.riskLevel, b.duration);
|
|
79748
|
+
let ret = ai - bi;
|
|
79749
|
+
if (ret === 0) {
|
|
79750
|
+
// if risk and duration are equal, then sort by name
|
|
79751
|
+
if (a.obj.getName() < b.obj.getName()) {
|
|
79752
|
+
ret = -1;
|
|
79753
|
+
}
|
|
79754
|
+
if (a.obj.getName() > b.obj.getName()) {
|
|
79755
|
+
ret = 1;
|
|
79756
|
+
}
|
|
79757
|
+
ret = 0;
|
|
79758
|
+
}
|
|
79759
|
+
return ret;
|
|
79760
|
+
});
|
|
79761
|
+
return tests;
|
|
79762
|
+
}
|
|
79763
|
+
unitTestScript(reg, skip) {
|
|
79565
79764
|
let ret = `/* eslint-disable curly */
|
|
79566
79765
|
import fs from "fs";
|
|
79567
79766
|
import path from "path";
|
|
@@ -79578,54 +79777,86 @@ async function run() {
|
|
|
79578
79777
|
let locl;
|
|
79579
79778
|
let meth;
|
|
79580
79779
|
try {\n`;
|
|
79581
|
-
for (const
|
|
79582
|
-
if (reg.isDependency(obj) || !(obj instanceof abaplint.Objects.Class)) {
|
|
79583
|
-
continue;
|
|
79584
|
-
}
|
|
79780
|
+
for (const st of this.getSortedTests(reg)) {
|
|
79585
79781
|
ret += `// --------------------------------------------\n`;
|
|
79586
|
-
ret += ` clas = unit.addObject("${obj.getName()}");\n`;
|
|
79587
|
-
|
|
79782
|
+
ret += ` clas = unit.addObject("${st.obj.getName()}");\n`;
|
|
79783
|
+
ret += ` {
|
|
79784
|
+
const {${st.localClass}} = await import("./${this.escapeNamespace(st.obj.getName().toLowerCase())}.${st.obj.getType().toLowerCase()}.testclasses.mjs");
|
|
79785
|
+
locl = clas.addTestClass("${st.localClass}");
|
|
79786
|
+
if (${st.localClass}.class_setup) await ${st.localClass}.class_setup();\n`;
|
|
79787
|
+
for (const m of st.methods) {
|
|
79788
|
+
const skipThis = (skip || []).some(a => a.object === st.obj.getName() && a.class === st.localClass && a.method === m);
|
|
79789
|
+
if (skipThis) {
|
|
79790
|
+
ret += ` console.log('${st.obj.getName()}: running ${st.localClass}->${m}, skipped');\n`;
|
|
79791
|
+
ret += ` meth = locl.addMethod("${m}");\n`;
|
|
79792
|
+
ret += ` meth.skip();\n`;
|
|
79793
|
+
continue;
|
|
79794
|
+
}
|
|
79795
|
+
ret += ` {\n const test = await (new ${st.localClass}()).constructor_();\n`;
|
|
79796
|
+
ret += ` if (test.setup) await test.setup();\n`;
|
|
79797
|
+
ret += ` console.log("${st.obj.getName()}: running ${st.localClass}->${m}");\n`;
|
|
79798
|
+
ret += ` meth = locl.addMethod("${m}");\n`;
|
|
79799
|
+
ret += ` await test.${m}();\n`;
|
|
79800
|
+
ret += ` meth.pass();\n`;
|
|
79801
|
+
ret += ` if (test.teardown) await test.teardown();\n`;
|
|
79802
|
+
ret += ` }\n`;
|
|
79803
|
+
}
|
|
79804
|
+
ret += ` if (${st.localClass}.class_teardown) await ${st.localClass}.class_teardown();\n`;
|
|
79805
|
+
ret += ` }\n`;
|
|
79806
|
+
}
|
|
79807
|
+
/*
|
|
79808
|
+
for (const obj of reg.getObjects()) {
|
|
79809
|
+
if (reg.isDependency(obj) || !(obj instanceof abaplint.Objects.Class)) {
|
|
79810
|
+
continue;
|
|
79811
|
+
}
|
|
79812
|
+
ret += `// --------------------------------------------\n`;
|
|
79813
|
+
ret += ` clas = unit.addObject("${obj.getName()}");\n`;
|
|
79814
|
+
for (const file of obj.getABAPFiles()) {
|
|
79588
79815
|
for (const def of file.getInfo().listClassDefinitions()) {
|
|
79589
|
-
|
|
79590
|
-
|
|
79591
|
-
|
|
79592
|
-
|
|
79593
|
-
|
|
79594
|
-
|
|
79816
|
+
if (def.isForTesting === false
|
|
79817
|
+
|| def.isGlobal === true
|
|
79818
|
+
|| def.methods.length === 0
|
|
79819
|
+
|| def.isAbstract === true) {
|
|
79820
|
+
// todo, fix, there might be global test methods
|
|
79821
|
+
continue;
|
|
79822
|
+
}
|
|
79823
|
+
const hasTestFile = obj.getFiles().some(f => { return f.getFilename().includes(".testclasses."); });
|
|
79824
|
+
if (hasTestFile === false) {
|
|
79825
|
+
break;
|
|
79826
|
+
}
|
|
79827
|
+
ret += ` {
|
|
79828
|
+
const {${def.name}} = await import("./${this.escapeNamespace(obj.getName().toLowerCase())}.${obj.getType().toLowerCase()}.testclasses.mjs");
|
|
79829
|
+
locl = clas.addTestClass("${def.name}");
|
|
79830
|
+
if (${def.name}.class_setup) await ${def.name}.class_setup();\n`;
|
|
79831
|
+
|
|
79832
|
+
for (const m of def.methods) {
|
|
79833
|
+
if (m.isForTesting === false) {
|
|
79834
|
+
continue;
|
|
79595
79835
|
}
|
|
79596
|
-
const
|
|
79597
|
-
if (
|
|
79598
|
-
|
|
79836
|
+
const skipThis = (skip || []).some(a => a.object === obj.getName() && a.class === def.name && a.method === m.name);
|
|
79837
|
+
if (skipThis) {
|
|
79838
|
+
ret += ` console.log('${obj.getName()}: running ${def.name}->${m.name}, skipped');\n`;
|
|
79839
|
+
ret += ` meth = locl.addMethod("${m.name}");\n`;
|
|
79840
|
+
ret += ` meth.skip();\n`;
|
|
79841
|
+
continue;
|
|
79599
79842
|
}
|
|
79600
|
-
|
|
79601
|
-
const
|
|
79602
|
-
|
|
79603
|
-
|
|
79604
|
-
|
|
79605
|
-
|
|
79606
|
-
|
|
79607
|
-
|
|
79608
|
-
|
|
79609
|
-
|
|
79610
|
-
|
|
79611
|
-
|
|
79612
|
-
|
|
79613
|
-
continue;
|
|
79614
|
-
}
|
|
79615
|
-
ret += ` {\n const test = await (new ${def.name}()).constructor_();\n`;
|
|
79616
|
-
ret += ` if (test.setup) await test.setup();\n`;
|
|
79617
|
-
ret += ` console.log("${obj.getName()}: running ${def.name}->${m.name}");\n`;
|
|
79618
|
-
ret += ` meth = locl.addMethod("${m.name}");\n`;
|
|
79619
|
-
ret += ` await test.${m.name}();\n`;
|
|
79620
|
-
ret += ` meth.pass();\n`;
|
|
79621
|
-
ret += ` if (test.teardown) await test.teardown();\n`;
|
|
79622
|
-
ret += ` }\n`;
|
|
79623
|
-
}
|
|
79624
|
-
ret += ` if (${def.name}.class_teardown) await ${def.name}.class_teardown();\n`;
|
|
79625
|
-
ret += ` }\n`;
|
|
79843
|
+
|
|
79844
|
+
ret += ` {\n const test = await (new ${def.name}()).constructor_();\n`;
|
|
79845
|
+
ret += ` if (test.setup) await test.setup();\n`;
|
|
79846
|
+
ret += ` console.log("${obj.getName()}: running ${def.name}->${m.name}");\n`;
|
|
79847
|
+
ret += ` meth = locl.addMethod("${m.name}");\n`;
|
|
79848
|
+
ret += ` await test.${m.name}();\n`;
|
|
79849
|
+
ret += ` meth.pass();\n`;
|
|
79850
|
+
ret += ` if (test.teardown) await test.teardown();\n`;
|
|
79851
|
+
ret += ` }\n`;
|
|
79852
|
+
}
|
|
79853
|
+
|
|
79854
|
+
ret += ` if (${def.name}.class_teardown) await ${def.name}.class_teardown();\n`;
|
|
79855
|
+
ret += ` }\n`;
|
|
79626
79856
|
}
|
|
79857
|
+
}
|
|
79627
79858
|
}
|
|
79628
|
-
|
|
79859
|
+
*/
|
|
79629
79860
|
ret += `// -------------------END-------------------
|
|
79630
79861
|
fs.writeFileSync(__dirname + path.sep + "_output.xml", unit.xUnitXML());
|
|
79631
79862
|
} catch (e) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/transpiler-cli",
|
|
3
|
-
"version": "2.7.
|
|
3
|
+
"version": "2.7.8",
|
|
4
4
|
"description": "Transpiler - Command Line Interface",
|
|
5
5
|
"funding": "https://github.com/sponsors/larshp",
|
|
6
6
|
"bin": {
|
|
@@ -26,12 +26,12 @@
|
|
|
26
26
|
"author": "abaplint",
|
|
27
27
|
"license": "MIT",
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"@abaplint/transpiler": "^2.7.
|
|
29
|
+
"@abaplint/transpiler": "^2.7.8",
|
|
30
30
|
"@types/glob": "^7.2.0",
|
|
31
31
|
"glob": "=7.2.0",
|
|
32
32
|
"@types/progress": "^2.0.5",
|
|
33
|
-
"@types/node": "^20.2.
|
|
34
|
-
"@abaplint/core": "^2.101.
|
|
33
|
+
"@types/node": "^20.2.3",
|
|
34
|
+
"@abaplint/core": "^2.101.2",
|
|
35
35
|
"progress": "^2.0.3",
|
|
36
36
|
"webpack": "^5.83.1",
|
|
37
37
|
"webpack-cli": "^5.1.1",
|