+cmdtest
This commit is contained in:
parent
c639d069e2
commit
fac41e0ba9
1
.gitignore
vendored
1
.gitignore
vendored
@ -27,6 +27,7 @@ __pycache__/
|
|||||||
*.tags
|
*.tags
|
||||||
tags
|
tags
|
||||||
tags.*
|
tags.*
|
||||||
|
tmp-*
|
||||||
# Misc.
|
# Misc.
|
||||||
*.bak
|
*.bak
|
||||||
*.tmp
|
*.tmp
|
||||||
|
4
Misc./cmdtest/.cmdtest-filter
Normal file
4
Misc./cmdtest/.cmdtest-filter
Normal 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
6
Misc./cmdtest/Makefile
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
main:
|
||||||
|
bake program.c
|
||||||
|
bake program2.c
|
||||||
|
|
||||||
|
test: main
|
||||||
|
ORIGIN="$$(realpath .)" PATH="$$(realpath .):$${PATH}" cmdtest
|
0
Misc./cmdtest/debug/testfile.txt
Normal file
0
Misc./cmdtest/debug/testfile.txt
Normal file
4
Misc./cmdtest/program.c
Normal file
4
Misc./cmdtest/program.c
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
// @BAKE gcc $@ -o $*.out
|
||||||
|
signed main() {
|
||||||
|
return 17;
|
||||||
|
}
|
4
Misc./cmdtest/program2.c
Normal file
4
Misc./cmdtest/program2.c
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
// @BAKE gcc $@ -o $*.out
|
||||||
|
signed main(int argc, char * argv[]) {
|
||||||
|
return !fopen(argv[1], "r");
|
||||||
|
}
|
2
Misc./cmdtest/test/.cmdtest-filter
Normal file
2
Misc./cmdtest/test/.cmdtest-filter
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
{
|
||||||
|
}
|
17
Misc./cmdtest/test/CMDTEST_myproject.rb
Normal file
17
Misc./cmdtest/test/CMDTEST_myproject.rb
Normal 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
|
Loading…
x
Reference in New Issue
Block a user