Skip to content

Commit 96a624e

Browse files
authored
Merge pull request ShamrockLee#2 from ShamrockLee/mock-fix
Stop ignoreing the *.config files and fix the mock tests
2 parents e7c5ac7 + 85925a7 commit 96a624e

File tree

5 files changed

+31
-3
lines changed

5 files changed

+31
-3
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
labview_path*.config
21

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99
* Fix the `README.md` typo about the missing double-quote (`"`)
1010
in the `git config` setting, and the table about the default configuration on Windows.
1111

12+
* Stop excluding *.config files from the project tree.
13+
14+
* Fix and rename the LabVIEW mock tests.
15+
1216
### Enhancements
1317
* Remove the `sed` and `grep` dependencies.
1418

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
## LabVIEW executable absolute path
2+
## or a way to call it
3+
## This can be hard-coded
4+
## as well as programmatically defined
5+
LABVIEW_EXECUTABLE="pseudo-labview"
6+
7+
## LvCompare executable absolute path
8+
LVCOMPARE_EXECUTABLE="$(dirname "$BASH_SOURCE")/mock-labview"
9+
10+
## LvMerge executable absolute path
11+
LVMERGE_EXECUTABLE="$(dirname "$BASH_SOURCE")/mock-labview"
12+
13+
## The location of this script. DO NOT EDIT.
14+
CONFIGURATION_SOURCE="$BASH_SOURCE"
15+
16+
## The directory level from the project root to this configuration
17+
## Default to 0 since this configuration is usually placed at the source root
18+
CONFIGURATION_DIRECTORY_LEVEL=2
19+
20+
## Project root (optional)
21+
## Override the auto-detection result and the CONFIGURATION_DIRECTORY_LEVEL setting
22+
# PROJECT_ROOT_FORCED="$HOME/Projects/my-project"

git-labview-integration-posix/test/lv.bats renamed to git-labview-integration-posix/test/mock_labview.bats

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,21 @@
22

33
setup_file() {
44
PROJECT_ROOT="$(cd "$BATS_TEST_DIRNAME/../.."; pwd)"
5+
export PROJECT_ROOT
56
}
67

78
@test "Check lvcompare_as_difftool.sh" {
9+
bats_require_minimum_version 1.5.0
810
run --separate-stderr bash "$PROJECT_ROOT/git-labview-integration-posix/lvcompare_as_difftool.sh" "$PROJECT_ROOT/git-labview-integration-posix/test/labview_path_posix.config" "remote.lv" "local.lv"
9-
outputExpected="$("$PROJECT_ROOT/git-labview-integration-posix/test/pseudo-lv" "$PROJECT_ROOT/remote.lv" "$PROJECT_ROOT/local.lv" "-lvpath" "pseudo-labview" "-nobdcosm" "-nobdpos" "-nofppos")"
11+
outputExpected="$("$PROJECT_ROOT/git-labview-integration-posix/test/mock-labview" "$PROJECT_ROOT/remote.lv" "$PROJECT_ROOT/local.lv" "-lvpath" "pseudo-labview" "-nobdcosm" "-nobdpos" "-nofppos")"
1012
diff <(echo "$output") <(echo "$outputExpected")
1113
[ "$output" == "$outputExpected" ]
1214
}
1315

1416
@test "Check lvmerge_as_mergetool.sh" {
17+
bats_require_minimum_version 1.5.0
1518
run --separate-stderr bash "$PROJECT_ROOT/git-labview-integration-posix/lvmerge_as_mergetool.sh" "$PROJECT_ROOT/git-labview-integration-posix/test/labview_path_posix.config" "base.lv" "remote.lv" "local.lv" "merged.lv"
16-
outputExpected="$("$PROJECT_ROOT/git-labview-integration-posix/test/pseudo-lv" "pseudo-labview" "$PROJECT_ROOT/base.lv" "$PROJECT_ROOT/remote.lv" "$PROJECT_ROOT/local.lv" "$PROJECT_ROOT/merged.lv")"
19+
outputExpected="$("$PROJECT_ROOT/git-labview-integration-posix/test/mock-labview" "pseudo-labview" "$PROJECT_ROOT/base.lv" "$PROJECT_ROOT/remote.lv" "$PROJECT_ROOT/local.lv" "$PROJECT_ROOT/merged.lv")"
1720
diff <(echo "$output") <(echo "$outputExpected")
1821
[ "$output" == "$outputExpected" ]
1922
}

0 commit comments

Comments
 (0)