This commit is contained in:
anon 2024-07-08 01:46:51 +02:00
parent c639d069e2
commit fac41e0ba9
8 changed files with 38 additions and 0 deletions

1
.gitignore vendored
View File

@ -27,6 +27,7 @@ __pycache__/
*.tags
tags
tags.*
tmp-*
# Misc.
*.bak
*.tmp

View File

@ -0,0 +1,4 @@
{
"test/CMDTEST_myproject.rb:CMDTEST_example.test_1": "a83763efa39e0cac46b48f9991ca7211",
"test/CMDTEST_myproject.rb:CMDTEST_example.test_2": "489a7228b82116af1800ee07a1d6ddbc"
}

6
Misc./cmdtest/Makefile Normal file
View File

@ -0,0 +1,6 @@
main:
bake program.c
bake program2.c
test: main
ORIGIN="$$(realpath .)" PATH="$$(realpath .):$${PATH}" cmdtest

View File

4
Misc./cmdtest/program.c Normal file
View File

@ -0,0 +1,4 @@
// @BAKE gcc $@ -o $*.out
signed main() {
return 17;
}

4
Misc./cmdtest/program2.c Normal file
View File

@ -0,0 +1,4 @@
// @BAKE gcc $@ -o $*.out
signed main(int argc, char * argv[]) {
return !fopen(argv[1], "r");
}

View File

@ -0,0 +1,2 @@
{
}

View File

@ -0,0 +1,17 @@
require 'fileutils'
class CMDTEST_example < Cmdtest::Testcase
def test_1
cmd "program.out" do
exit_status 17
end
end
def test_2
arg_file = ENV['ORIGIN'] + "/debug/testfile.txt"
cmd "program2.out " + arg_file do
end
end
end