-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
27 changed files
with
163 additions
and
109 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,2 @@ | ||
# test/always_rebuild_if_no_inputs.hancho | ||
|
||
always_rebuilt = Rule( | ||
command = "touch {files_out}", | ||
) | ||
|
||
always_rebuilt([], "result.txt") | ||
rules = load("rules.hancho") | ||
rules.touch_outputs([], "result.txt") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,3 @@ | ||
# tests/build_dir_works.hancho | ||
|
||
rules = load("rules.hancho") | ||
config.build_dir = "build/build_dir_works" | ||
|
||
build_dir_works = Rule( | ||
command = "touch {files_out}", | ||
) | ||
|
||
build_dir_works([], "result.txt") | ||
rules.touch_outputs([], "result.txt") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,5 @@ | ||
# tests/check_output.hancho | ||
|
||
check_output = Rule( | ||
command = "touch {files_out[0]}", | ||
) | ||
check_output = Rule(command = "echo foo > {files_out[0]}") | ||
|
||
check_output(__file__, ["result.txt", "not_modified.txt"]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,2 @@ | ||
# tests/command_missing.hancho | ||
|
||
command_missing = Rule( | ||
) | ||
|
||
command_missing = Rule() | ||
command_missing(__file__) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,2 @@ | ||
# tests/does_create_output | ||
|
||
does_create_output = Rule( | ||
command = "touch {files_out}", | ||
) | ||
|
||
does_create_output([], files_out = "result.txt") | ||
rules = load("rules.hancho") | ||
rules.touch_outputs([], files_out = "result.txt") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,2 @@ | ||
# tests/doesnt_create_output.hancho | ||
|
||
doesnt_create_output = Rule( | ||
command = ":", | ||
) | ||
|
||
doesnt_create_output = Rule(command = ":") | ||
doesnt_create_output(__file__, "result.txt") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,2 @@ | ||
# tests/garbage_command.hancho | ||
|
||
garbage_command = Rule( | ||
command = "aklsjdflksjdlfkjldfk", | ||
) | ||
|
||
garbage_command = Rule(command = "aklsjdflksjdlfkjldfk") | ||
garbage_command(__file__, "result.txt") |
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,2 @@ | ||
|
||
header_changed = Rule( | ||
command = "gcc -MMD -c {files_in} -o {files_out}", | ||
files_out = "{swap_ext(files_in, '.o')}", | ||
depfile = "{swap_ext(files_out, '.d')}", | ||
) | ||
|
||
header_changed("src/test.cpp") | ||
rules = load("rules.hancho") | ||
rules.compile_cpp("src/test.cpp") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,2 @@ | ||
|
||
input_changed = Rule( | ||
command = "gcc -MMD -c {files_in} -o {files_out}", | ||
files_out = "{swap_ext(files_in, '.o')}", | ||
depfile = "{swap_ext(files_out, '.d')}", | ||
) | ||
|
||
input_changed("src/test.cpp") | ||
rules = load("rules.hancho") | ||
rules.compile_cpp("src/test.cpp") |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,2 @@ | ||
# tests/missing_src.hancho | ||
|
||
missing_src = Rule( | ||
command = "touch {files_out}", | ||
) | ||
|
||
missing_src("src/does_not_exist.txt", "build/missing_src.txt") | ||
rules = load("rules.hancho") | ||
rules.touch_outputs("src/does_not_exist.txt", "build/missing_src.txt") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import os | ||
|
||
if os.name == 'nt': | ||
compile_command = "cl.exe /c {files_in} /sourceDependencies {depfile} /Fo:{files_out}" | ||
elif os.name == 'posix': | ||
compile_command = "gcc -MMD -c {files_in} -o {files_out}" | ||
else: | ||
compile_command = "<unknown OS>" | ||
|
||
compile_cpp = Rule( | ||
command = compile_command, | ||
files_out = "{swap_ext(files_in, '.o')}", | ||
depfile = "{swap_ext(files_out, '.d')}", | ||
) | ||
|
||
touch_outputs = Rule( | ||
command = async_touch | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#include <stdio.h> | ||
#include "main.hpp" | ||
|
||
int main(int argc, char** argv) { | ||
printf(message()); | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#pragma once | ||
|
||
inline const char* message() { | ||
return "Hello World!!!\n"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
|
||
|
||
def sync_command(task): | ||
print("hello world") | ||
touch(task.files_out[0]) | ||
return task.files_out | ||
|
||
rule = Rule( | ||
command = sync_command | ||
) | ||
|
||
rule(__file__, "result.txt") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.