Browse Source

build: fix LF endings on test

VerteDinde 10 months ago
parent
commit
59063774d9

+ 1 - 1
patches/nan/.patches

@@ -2,5 +2,5 @@ use_new_constructor_for_scriptorigin_when_17_x.patch
 fix_define_nan_copyablepersistenttraits_for_v8_12_5.patch
 remove_deprecated_v8_isolate_idlenotificationdeadline.patch
 remove_several_apis_deprecated_in_version_12_6.patch
-apply_allcan_read_write.patch
 apply_allcan_read_write_test.patch
+apply_allcan_read_write.patch

+ 48 - 1
patches/nan/apply_allcan_read_write.patch

@@ -1,7 +1,9 @@
 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
 From: Keeley Hammond <[email protected]>
 Date: Thu, 20 Jun 2024 14:42:08 -0700
-Subject: Check for NODE_21_0_MODULE_VERSION
+Subject: Remove Allcan Read Write
+
+Check for NODE_21_0_MODULE_VERSION
 
 Refs https://chromium-review.googlesource.com/c/v8/v8/+/5006387
 Should be upstreamed.
@@ -15,6 +17,7 @@ Steps for upstreaming this patch:
 - Get a new module version assigned for Electron 29 in nodejs/node
 - Update NODE_21_0_MODULE_VERSION to the new version number
 - Upstream patch to nodejs/nan before Electron 29 is branched
+- Ensure that methodswithdata-test.js uses LF line endings
 
 diff --git a/nan.h b/nan.h
 index 9a9112afe0cc94ce58ed3cce9763ace7c160a932..f4865a77e60d5105ed2426037984ddcbfa58bbca 100644
@@ -139,3 +142,47 @@ index e6ad45737e2ac18da3fa936b1de618e7389933bc..025f5b66774c2f5fe0ccb98c91fc714d
    t.equal(derived.prop2, 'setting a new value')
 -  t.equal(settergetter.prop2, 'setting a new value')
  })
+diff --git a/test/js/methodswithdatalf-test.js b/test/js/methodswithdatalf-test.js
+new file mode 100644
+index 0000000000000000000000000000000000000000..5db3fae7e075b3428810948bdcfee5b8b97c343c
+--- /dev/null
++++ b/test/js/methodswithdatalf-test.js
+@@ -0,0 +1,37 @@
++/*********************************************************************
++ * NAN - Native Abstractions for Node.js
++ *
++ * Copyright (c) 2019 NAN contributors
++ *
++ * MIT License <https://github.com/nodejs/nan/blob/master/LICENSE.md>
++ ********************************************************************/
++
++const test     = require('tap').test
++    , testRoot = require('path').resolve(__dirname, '..')
++    , bindings = require('bindings')({ module_root: testRoot, bindings: 'methodswithdata' })
++
++test('SetMethod with data', function (t) {
++    t.plan(1);
++    t.ok(bindings.testWithData());
++});
++
++test('accessors with data', function (t) {
++    t.plan(7)
++    var settergetter = bindings.create()
++    t.equal(settergetter.prop1, 'this is property 1')
++    t.ok(settergetter.prop2 === '')
++    settergetter.prop2 = 'setting a value'
++    t.equal(settergetter.prop2, 'setting a value')
++    t.equal(settergetter.log(),
++      'New()\n' +
++      'Prop1:GETTER(this is property 1)\n' +
++      'Prop2:GETTER()\n' +
++      'Prop2:SETTER(setting a value)\n' +
++      'Prop2:GETTER(setting a value)\n'
++    )
++    var derived = Object.create(settergetter)
++    t.equal(derived.prop1, 'this is property 1')
++    derived.prop2 = 'setting a new value'
++    t.equal(derived.prop2, 'setting a new value')
++    t.equal(settergetter.prop2, 'setting a new value')
++  })
+\ No newline at end of file

+ 41 - 17
patches/nan/apply_allcan_read_write_test.patch

@@ -1,7 +1,7 @@
 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
 From: Alice Zhao <[email protected]>
 Date: Thu, 20 Jun 2024 14:50:13 -0700
-Subject: test: patch CRLF test file for allcan_read_write patch
+Subject: test: delete test file for allcan_read_write patch
 
 Refs https://chromium-review.googlesource.com/c/v8/v8/+/5006387
 Should be upstreamed.
@@ -12,23 +12,47 @@ seperately. When this patch is removed, also remove the eol=crlf
 exception in .gitattributes.
 
 diff --git a/test/js/methodswithdata-test.js b/test/js/methodswithdata-test.js
-index 9f4fc5246f1ca3d8faadc9a72d49e14a6a190e32..795538510431fb3b633be37f916d4ce1955c808a 100644
+deleted file mode 100644
+index 9f4fc5246f1ca3d8faadc9a72d49e14a6a190e32..0000000000000000000000000000000000000000
 --- a/test/js/methodswithdata-test.js
-+++ b/test/js/methodswithdata-test.js
-@@ -16,7 +16,7 @@ test('SetMethod with data', function (t) {
- });
- 
- test('accessors with data', function (t) {
++++ /dev/null
+@@ -1,38 +0,0 @@
+-/*********************************************************************
+- * NAN - Native Abstractions for Node.js
+- *
+- * Copyright (c) 2019 NAN contributors
+- *
+- * MIT License <https://github.com/nodejs/nan/blob/master/LICENSE.md>
+- ********************************************************************/
+-
+-const test     = require('tap').test
+-    , testRoot = require('path').resolve(__dirname, '..')
+-    , bindings = require('bindings')({ module_root: testRoot, bindings: 'methodswithdata' })
+-
+-test('SetMethod with data', function (t) {
+-    t.plan(1);
+-    t.ok(bindings.testWithData());
+-});
+-
+-test('accessors with data', function (t) {
 -    t.plan(7)
-+    t.plan(6)
-     var settergetter = bindings.create()
-     t.equal(settergetter.prop1, 'this is property 1')
-     t.ok(settergetter.prop2 === '')
-@@ -33,6 +33,5 @@ test('accessors with data', function (t) {
-     t.equal(derived.prop1, 'this is property 1')
-     derived.prop2 = 'setting a new value'
-     t.equal(derived.prop2, 'setting a new value')
+-    var settergetter = bindings.create()
+-    t.equal(settergetter.prop1, 'this is property 1')
+-    t.ok(settergetter.prop2 === '')
+-    settergetter.prop2 = 'setting a value'
+-    t.equal(settergetter.prop2, 'setting a value')
+-    t.equal(settergetter.log(),
+-      'New()\n' +
+-      'Prop1:GETTER(this is property 1)\n' +
+-      'Prop2:GETTER()\n' +
+-      'Prop2:SETTER(setting a value)\n' +
+-      'Prop2:GETTER(setting a value)\n'
+-    )
+-    var derived = Object.create(settergetter)
+-    t.equal(derived.prop1, 'this is property 1')
+-    derived.prop2 = 'setting a new value'
+-    t.equal(derived.prop2, 'setting a new value')
 -    t.equal(settergetter.prop2, 'setting a new value')
-   })
-   
+-  })
+-  
 \ No newline at end of file