@abaplint/transpiler-cli 2.7.7 → 2.7.9
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 +299 -51
- 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
|
/***/ }),
|
|
@@ -17978,6 +17990,26 @@ 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
|
+
let riskLevel;
|
|
17994
|
+
if (concat.includes("RISK LEVEL CRITICAL")) {
|
|
17995
|
+
riskLevel = _abap_file_information_1.RiskLevel.critical;
|
|
17996
|
+
}
|
|
17997
|
+
else if (concat.includes("RISK LEVEL DANGEROUS")) {
|
|
17998
|
+
riskLevel = _abap_file_information_1.RiskLevel.dangerous;
|
|
17999
|
+
}
|
|
18000
|
+
else if (concat.includes("RISK LEVEL HARMLESS")) {
|
|
18001
|
+
riskLevel = _abap_file_information_1.RiskLevel.harmless;
|
|
18002
|
+
}
|
|
18003
|
+
let duration;
|
|
18004
|
+
if (concat.includes("DURATION SHORT")) {
|
|
18005
|
+
duration = _abap_file_information_1.Duration.short;
|
|
18006
|
+
}
|
|
18007
|
+
else if (concat.includes("DURATION LONG")) {
|
|
18008
|
+
duration = _abap_file_information_1.Duration.long;
|
|
18009
|
+
}
|
|
18010
|
+
else if (concat.includes("DURATION MEDIUM")) {
|
|
18011
|
+
duration = _abap_file_information_1.Duration.medium;
|
|
18012
|
+
}
|
|
17981
18013
|
this.classes.push({
|
|
17982
18014
|
name: className.getStr(),
|
|
17983
18015
|
identifier: new _identifier_1.Identifier(className, this.filename),
|
|
@@ -17987,6 +18019,8 @@ class ABAPFileInformation {
|
|
|
17987
18019
|
superClassName,
|
|
17988
18020
|
interfaces: this.getImplementing(found),
|
|
17989
18021
|
isForTesting: concat.includes(" FOR TESTING"),
|
|
18022
|
+
duration,
|
|
18023
|
+
riskLevel,
|
|
17990
18024
|
isAbstract: (cdef === null || cdef === void 0 ? void 0 : cdef.findDirectTokenByText("ABSTRACT")) !== undefined,
|
|
17991
18025
|
isSharedMemory: concat.includes(" SHARED MEMORY ENABLED"),
|
|
17992
18026
|
isFinal: found.findFirstExpression(Expressions.ClassFinal) !== undefined,
|
|
@@ -40754,6 +40788,99 @@ exports.AssignmentServiceToAuthorizationGroup = AssignmentServiceToAuthorization
|
|
|
40754
40788
|
|
|
40755
40789
|
/***/ }),
|
|
40756
40790
|
|
|
40791
|
+
/***/ "./node_modules/@abaplint/core/build/src/objects/atc_check_category.js":
|
|
40792
|
+
/*!*****************************************************************************!*\
|
|
40793
|
+
!*** ./node_modules/@abaplint/core/build/src/objects/atc_check_category.js ***!
|
|
40794
|
+
\*****************************************************************************/
|
|
40795
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
40796
|
+
|
|
40797
|
+
"use strict";
|
|
40798
|
+
|
|
40799
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
40800
|
+
exports.ATCCheckCategory = void 0;
|
|
40801
|
+
const _abstract_object_1 = __webpack_require__(/*! ./_abstract_object */ "./node_modules/@abaplint/core/build/src/objects/_abstract_object.js");
|
|
40802
|
+
class ATCCheckCategory extends _abstract_object_1.AbstractObject {
|
|
40803
|
+
getType() {
|
|
40804
|
+
return "CHKC";
|
|
40805
|
+
}
|
|
40806
|
+
getAllowedNaming() {
|
|
40807
|
+
return {
|
|
40808
|
+
maxLength: 30,
|
|
40809
|
+
allowNamespace: true,
|
|
40810
|
+
};
|
|
40811
|
+
}
|
|
40812
|
+
getDescription() {
|
|
40813
|
+
// todo
|
|
40814
|
+
return undefined;
|
|
40815
|
+
}
|
|
40816
|
+
}
|
|
40817
|
+
exports.ATCCheckCategory = ATCCheckCategory;
|
|
40818
|
+
//# sourceMappingURL=atc_check_category.js.map
|
|
40819
|
+
|
|
40820
|
+
/***/ }),
|
|
40821
|
+
|
|
40822
|
+
/***/ "./node_modules/@abaplint/core/build/src/objects/atc_check_object.js":
|
|
40823
|
+
/*!***************************************************************************!*\
|
|
40824
|
+
!*** ./node_modules/@abaplint/core/build/src/objects/atc_check_object.js ***!
|
|
40825
|
+
\***************************************************************************/
|
|
40826
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
40827
|
+
|
|
40828
|
+
"use strict";
|
|
40829
|
+
|
|
40830
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
40831
|
+
exports.ATCCheckObject = void 0;
|
|
40832
|
+
const _abstract_object_1 = __webpack_require__(/*! ./_abstract_object */ "./node_modules/@abaplint/core/build/src/objects/_abstract_object.js");
|
|
40833
|
+
class ATCCheckObject extends _abstract_object_1.AbstractObject {
|
|
40834
|
+
getType() {
|
|
40835
|
+
return "CHKO";
|
|
40836
|
+
}
|
|
40837
|
+
getAllowedNaming() {
|
|
40838
|
+
return {
|
|
40839
|
+
maxLength: 30,
|
|
40840
|
+
allowNamespace: true,
|
|
40841
|
+
};
|
|
40842
|
+
}
|
|
40843
|
+
getDescription() {
|
|
40844
|
+
// todo
|
|
40845
|
+
return undefined;
|
|
40846
|
+
}
|
|
40847
|
+
}
|
|
40848
|
+
exports.ATCCheckObject = ATCCheckObject;
|
|
40849
|
+
//# sourceMappingURL=atc_check_object.js.map
|
|
40850
|
+
|
|
40851
|
+
/***/ }),
|
|
40852
|
+
|
|
40853
|
+
/***/ "./node_modules/@abaplint/core/build/src/objects/atc_check_variant.js":
|
|
40854
|
+
/*!****************************************************************************!*\
|
|
40855
|
+
!*** ./node_modules/@abaplint/core/build/src/objects/atc_check_variant.js ***!
|
|
40856
|
+
\****************************************************************************/
|
|
40857
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
40858
|
+
|
|
40859
|
+
"use strict";
|
|
40860
|
+
|
|
40861
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
40862
|
+
exports.ATCCheckVariant = void 0;
|
|
40863
|
+
const _abstract_object_1 = __webpack_require__(/*! ./_abstract_object */ "./node_modules/@abaplint/core/build/src/objects/_abstract_object.js");
|
|
40864
|
+
class ATCCheckVariant extends _abstract_object_1.AbstractObject {
|
|
40865
|
+
getType() {
|
|
40866
|
+
return "CHKV";
|
|
40867
|
+
}
|
|
40868
|
+
getAllowedNaming() {
|
|
40869
|
+
return {
|
|
40870
|
+
maxLength: 30,
|
|
40871
|
+
allowNamespace: true,
|
|
40872
|
+
};
|
|
40873
|
+
}
|
|
40874
|
+
getDescription() {
|
|
40875
|
+
// todo
|
|
40876
|
+
return undefined;
|
|
40877
|
+
}
|
|
40878
|
+
}
|
|
40879
|
+
exports.ATCCheckVariant = ATCCheckVariant;
|
|
40880
|
+
//# sourceMappingURL=atc_check_variant.js.map
|
|
40881
|
+
|
|
40882
|
+
/***/ }),
|
|
40883
|
+
|
|
40757
40884
|
/***/ "./node_modules/@abaplint/core/build/src/objects/authorization_check_field.js":
|
|
40758
40885
|
/*!************************************************************************************!*\
|
|
40759
40886
|
!*** ./node_modules/@abaplint/core/build/src/objects/authorization_check_field.js ***!
|
|
@@ -43456,6 +43583,9 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
43456
43583
|
__exportStar(__webpack_require__(/*! ./activation_variant */ "./node_modules/@abaplint/core/build/src/objects/activation_variant.js"), exports);
|
|
43457
43584
|
__exportStar(__webpack_require__(/*! ./api_release_state */ "./node_modules/@abaplint/core/build/src/objects/api_release_state.js"), exports);
|
|
43458
43585
|
__exportStar(__webpack_require__(/*! ./assignment_service_to_authorization_group */ "./node_modules/@abaplint/core/build/src/objects/assignment_service_to_authorization_group.js"), exports);
|
|
43586
|
+
__exportStar(__webpack_require__(/*! ./atc_check_category */ "./node_modules/@abaplint/core/build/src/objects/atc_check_category.js"), exports);
|
|
43587
|
+
__exportStar(__webpack_require__(/*! ./atc_check_object */ "./node_modules/@abaplint/core/build/src/objects/atc_check_object.js"), exports);
|
|
43588
|
+
__exportStar(__webpack_require__(/*! ./atc_check_variant */ "./node_modules/@abaplint/core/build/src/objects/atc_check_variant.js"), exports);
|
|
43459
43589
|
__exportStar(__webpack_require__(/*! ./authorization_check_field */ "./node_modules/@abaplint/core/build/src/objects/authorization_check_field.js"), exports);
|
|
43460
43590
|
__exportStar(__webpack_require__(/*! ./authorization_group */ "./node_modules/@abaplint/core/build/src/objects/authorization_group.js"), exports);
|
|
43461
43591
|
__exportStar(__webpack_require__(/*! ./authorization_object_class */ "./node_modules/@abaplint/core/build/src/objects/authorization_object_class.js"), exports);
|
|
@@ -46933,7 +47063,7 @@ class Registry {
|
|
|
46933
47063
|
}
|
|
46934
47064
|
static abaplintVersion() {
|
|
46935
47065
|
// magic, see build script "version.sh"
|
|
46936
|
-
return "2.101.
|
|
47066
|
+
return "2.101.3";
|
|
46937
47067
|
}
|
|
46938
47068
|
getDDICReferences() {
|
|
46939
47069
|
return this.ddicReferences;
|
|
@@ -50127,6 +50257,9 @@ class CloudTypes {
|
|
|
50127
50257
|
|| obj instanceof Objects.InboundService
|
|
50128
50258
|
|| obj instanceof Objects.Interface
|
|
50129
50259
|
|| obj instanceof Objects.LockObject
|
|
50260
|
+
|| obj instanceof Objects.ATCCheckCategory
|
|
50261
|
+
|| obj instanceof Objects.ATCCheckObject
|
|
50262
|
+
|| obj instanceof Objects.ATCCheckVariant
|
|
50130
50263
|
|| obj instanceof Objects.MessageClass
|
|
50131
50264
|
|| obj instanceof Objects.Package
|
|
50132
50265
|
|| obj instanceof Objects.RestrictionType
|
|
@@ -71862,17 +71995,17 @@ class Transpiler {
|
|
|
71862
71995
|
return new Transpiler().run(reg);
|
|
71863
71996
|
}
|
|
71864
71997
|
async run(reg, progress) {
|
|
71865
|
-
var _a, _b, _c, _d, _e
|
|
71998
|
+
var _a, _b, _c, _d, _e;
|
|
71866
71999
|
reg.parse();
|
|
71867
72000
|
new keywords_1.Keywords((_a = this.options) === null || _a === void 0 ? void 0 : _a.keywords).handle(reg);
|
|
71868
72001
|
this.validate(reg);
|
|
71869
72002
|
const dbSetup = new db_1.DatabaseSetup(reg).run(this.options);
|
|
71870
72003
|
const output = {
|
|
71871
72004
|
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, (
|
|
72005
|
+
unitTestScript: new unit_test_1.UnitTest().unitTestScript(reg, (_b = this.options) === null || _b === void 0 ? void 0 : _b.skip),
|
|
72006
|
+
unitTestScriptOpen: new unit_test_1.UnitTest().unitTestScriptOpen(reg, (_c = this.options) === null || _c === void 0 ? void 0 : _c.skip),
|
|
72007
|
+
initializationScript: new unit_test_1.UnitTest().initializationScript(reg, dbSetup, (_d = this.options) === null || _d === void 0 ? void 0 : _d.extraSetup),
|
|
72008
|
+
initializationScript2: new unit_test_1.UnitTest().initializationScript(reg, dbSetup, (_e = this.options) === null || _e === void 0 ? void 0 : _e.extraSetup, true),
|
|
71876
72009
|
databaseSetup: dbSetup,
|
|
71877
72010
|
reg: reg,
|
|
71878
72011
|
};
|
|
@@ -79506,7 +79639,7 @@ export async function initializeABAP() {\n`;
|
|
|
79506
79639
|
// 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
79640
|
return filename.replace(/\//g, "%23");
|
|
79508
79641
|
}
|
|
79509
|
-
unitTestScriptOpen(reg, _skip
|
|
79642
|
+
unitTestScriptOpen(reg, _skip) {
|
|
79510
79643
|
let ret = `/* eslint-disable curly */
|
|
79511
79644
|
import fs from "fs";
|
|
79512
79645
|
import path from "path";
|
|
@@ -79561,7 +79694,90 @@ run().then(() => {
|
|
|
79561
79694
|
});`;
|
|
79562
79695
|
return ret;
|
|
79563
79696
|
}
|
|
79564
|
-
|
|
79697
|
+
getSortedTests(reg) {
|
|
79698
|
+
const tests = [];
|
|
79699
|
+
for (const obj of reg.getObjects()) {
|
|
79700
|
+
if (reg.isDependency(obj) || !(obj instanceof abaplint.Objects.Class)) {
|
|
79701
|
+
continue;
|
|
79702
|
+
}
|
|
79703
|
+
const hasTestFile = obj.getFiles().some(f => { return f.getFilename().includes(".testclasses."); });
|
|
79704
|
+
if (hasTestFile === false) {
|
|
79705
|
+
continue;
|
|
79706
|
+
}
|
|
79707
|
+
for (const file of obj.getABAPFiles()) {
|
|
79708
|
+
for (const def of file.getInfo().listClassDefinitions()) {
|
|
79709
|
+
if (def.isForTesting === false
|
|
79710
|
+
|| def.isGlobal === true
|
|
79711
|
+
|| def.methods.length === 0
|
|
79712
|
+
|| def.isAbstract === true) {
|
|
79713
|
+
// todo, fix, there might be global test methods
|
|
79714
|
+
continue;
|
|
79715
|
+
}
|
|
79716
|
+
const methods = [];
|
|
79717
|
+
for (const m of def.methods) {
|
|
79718
|
+
if (m.isForTesting === false) {
|
|
79719
|
+
continue;
|
|
79720
|
+
}
|
|
79721
|
+
methods.push(m.name);
|
|
79722
|
+
}
|
|
79723
|
+
tests.push({
|
|
79724
|
+
obj,
|
|
79725
|
+
localClass: def.name,
|
|
79726
|
+
riskLevel: def.riskLevel,
|
|
79727
|
+
duration: def.duration,
|
|
79728
|
+
methods: methods,
|
|
79729
|
+
});
|
|
79730
|
+
}
|
|
79731
|
+
}
|
|
79732
|
+
}
|
|
79733
|
+
const toNumber = (riskLevel, duration) => {
|
|
79734
|
+
let int = 0;
|
|
79735
|
+
switch (riskLevel) {
|
|
79736
|
+
case abaplint.Info.RiskLevel.harmless:
|
|
79737
|
+
int = 10;
|
|
79738
|
+
break;
|
|
79739
|
+
case abaplint.Info.RiskLevel.critical:
|
|
79740
|
+
int = 20;
|
|
79741
|
+
break;
|
|
79742
|
+
case abaplint.Info.RiskLevel.dangerous:
|
|
79743
|
+
int = 30;
|
|
79744
|
+
break;
|
|
79745
|
+
default:
|
|
79746
|
+
break;
|
|
79747
|
+
}
|
|
79748
|
+
switch (duration) {
|
|
79749
|
+
case abaplint.Info.Duration.short:
|
|
79750
|
+
int += 1;
|
|
79751
|
+
break;
|
|
79752
|
+
case abaplint.Info.Duration.medium:
|
|
79753
|
+
int += 2;
|
|
79754
|
+
break;
|
|
79755
|
+
case abaplint.Info.Duration.long:
|
|
79756
|
+
int += 3;
|
|
79757
|
+
break;
|
|
79758
|
+
default:
|
|
79759
|
+
break;
|
|
79760
|
+
}
|
|
79761
|
+
return int;
|
|
79762
|
+
};
|
|
79763
|
+
tests.sort((a, b) => {
|
|
79764
|
+
const ai = toNumber(a.riskLevel, a.duration);
|
|
79765
|
+
const bi = toNumber(b.riskLevel, b.duration);
|
|
79766
|
+
let ret = ai - bi;
|
|
79767
|
+
if (ret === 0) {
|
|
79768
|
+
// if risk and duration are equal, then sort by name
|
|
79769
|
+
if (a.obj.getName() < b.obj.getName()) {
|
|
79770
|
+
ret = -1;
|
|
79771
|
+
}
|
|
79772
|
+
else if (a.obj.getName() > b.obj.getName()) {
|
|
79773
|
+
ret = 1;
|
|
79774
|
+
}
|
|
79775
|
+
}
|
|
79776
|
+
return ret;
|
|
79777
|
+
});
|
|
79778
|
+
return tests;
|
|
79779
|
+
}
|
|
79780
|
+
unitTestScript(reg, skip) {
|
|
79565
79781
|
let ret = `/* eslint-disable curly */
|
|
79566
79782
|
import fs from "fs";
|
|
79567
79783
|
import path from "path";
|
|
@@ -79578,54 +79794,86 @@ async function run() {
|
|
|
79578
79794
|
let locl;
|
|
79579
79795
|
let meth;
|
|
79580
79796
|
try {\n`;
|
|
79581
|
-
for (const
|
|
79582
|
-
if (reg.isDependency(obj) || !(obj instanceof abaplint.Objects.Class)) {
|
|
79583
|
-
continue;
|
|
79584
|
-
}
|
|
79797
|
+
for (const st of this.getSortedTests(reg)) {
|
|
79585
79798
|
ret += `// --------------------------------------------\n`;
|
|
79586
|
-
ret += ` clas = unit.addObject("${obj.getName()}");\n`;
|
|
79587
|
-
|
|
79799
|
+
ret += ` clas = unit.addObject("${st.obj.getName()}");\n`;
|
|
79800
|
+
ret += ` {
|
|
79801
|
+
const {${st.localClass}} = await import("./${this.escapeNamespace(st.obj.getName().toLowerCase())}.${st.obj.getType().toLowerCase()}.testclasses.mjs");
|
|
79802
|
+
locl = clas.addTestClass("${st.localClass}");
|
|
79803
|
+
if (${st.localClass}.class_setup) await ${st.localClass}.class_setup();\n`;
|
|
79804
|
+
for (const m of st.methods) {
|
|
79805
|
+
const skipThis = (skip || []).some(a => a.object === st.obj.getName() && a.class === st.localClass && a.method === m);
|
|
79806
|
+
if (skipThis) {
|
|
79807
|
+
ret += ` console.log('${st.obj.getName()}: running ${st.localClass}->${m}, skipped');\n`;
|
|
79808
|
+
ret += ` meth = locl.addMethod("${m}");\n`;
|
|
79809
|
+
ret += ` meth.skip();\n`;
|
|
79810
|
+
continue;
|
|
79811
|
+
}
|
|
79812
|
+
ret += ` {\n const test = await (new ${st.localClass}()).constructor_();\n`;
|
|
79813
|
+
ret += ` if (test.setup) await test.setup();\n`;
|
|
79814
|
+
ret += ` console.log("${st.obj.getName()}: running ${st.localClass}->${m}");\n`;
|
|
79815
|
+
ret += ` meth = locl.addMethod("${m}");\n`;
|
|
79816
|
+
ret += ` await test.${m}();\n`;
|
|
79817
|
+
ret += ` meth.pass();\n`;
|
|
79818
|
+
ret += ` if (test.teardown) await test.teardown();\n`;
|
|
79819
|
+
ret += ` }\n`;
|
|
79820
|
+
}
|
|
79821
|
+
ret += ` if (${st.localClass}.class_teardown) await ${st.localClass}.class_teardown();\n`;
|
|
79822
|
+
ret += ` }\n`;
|
|
79823
|
+
}
|
|
79824
|
+
/*
|
|
79825
|
+
for (const obj of reg.getObjects()) {
|
|
79826
|
+
if (reg.isDependency(obj) || !(obj instanceof abaplint.Objects.Class)) {
|
|
79827
|
+
continue;
|
|
79828
|
+
}
|
|
79829
|
+
ret += `// --------------------------------------------\n`;
|
|
79830
|
+
ret += ` clas = unit.addObject("${obj.getName()}");\n`;
|
|
79831
|
+
for (const file of obj.getABAPFiles()) {
|
|
79588
79832
|
for (const def of file.getInfo().listClassDefinitions()) {
|
|
79589
|
-
|
|
79590
|
-
|
|
79591
|
-
|
|
79592
|
-
|
|
79593
|
-
|
|
79594
|
-
|
|
79595
|
-
|
|
79596
|
-
|
|
79597
|
-
|
|
79598
|
-
|
|
79833
|
+
if (def.isForTesting === false
|
|
79834
|
+
|| def.isGlobal === true
|
|
79835
|
+
|| def.methods.length === 0
|
|
79836
|
+
|| def.isAbstract === true) {
|
|
79837
|
+
// todo, fix, there might be global test methods
|
|
79838
|
+
continue;
|
|
79839
|
+
}
|
|
79840
|
+
const hasTestFile = obj.getFiles().some(f => { return f.getFilename().includes(".testclasses."); });
|
|
79841
|
+
if (hasTestFile === false) {
|
|
79842
|
+
break;
|
|
79843
|
+
}
|
|
79844
|
+
ret += ` {
|
|
79845
|
+
const {${def.name}} = await import("./${this.escapeNamespace(obj.getName().toLowerCase())}.${obj.getType().toLowerCase()}.testclasses.mjs");
|
|
79846
|
+
locl = clas.addTestClass("${def.name}");
|
|
79847
|
+
if (${def.name}.class_setup) await ${def.name}.class_setup();\n`;
|
|
79848
|
+
|
|
79849
|
+
for (const m of def.methods) {
|
|
79850
|
+
if (m.isForTesting === false) {
|
|
79851
|
+
continue;
|
|
79599
79852
|
}
|
|
79600
|
-
|
|
79601
|
-
|
|
79602
|
-
|
|
79603
|
-
|
|
79604
|
-
|
|
79605
|
-
|
|
79606
|
-
continue;
|
|
79607
|
-
}
|
|
79608
|
-
const skipThis = (skip || []).some(a => a.object === obj.getName() && a.class === def.name && a.method === m.name);
|
|
79609
|
-
if (skipThis) {
|
|
79610
|
-
ret += ` console.log('${obj.getName()}: running ${def.name}->${m.name}, skipped');\n`;
|
|
79611
|
-
ret += ` meth = locl.addMethod("${m.name}");\n`;
|
|
79612
|
-
ret += ` meth.skip();\n`;
|
|
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`;
|
|
79853
|
+
const skipThis = (skip || []).some(a => a.object === obj.getName() && a.class === def.name && a.method === m.name);
|
|
79854
|
+
if (skipThis) {
|
|
79855
|
+
ret += ` console.log('${obj.getName()}: running ${def.name}->${m.name}, skipped');\n`;
|
|
79856
|
+
ret += ` meth = locl.addMethod("${m.name}");\n`;
|
|
79857
|
+
ret += ` meth.skip();\n`;
|
|
79858
|
+
continue;
|
|
79623
79859
|
}
|
|
79624
|
-
|
|
79625
|
-
ret += `
|
|
79860
|
+
|
|
79861
|
+
ret += ` {\n const test = await (new ${def.name}()).constructor_();\n`;
|
|
79862
|
+
ret += ` if (test.setup) await test.setup();\n`;
|
|
79863
|
+
ret += ` console.log("${obj.getName()}: running ${def.name}->${m.name}");\n`;
|
|
79864
|
+
ret += ` meth = locl.addMethod("${m.name}");\n`;
|
|
79865
|
+
ret += ` await test.${m.name}();\n`;
|
|
79866
|
+
ret += ` meth.pass();\n`;
|
|
79867
|
+
ret += ` if (test.teardown) await test.teardown();\n`;
|
|
79868
|
+
ret += ` }\n`;
|
|
79869
|
+
}
|
|
79870
|
+
|
|
79871
|
+
ret += ` if (${def.name}.class_teardown) await ${def.name}.class_teardown();\n`;
|
|
79872
|
+
ret += ` }\n`;
|
|
79626
79873
|
}
|
|
79874
|
+
}
|
|
79627
79875
|
}
|
|
79628
|
-
|
|
79876
|
+
*/
|
|
79629
79877
|
ret += `// -------------------END-------------------
|
|
79630
79878
|
fs.writeFileSync(__dirname + path.sep + "_output.xml", unit.xUnitXML());
|
|
79631
79879
|
} 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.9",
|
|
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.9",
|
|
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.3",
|
|
35
35
|
"progress": "^2.0.3",
|
|
36
36
|
"webpack": "^5.83.1",
|
|
37
37
|
"webpack-cli": "^5.1.1",
|