Commits

Lukas Erlinghagen  committed 7423df2

- Changed the option--duplicate test to only test the number of hard links on systems that actually support it

  • Participants
  • Parent commits 8ca8b10

Comments (0)

Files changed (1)

File test/option--duplicate.py

 
 bss = test.workpath('build/SConscript')
 
-criterion = {
+criterion_hardlinks = {
     'hard'      : lambda nl, islink: nl == 2 and not islink,
     'soft'      : lambda nl, islink: nl == 1 and islink,
     'copy'      : lambda nl, islink: nl == 1 and not islink,
 }
 
+criterion_no_hardlinks = {
+    'hard'      : lambda nl, islink: not islink,
+    'soft'      : lambda nl, islink: islink,
+    'copy'      : lambda nl, islink: not islink,
+}
+
+# On systems without hard linking, it doesn't make sense to check ST_NLINK
+if hard:
+    criterion = criterion_hardlinks
+else:
+    criterion = criterion_no_hardlinks
+
 description = {
     'hard'      : 'a hard link',
     'soft'      : 'a soft link',