Skip to content

Commit 640f2e0

Browse files
committed
Add simple tests for {,dist,maintainer-}clean cleanup
1 parent 1c65da8 commit 640f2e0

1 file changed

Lines changed: 67 additions & 0 deletions

File tree

.github/jobs/configure-checks/all.bats

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -458,3 +458,70 @@ compile_assertions_finished () {
458458
run make judgehost
459459
assert_failure 2
460460
}
461+
462+
@test "`make distclean` cleans the state to state of `make dist`" {
463+
run make dist
464+
465+
# Cleanup of all configure created files
466+
files_before=$(find . -type f &> | sort)
467+
run run_configure
468+
files_configure=$(find . -type f &> | sort)
469+
run test "$files_before" = "$files_configure"
470+
assert_failure
471+
run make distclean
472+
files_after=$(find . -type f &> | sort)
473+
run test "$files_before" = "$files_after"
474+
assert_success
475+
476+
# Cleanup of all configure + make targets files
477+
files_before=$(find . -type f &> | sort)
478+
run run_configure
479+
run make domserver judgehost docs
480+
files_make_targets=$(find . -type f &> | sort)
481+
run test "$files_before" = "$files_make_targets"
482+
assert_failure
483+
run make distclean
484+
files_after=$(find . -type f &> | sort)
485+
run test "$files_before" = "$files_after"
486+
assert_success
487+
}
488+
489+
@test "maintainer installation with `make maintainer-clean` cleans the state to the initial state" {
490+
files_before=$(find . -type f &> | sort)
491+
run make maintainer-conf maintainer-install
492+
files_make=$(find . -type f &> | sort)
493+
run test "$files_before" = "$files_configure"
494+
assert_failure
495+
run make maintainer-clean
496+
files_after=$(find . -type f &> | sort)
497+
run test "$files_before" = "$files_after"
498+
assert_success
499+
}
500+
501+
@test "normal installation with `make maintainer-clean` cleans the state to the initial state" {
502+
files_before=$(find . -type f &> | sort)
503+
run make dist
504+
run run_configure
505+
run make domserver judgehost docs
506+
files_make=$(find . -type f &> | sort)
507+
run test "$files_before" = "$files_configure"
508+
assert_failure
509+
run make maintainer-clean
510+
files_after=$(find . -type f &> | sort)
511+
run test "$files_before" = "$files_after"
512+
assert_success
513+
}
514+
515+
@test "`make clean` cleans the state to state of `configure`" {
516+
run make dist
517+
run run_configure
518+
files_before=$(find . -type f &> | sort)
519+
run make domserver judgehost docs
520+
files_make_targets=$(find . -type f &> | sort)
521+
run test "$files_before" = "$files_make_targets"
522+
assert_failure
523+
run make clean
524+
files_after=$(find . -type f &> | sort)
525+
run test "$files_before" = "$files_after"
526+
assert_success
527+
}

0 commit comments

Comments
 (0)