Skip to content

Commit

Permalink
let's see what happens
Browse files Browse the repository at this point in the history
  • Loading branch information
sombriks committed Jun 29, 2024
1 parent 449631b commit 976c160
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 9 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/node-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ jobs:
sudo apt-get install gpiod libgpiod2 libgpiod-dev libnode-dev -y
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Configure Node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.version }}
registry-url: 'https://registry.npmjs.org'
Expand All @@ -30,5 +30,5 @@ jobs:
run: |
npm ci
npm run build
npm run configure-gpio-sim
npm run test:coverage
2 changes: 2 additions & 0 deletions test/00-misc.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const gpiod = require("..");
const assert = require("assert");

describe("libgpiod miscellaneous bindings", function () {

it("should get libgpiod version", function (done) {
console.log(gpiod.version());
done();
Expand Down Expand Up @@ -31,4 +32,5 @@ describe("libgpiod miscellaneous bindings", function () {
}
}, 70);
});

});
12 changes: 7 additions & 5 deletions test/02-line.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@ const gpiod = require("../");
const assert = require("assert");

describe("libgpiod line bindings", () => {
xit("should get a line from the chip", (done) => {

it("should get a line from the chip", (done) => {
const chip0 = new gpiod.Chip("gpiochip0");
assert(chip0.getLine(17));
done();
});
xit("should NOT get a nonexistent line from the chip", (done) => {

it("should NOT get a nonexistent line from the chip", (done) => {
const chip0 = new gpiod.Chip("gpiochip0");
try {
const line17 = new gpiod.Line(chip0, 1700);
Expand All @@ -17,7 +19,7 @@ describe("libgpiod line bindings", () => {
}
});

xit("should set line value", (done) => {
it("should set line value", (done) => {
const chip0 = new gpiod.Chip("gpiochip0");
const line17 = new gpiod.Line(chip0, 17);
line17.requestOutputMode();
Expand All @@ -28,7 +30,7 @@ describe("libgpiod line bindings", () => {
}, 500);
});

xit("should get line value", (done) => {
it("should get line value", (done) => {
const chip0 = new gpiod.Chip("gpiochip0");
const line17 = chip0.getLine(17);
line17.requestInputMode();
Expand All @@ -37,7 +39,7 @@ describe("libgpiod line bindings", () => {
done();
});

xit("should blink line value", (done) => {
it("should blink line value", (done) => {
const chip0 = new gpiod.Chip("gpiochip0");
const line17 = new gpiod.Line(chip0, 17);
line17.requestOutputMode();
Expand Down
2 changes: 1 addition & 1 deletion test/03-pin.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const assert = require("assert");

describe("libgpiod Pin sugar", () => {

xit("should create a Pin for line 10", done => {
it("should create a Pin for line 10", done => {
const pin = new gpiod.Pin(10);
assert(pin instanceof gpiod.Line);
done();
Expand Down
2 changes: 2 additions & 0 deletions test/prepare-gpio-sim.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,10 @@ for i in $(seq 1 40)
do
mkdir -p /sys/kernel/config/gpio-sim/fakegpio/gpio-bank0/line$i
done
echo 40 > /sys/kernel/config/gpio-sim/fakegpio/gpio-bank0/num_lines
echo 1 > /sys/kernel/config/gpio-sim/fakegpio/live
gpiodetect
gpioinfo
chmod a+rw /dev/gpiochip*

echo "run sudo sh -c 'echo 0 > /sys/kernel/config/gpio-sim/fakegpio/live' to modify the simulator setup"

0 comments on commit 976c160

Please sign in to comment.